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