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

Method mouseClicked

Minecraft-Utils/1.10/src/GuiList.java:374–396  ·  view source on GitHub ↗
(int mouseX, int mouseY)

Source from the content-addressed store, hash-verified

372 }
373
374 @Override
375 public void mouseClicked(int mouseX, int mouseY) {
376 if (mouseX >= getLeft() && mouseX <= getRight() && mouseY >= getTop() & mouseY <= getBottom()) {
377 synchronized (rows) {
378 for (int rowIndex = 0; rowIndex < heightMap.size(); ++rowIndex) {
379 int newY = (int) (getTop() + heightMap.get(rowIndex) + getHeaderPadding() - getCurrentScroll());
380 int slotHeight = rows.get(rowIndex).getLineHeight() - 4;
381 if ((newY <= getBottom()) && (newY + slotHeight >= getTop())) {
382 Row row = rows.get(rowIndex);
383 if (row instanceof RowExtended) {
384 IButton pressed = ((RowExtended) row).mousePressed(mouseX, mouseY);
385 if (pressed != null) {
386 if (selectedButton != null && pressed != selectedButton)
387 selectedButton.mouseClicked(mouseX, mouseY);
388 selectedButton = pressed;
389 return;
390 }
391 }
392 }
393 }
394 }
395 }
396 }
397
398 /**
399 * @return x-coordinate of the scroll bar

Callers

nothing calls this directly

Calls 11

getLeftMethod · 0.95
getRightMethod · 0.95
getTopMethod · 0.95
getBottomMethod · 0.95
getHeaderPaddingMethod · 0.95
getCurrentScrollMethod · 0.95
sizeMethod · 0.80
getMethod · 0.65
getLineHeightMethod · 0.65
mousePressedMethod · 0.65
mouseClickedMethod · 0.65

Tested by

no test coverage detected