aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJ10a1n15 <45315647+j10a1n15@users.noreply.github.com>2024-08-31 20:45:52 +0200
committerGitHub <noreply@github.com>2024-08-31 20:45:52 +0200
commit33790178a21363c8efb07a068f9d2ad095d2f9ef (patch)
tree676685315ab7ee6f4b69a722949a34871864b9a7 /src
parenta953646ee7fa58e7535b75d2bd47697b87b2744b (diff)
downloadskyhanni-33790178a21363c8efb07a068f9d2ad095d2f9ef.tar.gz
skyhanni-33790178a21363c8efb07a068f9d2ad095d2f9ef.tar.bz2
skyhanni-33790178a21363c8efb07a068f9d2ad095d2f9ef.zip
Fix: Global Scale affecting Custom Wardrobe (#2420)
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/config/Position.java9
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/CustomWardrobe.kt6
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