MCPcopy Create free account
hub / github.com/5zig/The-5zig-Mod / draw

Method draw

Minecraft-Utils/1.10/src/Gui2ndChat.java:51–144  ·  view source on GitHub ↗
(int updateCounter)

Source from the content-addressed store, hash-verified

49 }
50
51 @Override
52 public void draw(int updateCounter) {
53// ey component = new fe("Test");
54// ez style = new ez();
55// style.a(new ey(ey.a.a, new fe("Hover!")));
56// style.a(new et(et.a.a, "http://google.de"));
57// component.a(style);
58// printChatMessage(component);
59// ((Variables) MinecraftFactory.getVars()).getGuiIngame().d().a(component);
60
61 int scaledWidth = MinecraftFactory.getVars().getScaledWidth();
62 if (MinecraftFactory.getClassProxyCallback().is2ndChatVisible()) {
63 int lineDisplayCount = this.getLineCount();
64 boolean chatOpened = false;
65 int totalChatLines = 0;
66 int chatLineCount = this.singleChatLines.size();
67 float opacity = MinecraftFactory.getClassProxyCallback().get2ndChatOpacity() * 0.9F + 0.1F;
68 if (chatLineCount > 0) {
69 if (this.isChatOpened()) {
70 chatOpened = true;
71 }
72
73 float chatScale = this.getChatScale();
74 int width = op.f((float) this.getChatWidth() / chatScale);
75 GLUtil.pushMatrix();
76 if (Transformer.FORGE) {
77 GLUtil.translate(scaledWidth - getChatWidth(), MinecraftFactory.getVars().getScaledHeight() - 28.0F, 0.0F);
78 } else {
79 GLUtil.translate(scaledWidth - getChatWidth(), 8.0F, 0.0F);
80 }
81 GLUtil.scale(chatScale, chatScale, 1.0F);
82
83 int lineIndex;
84 int ticksPassed;
85 int alpha;
86 for (lineIndex = 0; lineIndex + this.scrollPos < this.singleChatLines.size() && lineIndex < lineDisplayCount; ++lineIndex) {
87 GuiChatLine chatLine = this.singleChatLines.get(lineIndex + this.scrollPos);
88 if (chatLine != null) {
89 ticksPassed = updateCounter - chatLine.getUpdatedCounter();
90 if (ticksPassed < 200 || chatOpened) {
91 double c = (double) ticksPassed / 200.0D;
92 c = 1.0D - c;
93 c *= 10.0D;
94 c = op.a(c, 0.0D, 1.0D);
95 c *= c;
96 alpha = (int) (255.0D * c);
97 if (chatOpened) {
98 alpha = 255;
99 }
100
101 alpha = (int) ((float) alpha * opacity);
102 ++totalChatLines;
103 if (alpha > 3) {
104 int x = 0;
105 int y = -lineIndex * 9;
106 if (!MinecraftFactory.getClassProxyCallback().isChatBackgroundTransparent()) {
107 Gui.drawRect(x, y - 9, x + width + op.d(4f * chatScale), y, alpha / 2 << 24);
108 }

Callers

nothing calls this directly

Calls 15

getVarsMethod · 0.95
getClassProxyCallbackMethod · 0.95
getLineCountMethod · 0.95
isChatOpenedMethod · 0.95
getChatScaleMethod · 0.95
getChatWidthMethod · 0.95
pushMatrixMethod · 0.95
translateMethod · 0.95
scaleMethod · 0.95
getUpdatedCounterMethod · 0.95
drawRectMethod · 0.95
highlightChatLineMethod · 0.95

Tested by

no test coverage detected