diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/core/config/Position.java | 9 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/CustomWardrobe.kt | 6 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/core/config/Position.java b/src/main/java/at/hannibal2/skyhanni/config/core/config/Position.java index 16e134574..d0112766a 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/core/config/Position.java +++ b/src/main/java/at/hannibal2/skyhanni/config/core/config/Position.java @@ -48,6 +48,9 @@ public class Position { @Expose private boolean centerY; + @Expose + private boolean ignoreCustomScale = false; + public transient Field linkField; private boolean clicked = false; @@ -90,7 +93,13 @@ public class Position { this.center = other.isCenter(); } + public Position setIgnoreCustomScale(boolean ignoreCustomScale) { + this.ignoreCustomScale = ignoreCustomScale; + return this; + } + public float getEffectiveScale() { + if (ignoreCustomScale) return 1F; return Math.max(Math.min(getScale() * SkyHanniMod.feature.gui.globalScale, 10F), 0.1F); } diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/CustomWardrobe.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/CustomWardrobe.kt index d12e61d35..02494184d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/CustomWardrobe.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/CustomWardrobe.kt @@ -78,14 +78,14 @@ object CustomWardrobe { } val (width, height) = renderable.width to renderable.height - val pos = Position((gui.width - width) / 2, (gui.height - height) / 2) + val pos = Position((gui.width - width) / 2, (gui.height - height) / 2).setIgnoreCustomScale(true) if (waitingForInventoryUpdate && config.loadingText) { val loadingRenderable = Renderable.string( "§cLoading...", scale = activeScale / 100.0, ) val loadingPos = - Position(pos.rawX + (width - loadingRenderable.width) / 2, pos.rawY - loadingRenderable.height) + Position(pos.rawX + (width - loadingRenderable.width) / 2, pos.rawY - loadingRenderable.height).setIgnoreCustomScale(true) loadingPos.renderRenderable(loadingRenderable, posLabel = guiName, addToGuiManager = false) } @@ -112,7 +112,7 @@ object CustomWardrobe { val accessorGui = gui as AccessorGuiContainer val posX = accessorGui.guiLeft + (1.05 * accessorGui.width).toInt() val posY = accessorGui.guiTop + (accessorGui.height - renderable.height) / 2 - Position(posX, posY).renderRenderable(renderable, posLabel = guiName, addToGuiManager = false) + Position(posX, posY).setIgnoreCustomScale(true).renderRenderable(renderable, posLabel = guiName, addToGuiManager = false) } @SubscribeEvent |