diff options
author | Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com> | 2024-05-03 12:15:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-03 12:15:45 +0200 |
commit | 4a2ac4ca162d846dcc9a2a3227f963321fa4e22a (patch) | |
tree | 3bd7a448f61e58e02f1e81778a40aa3b964fd8b7 /src/main/java/at/hannibal2/skyhanni/events | |
parent | 8d338540f3293b03acdd74f40a6c84a3cbedbded (diff) | |
download | skyhanni-4a2ac4ca162d846dcc9a2a3227f963321fa4e22a.tar.gz skyhanni-4a2ac4ca162d846dcc9a2a3227f963321fa4e22a.tar.bz2 skyhanni-4a2ac4ca162d846dcc9a2a3227f963321fa4e22a.zip |
Backend: GuiContainerEvent.BeforeDraw (#1510)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/events')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/events/GuiContainerEvent.kt | 13 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/events/NEURenderEvent.kt | 6 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/events/GuiContainerEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/GuiContainerEvent.kt index 9b4d534fc..9837e1529 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/GuiContainerEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/GuiContainerEvent.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.utils.GuiRenderUtils import net.minecraft.client.Minecraft import net.minecraft.client.gui.inventory.GuiContainer import net.minecraft.inventory.Container @@ -18,6 +19,18 @@ abstract class GuiContainerEvent(open val gui: GuiContainer, open val container: ) : GuiContainerEvent(gui, container) @Cancelable + data class BeforeDraw( + override val gui: GuiContainer, + override val container: Container, + val mouseX: Int, + val mouseY: Int, + val partialTicks: Float, + ) : GuiContainerEvent(gui, container) { + fun drawDefaultBackground() = + GuiRenderUtils.drawGradientRect(0, 0, gui.width, gui.height, -1072689136, -804253680, 0.0) + } + + @Cancelable data class CloseWindowEvent(override val gui: GuiContainer, override val container: Container) : GuiContainerEvent(gui, container) diff --git a/src/main/java/at/hannibal2/skyhanni/events/NEURenderEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/NEURenderEvent.kt new file mode 100644 index 000000000..c2bcc9b49 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/events/NEURenderEvent.kt @@ -0,0 +1,6 @@ +package at.hannibal2.skyhanni.events + +import net.minecraftforge.fml.common.eventhandler.Cancelable + +@Cancelable +class NEURenderEvent : LorenzEvent() |