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

Method mouseClicked

Minecraft-Utils/1.7.10/src/GuiList.java:429–451  ·  view source on GitHub ↗
(int mouseX, int mouseY)

Source from the content-addressed store, hash-verified

427 }
428
429 @Override
430 public void mouseClicked(int mouseX, int mouseY) {
431 if (mouseX >= getLeft() && mouseX <= getRight() && mouseY >= getTop() & mouseY <= getBottom()) {
432 synchronized (rows) {
433 for (int rowIndex = 0; rowIndex < heightMap.size(); ++rowIndex) {
434 int newY = (int) (getTop() + heightMap.get(rowIndex) + getHeaderPadding() - getCurrentScroll());
435 int slotHeight = rows.get(rowIndex).getLineHeight() - 4;
436 if ((newY <= getBottom()) && (newY + slotHeight >= getTop())) {
437 Row row = rows.get(rowIndex);
438 if (row instanceof RowExtended) {
439 IButton pressed = ((RowExtended) row).mousePressed(mouseX, mouseY);
440 if (pressed != null) {
441 if (selectedButton != null && pressed != selectedButton)
442 selectedButton.mouseClicked(mouseX, mouseY);
443 selectedButton = pressed;
444 return;
445 }
446 }
447 }
448 }
449 }
450 }
451 }
452
453 /**
454 * @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