aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuuxel <6596629+Juuxel@users.noreply.github.com>2020-12-21 20:59:28 +0200
committerJuuxel <6596629+Juuxel@users.noreply.github.com>2020-12-21 20:59:28 +0200
commit47b811748a6cb1253c34f0b29bb1eb30ae523273 (patch)
treed51c507a63239df442e68456006457313c687f0e
parent866c869187dbd7759637f8009686d560032a54b6 (diff)
parent110a4db9f8c0530b8778e7290962b453e03b0bc1 (diff)
downloadLibGui-47b811748a6cb1253c34f0b29bb1eb30ae523273.tar.gz
LibGui-47b811748a6cb1253c34f0b29bb1eb30ae523273.tar.bz2
LibGui-47b811748a6cb1253c34f0b29bb1eb30ae523273.zip
Merge branch 'master' into unstable/4.0
# Conflicts: # gradle.properties # src/main/java/io/github/cottonmc/cotton/gui/client/BackgroundPainter.java
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/client/BackgroundPainter.java4
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java12
2 files changed, 10 insertions, 6 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/client/BackgroundPainter.java b/src/main/java/io/github/cottonmc/cotton/gui/client/BackgroundPainter.java
index 3d84e7c..13ca534 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/client/BackgroundPainter.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/client/BackgroundPainter.java
@@ -58,8 +58,8 @@ public interface BackgroundPainter {
ScreenDrawing.drawBeveledPanel(matrices, (x * 18) + left - 4, (y * 18) + top - 4, 26, 26,
lo, bg, hi);
if (slot.getFocusedSlot() == index) {
- int sx = (x * 18) + left - 3;
- int sy = (y * 18) + top - 3;
+ int sx = (x * 18) + left - 4;
+ int sy = (y * 18) + top - 4;
ScreenDrawing.coloredRect(matrices, sx, sy, 26, 1, 0xFF_FFFFA0);
ScreenDrawing.coloredRect(matrices, sx, sy + 1, 1, 26 - 1, 0xFF_FFFFA0);
ScreenDrawing.coloredRect(matrices, sx + 26 - 1, sy + 1, 1, 26 - 1, 0xFF_FFFFA0);
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java
index c9ff831..0f7920b 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java
@@ -111,8 +111,12 @@ public class CottonInventoryScreen<T extends SyncedGuiDescription> extends Handl
clearPeers();
basePanel.validate(description);
- backgroundWidth = basePanel.getWidth();
- backgroundHeight = basePanel.getHeight();
+ // This is needed for REI; otherwise it'll overlap.
+ // 8 = the padding of BackgroundPainter.VANILLA
+ int padding = 2 * 8; // TODO: This is awful and bad and should be removed ASAP
+
+ backgroundWidth = basePanel.getWidth() + padding;
+ backgroundHeight = basePanel.getHeight() + padding;
//DEBUG
if (backgroundWidth<16) backgroundWidth=300;
@@ -120,8 +124,8 @@ public class CottonInventoryScreen<T extends SyncedGuiDescription> extends Handl
}
if (!description.isFullscreen()) {
- x = (width / 2) - (backgroundWidth / 2);
- y = (height / 2) - (backgroundHeight / 2);
+ x = (screenWidth / 2) - (backgroundWidth / 2);
+ y = (screenHeight / 2) - (backgroundHeight / 2);
titleX = 0;
titleY = 0;
} else {