click issue fix, not all mods rendering now
This commit is contained in:
@@ -49,7 +49,7 @@ public class ModManager {
|
||||
new ArmorDisplay(),
|
||||
new ArmorDisplay(),
|
||||
new ArmorDisplay(),
|
||||
new ArmorDisplay(),
|
||||
new Coordinates(),
|
||||
};
|
||||
|
||||
public static void init() {
|
||||
|
||||
@@ -69,13 +69,6 @@ public class SaturnUi extends Screen {
|
||||
widget.y < mouseY &&
|
||||
widget.y + widget.height > mouseY;
|
||||
|
||||
SaturnClient.LOGGER.info(
|
||||
"Render mouse X: " +
|
||||
(mouseX - widget.x) +
|
||||
", mouse Y: " +
|
||||
(mouseY - widget.y)
|
||||
);
|
||||
|
||||
MatrixStack matrices = context.getMatrices();
|
||||
matrices.push();
|
||||
matrices.translate(widget.x, widget.y, 0);
|
||||
|
||||
@@ -122,23 +122,27 @@ public class SaturnScroll extends SaturnWidget {
|
||||
"[SaturnScroll] Click at: x=" + mouseX + ", y=" + mouseY
|
||||
);
|
||||
|
||||
mouseX -= x;
|
||||
mouseY -= (y - scroll);
|
||||
|
||||
for (SaturnWidget widget : children) {
|
||||
widget.focused = false;
|
||||
if (!widget.visible) {
|
||||
continue;
|
||||
}
|
||||
|
||||
double adjustedMouseX = (mouseX - widget.x) / widget.scale;
|
||||
double adjustedMouseY = (mouseY - widget.y) / widget.scale;
|
||||
double adjustedMouseX = (mouseX - widget.x);
|
||||
double adjustedMouseY = (mouseY - widget.y);
|
||||
boolean isMouseInside =
|
||||
adjustedMouseX >= 0 &&
|
||||
adjustedMouseX <= widget.width &&
|
||||
adjustedMouseY >= 0 &&
|
||||
adjustedMouseY <= widget.height;
|
||||
|
||||
System.out.println(
|
||||
widget.getClass().getName() +
|
||||
" Adjusted at: x=" +
|
||||
adjustedMouseX +
|
||||
", y=" +
|
||||
adjustedMouseY
|
||||
);
|
||||
if (isMouseInside) {
|
||||
widget.focused = true;
|
||||
widget.click((int) adjustedMouseX, (int) adjustedMouseY);
|
||||
|
||||
Reference in New Issue
Block a user