Fix: enable resize scaling on InventoryButtonEditor
This commit is contained in:
@@ -6,6 +6,7 @@ import io.github.notenoughupdates.moulconfig.xml.Bind
|
|||||||
import me.shedaniel.math.Point
|
import me.shedaniel.math.Point
|
||||||
import me.shedaniel.math.Rectangle
|
import me.shedaniel.math.Rectangle
|
||||||
import org.lwjgl.glfw.GLFW
|
import org.lwjgl.glfw.GLFW
|
||||||
|
import net.minecraft.client.MinecraftClient
|
||||||
import net.minecraft.client.gui.DrawContext
|
import net.minecraft.client.gui.DrawContext
|
||||||
import net.minecraft.client.gui.widget.ButtonWidget
|
import net.minecraft.client.gui.widget.ButtonWidget
|
||||||
import net.minecraft.client.util.InputUtil
|
import net.minecraft.client.util.InputUtil
|
||||||
@@ -55,6 +56,11 @@ class InventoryButtonEditor(
|
|||||||
super.close()
|
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() {
|
override fun init() {
|
||||||
super.init()
|
super.init()
|
||||||
addDrawableChild(
|
addDrawableChild(
|
||||||
|
|||||||
@@ -78,9 +78,9 @@ object InventoryButtons : FirmamentFeature {
|
|||||||
ScreenUtil.setScreenLater(
|
ScreenUtil.setScreenLater(
|
||||||
InventoryButtonEditor(
|
InventoryButtonEditor(
|
||||||
lastRectangle ?: Rectangle(
|
lastRectangle ?: Rectangle(
|
||||||
MC.window.scaledWidth / 2 - 100,
|
MC.window.scaledWidth / 2 - 88,
|
||||||
MC.window.scaledHeight / 2 - 100,
|
MC.window.scaledHeight / 2 - 83,
|
||||||
200, 200,
|
176, 166,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user