diff options
Diffstat (limited to 'src')
3 files changed, 24 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiPositionEditor.kt b/src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiPositionEditor.kt index 4c1ca6ca1..4378fe36e 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiPositionEditor.kt +++ b/src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiPositionEditor.kt @@ -24,18 +24,24 @@ import at.hannibal2.skyhanni.data.GuiEditManager.Companion.getAbsX import at.hannibal2.skyhanni.data.GuiEditManager.Companion.getAbsY import at.hannibal2.skyhanni.data.GuiEditManager.Companion.getDummySize import at.hannibal2.skyhanni.data.OtherInventoryData +import at.hannibal2.skyhanni.mixins.transformers.gui.AccessorGuiContainer import at.hannibal2.skyhanni.utils.GuiRenderUtils import at.hannibal2.skyhanni.utils.KeyboardManager import at.hannibal2.skyhanni.utils.LorenzUtils.round import net.minecraft.client.Minecraft import net.minecraft.client.gui.GuiScreen import net.minecraft.client.gui.ScaledResolution +import net.minecraft.client.gui.inventory.GuiContainer import net.minecraft.client.renderer.GlStateManager import org.lwjgl.input.Keyboard import org.lwjgl.input.Mouse import java.io.IOException -class GuiPositionEditor(private val positions: List<Position>, private val border: Int) : GuiScreen() { +class GuiPositionEditor( + private val positions: List<Position>, + private val border: Int, + private val oldScreen: GuiContainer? = null +) : GuiScreen() { private var grabbedX = 0 private var grabbedY = 0 @@ -50,10 +56,17 @@ class GuiPositionEditor(private val positions: List<Position>, private val borde OtherInventoryData.close() } - override fun drawScreen(unusedX: Int, unusedY: Int, partialTicks: Float) { - super.drawScreen(unusedX, unusedY, partialTicks) + override fun drawScreen(mouseX: Int, mouseY: Int, partialTicks: Float) { + //Items aren't drawn due to a bug in neu rendering drawDefaultBackground() + if (oldScreen != null) { + val accessor = oldScreen as AccessorGuiContainer + accessor.invokeDrawGuiContainerBackgroundLayer_skyhanni(partialTicks, -1, -1) + } + + super.drawScreen(mouseX, mouseY, partialTicks) + GlStateManager.disableLighting() val hoveredPos = renderRectangles() renderLabels(hoveredPos) diff --git a/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt b/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt index 967d27813..7519662a7 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt @@ -17,6 +17,7 @@ import io.github.moulberry.notenoughupdates.itemeditor.GuiElementTextField import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer import net.minecraft.client.Minecraft import net.minecraft.client.gui.inventory.GuiChest +import net.minecraft.client.gui.inventory.GuiContainer import net.minecraft.client.gui.inventory.GuiEditSign import net.minecraft.client.gui.inventory.GuiInventory import net.minecraft.client.renderer.GlStateManager @@ -88,7 +89,11 @@ class GuiEditManager { @JvmStatic fun openGuiPositionEditor(hotkeyReminder: Boolean) { - SkyHanniMod.screenToOpen = GuiPositionEditor(latestPositions.values.toList(), 2) + SkyHanniMod.screenToOpen = GuiPositionEditor( + latestPositions.values.toList(), + 2, + Minecraft.getMinecraft().currentScreen as? GuiContainer + ) if (hotkeyReminder && lastHotkeyReminded.passedSince() > 30.minutes) { lastHotkeyReminded = SimpleTimeMark.now() ChatUtils.chat( diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/gui/AccessorGuiContainer.java b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/gui/AccessorGuiContainer.java index 8ca114a1c..5d9d6146d 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/gui/AccessorGuiContainer.java +++ b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/gui/AccessorGuiContainer.java @@ -18,4 +18,6 @@ public interface AccessorGuiContainer { @Accessor("guiTop") int getGuiTop(); + @Invoker("drawGuiContainerBackgroundLayer") + void invokeDrawGuiContainerBackgroundLayer_skyhanni(float f, int i, int mouseY); } |