aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/features
diff options
context:
space:
mode:
authorWapic <17051068+Wapic@users.noreply.github.com>2025-03-31 09:03:03 +0200
committerWapic <17051068+Wapic@users.noreply.github.com>2025-03-31 09:03:03 +0200
commit41e0cca3654c30da7c91c5cb2fb0c3f9d6f9e9c5 (patch)
tree3e200a49003a8aee09f2697b19d3c9aab564bb90 /src/main/kotlin/features
parent7c2d984d330e8a4988e6916394a3e97f2f2d2a5b (diff)
downloadFirmament-41e0cca3654c30da7c91c5cb2fb0c3f9d6f9e9c5.tar.gz
Firmament-41e0cca3654c30da7c91c5cb2fb0c3f9d6f9e9c5.tar.bz2
Firmament-41e0cca3654c30da7c91c5cb2fb0c3f9d6f9e9c5.zip
Fix: enable resize scaling on InventoryButtonEditor
Diffstat (limited to 'src/main/kotlin/features')
-rw-r--r--src/main/kotlin/features/inventory/buttons/InventoryButtonEditor.kt6
-rw-r--r--src/main/kotlin/features/inventory/buttons/InventoryButtons.kt6
2 files changed, 9 insertions, 3 deletions
diff --git a/src/main/kotlin/features/inventory/buttons/InventoryButtonEditor.kt b/src/main/kotlin/features/inventory/buttons/InventoryButtonEditor.kt
index ee3ae8b..a717fbe 100644
--- a/src/main/kotlin/features/inventory/buttons/InventoryButtonEditor.kt
+++ b/src/main/kotlin/features/inventory/buttons/InventoryButtonEditor.kt
@@ -6,6 +6,7 @@ import io.github.notenoughupdates.moulconfig.xml.Bind
import me.shedaniel.math.Point
import me.shedaniel.math.Rectangle
import org.lwjgl.glfw.GLFW
+import net.minecraft.client.MinecraftClient
import net.minecraft.client.gui.DrawContext
import net.minecraft.client.gui.widget.ButtonWidget
import net.minecraft.client.util.InputUtil
@@ -55,6 +56,11 @@ class InventoryButtonEditor(
super.close()
}
+ override fun resize(client: MinecraftClient, width: Int, height: Int) {
+ lastGuiRect.move(MC.window.scaledWidth / 2 - 88, MC.window.scaledHeight / 2 - 83)
+ super.resize(client, width, height)
+ }
+
override fun init() {
super.init()
addDrawableChild(
diff --git a/src/main/kotlin/features/inventory/buttons/InventoryButtons.kt b/src/main/kotlin/features/inventory/buttons/InventoryButtons.kt
index d5b5417..92640c8 100644
--- a/src/main/kotlin/features/inventory/buttons/InventoryButtons.kt
+++ b/src/main/kotlin/features/inventory/buttons/InventoryButtons.kt
@@ -78,9 +78,9 @@ object InventoryButtons : FirmamentFeature {
ScreenUtil.setScreenLater(
InventoryButtonEditor(
lastRectangle ?: Rectangle(
- MC.window.scaledWidth / 2 - 100,
- MC.window.scaledHeight / 2 - 100,
- 200, 200,
+ MC.window.scaledWidth / 2 - 88,
+ MC.window.scaledHeight / 2 - 83,
+ 176, 166,
)
)
)