aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/util/customgui/CustomGui.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/util/customgui/CustomGui.kt')
-rw-r--r--src/main/kotlin/util/customgui/CustomGui.kt31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/main/kotlin/util/customgui/CustomGui.kt b/src/main/kotlin/util/customgui/CustomGui.kt
index 35c60ac..f64bf4d 100644
--- a/src/main/kotlin/util/customgui/CustomGui.kt
+++ b/src/main/kotlin/util/customgui/CustomGui.kt
@@ -1,8 +1,11 @@
package moe.nea.firmament.util.customgui
import me.shedaniel.math.Rectangle
-import net.minecraft.client.gui.DrawContext
-import net.minecraft.screen.slot.Slot
+import net.minecraft.client.input.MouseButtonEvent
+import net.minecraft.client.gui.GuiGraphics
+import net.minecraft.client.input.CharacterEvent
+import net.minecraft.client.input.KeyEvent
+import net.minecraft.world.inventory.Slot
import moe.nea.firmament.annotations.Subscribe
import moe.nea.firmament.events.HandledScreenPushREIEvent
@@ -23,19 +26,19 @@ abstract class CustomGui {
}
open fun render(
- drawContext: DrawContext,
- delta: Float,
- mouseX: Int,
- mouseY: Int
+ drawContext: GuiGraphics,
+ delta: Float,
+ mouseX: Int,
+ mouseY: Int
) {
}
- open fun mouseClick(mouseX: Double, mouseY: Double, button: Int): Boolean {
+ open fun mouseClick(click: MouseButtonEvent, doubled: Boolean): Boolean {
return false
}
- open fun afterSlotRender(context: DrawContext, slot: Slot) {}
- open fun beforeSlotRender(context: DrawContext, slot: Slot) {}
+ open fun afterSlotRender(context: GuiGraphics, slot: Slot) {}
+ open fun beforeSlotRender(context: GuiGraphics, slot: Slot) {}
open fun mouseScrolled(mouseX: Double, mouseY: Double, horizontalAmount: Double, verticalAmount: Double): Boolean {
return false
}
@@ -69,23 +72,23 @@ abstract class CustomGui {
return true
}
- open fun mouseReleased(mouseX: Double, mouseY: Double, button: Int): Boolean {
+ open fun mouseReleased(click: MouseButtonEvent): Boolean {
return false
}
- open fun mouseDragged(mouseX: Double, mouseY: Double, button: Int, deltaX: Double, deltaY: Double): Boolean {
+ open fun mouseDragged(click: MouseButtonEvent, offsetX: Double, offsetY: Double): Boolean {
return false
}
- open fun keyPressed(keyCode: Int, scanCode: Int, modifiers: Int): Boolean {
+ open fun keyPressed(input: KeyEvent): Boolean {
return false
}
- open fun charTyped(chr: Char, modifiers: Int): Boolean {
+ open fun charTyped(input: CharacterEvent): Boolean {
return false
}
- open fun keyReleased(keyCode: Int, scanCode: Int, modifiers: Int): Boolean {
+ open fun keyReleased(input: KeyEvent): Boolean {
return false
}
}