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

Method draw

Minecraft-Utils/1.12/src/Gui2ndChat.java:48–141  ·  view source on GitHub ↗
(int updateCounter)

Source from the content-addressed store, hash-verified

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

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