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

Method draw

Minecraft-Utils/1.13/src/Gui2ndChat.java:47–140  ·  view source on GitHub ↗
(int updateCounter)

Source from the content-addressed store, hash-verified

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

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