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

Method mouseClicked

Minecraft-Utils/1.8/src/GuiList.java:389–411  ·  view source on GitHub ↗
(int mouseX, int mouseY)

Source from the content-addressed store, hash-verified

387 }
388
389 @Override
390 public void mouseClicked(int mouseX, int mouseY) {
391 if (mouseX >= getLeft() && mouseX <= getRight() && mouseY >= getTop() & mouseY <= getBottom()) {
392 synchronized (rows) {
393 for (int rowIndex = 0; rowIndex < heightMap.size(); ++rowIndex) {
394 int newY = (int) (getTop() + heightMap.get(rowIndex) + getHeaderPadding() - getCurrentScroll());
395 int slotHeight = rows.get(rowIndex).getLineHeight() - 4;
396 if ((newY <= getBottom()) && (newY + slotHeight >= getTop())) {
397 Row row = rows.get(rowIndex);
398 if (row instanceof RowExtended) {
399 IButton pressed = ((RowExtended) row).mousePressed(mouseX, mouseY);
400 if (pressed != null) {
401 if (selectedButton != null && pressed != selectedButton)
402 selectedButton.mouseClicked(mouseX, mouseY);
403 selectedButton = pressed;
404 return;
405 }
406 }
407 }
408 }
409 }
410 }
411 }
412
413 /**
414 * @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