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

Method handleMouseInput

Minecraft-Utils/1.12.2/src/GuiListChat.java:41–73  ·  view source on GitHub ↗

Handle Mouse Input

()

Source from the content-addressed store, hash-verified

39 * Handle Mouse Input
40 */
41 @Override
42 public void handleMouseInput() {
43 super.handleMouseInput();
44
45 if (!Display.isActive()) // Don't allow multiple URL-Clicks if Display is not focused.
46 return;
47
48 int mouseX = this.i;
49 int mouseY = this.j;
50
51 if (this.g(mouseY)) {
52 if (Mouse.isButtonDown(0) && this.q()) {
53 int y = mouseY - this.d - this.t + (int) this.n - 4;
54 int id = -1;
55 int minY = -1;
56 // Search for the right ChatLine-ID
57 for (int i1 = 0; i1 < heightMap.size(); i1++) {
58 Integer integer = heightMap.get(i1);
59 Row line = rows.get(i1);
60 if (y >= integer - 2 && y <= integer + line.getLineHeight() - 2) {
61 id = i1;
62 minY = integer;
63 break;
64 }
65 }
66
67 if (id < 0 || id >= rows.size())
68 return;
69
70 callback.chatLineClicked(rows.get(id), mouseX, y, minY, getLeft());
71 }
72 }
73 }
74
75}

Callers

nothing calls this directly

Calls 9

isActiveMethod · 0.95
isButtonDownMethod · 0.95
getLineHeightMethod · 0.95
gMethod · 0.80
sizeMethod · 0.80
handleMouseInputMethod · 0.65
getMethod · 0.65
chatLineClickedMethod · 0.65
getLeftMethod · 0.65

Tested by

no test coverage detected