Adjusted OverlayKeyPreset to fullscreen mode

This commit is contained in:
bigguy345 committed 2025-12-22 16:31:12 +02:00
1 parent 26ed55ceb5
commit 01e2c354d5
2 files changed
+9 -7

No files matched your search

@@ -134,7 +134,9 @@ public class GuiScriptTextArea extends GuiNpcTextField {
int xOffset = hasVerticalScrollbar() ? -8 : -2;
KEYS_OVERLAY.scale = 0.75f;
KEYS_OVERLAY.borderCol1 = KEYS_OVERLAY.borderCol2 = 0xFF3c3c3c;
KEYS_OVERLAY.initGui(x + (width / 4), y + 20, endX - (width / 4) + 5, endY - 28);
int overlayWidth = 160;
KEYS_OVERLAY.initGui(x + (width - overlayWidth) / 2 + 5, y + height / 10, overlayWidth,
height - height / 5 - 10);
KEYS_OVERLAY.viewButton.scale = 0.45f;
KEYS_OVERLAY.viewButton.initGui(endX + xOffset, endY - 26);
@@ -48,13 +48,13 @@ public class OverlayKeyPresetViewer {
});
}
public void initGui(int startX, int startY, int endX, int endY) {
public void initGui(int startX, int startY, int width, int height) {
this.startX = startX;
this.startY = startY;
this.endX = endX;
this.endY = endY;
this.width = endX - startX;
this.height = endY - startY;
this.width = width;
this.height = height;
this.endX = startX + width;
this.endY = startY + height;
scroll.init();
}
@@ -454,7 +454,7 @@ public class OverlayKeyPresetViewer {
}
public int getMaxStringWidth() {
return (int) (getWidth() * RELATIVE_MAX_DESC_WIDTH);
return (int) Math.max(getWidth() * RELATIVE_MAX_DESC_WIDTH, 0);
}
}