aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/util/MoulConfigUtils.kt
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-11-18 20:53:20 +0100
committerLinnea Gräf <nea@nea.moe>2024-11-18 20:53:20 +0100
commit139fa705b36b845759cff9318191ff1cca526f2a (patch)
treea8e297627a078ac97abe03f0e56ea7e3744db042 /src/main/kotlin/util/MoulConfigUtils.kt
parentd37d13dacad45af717e1f97488e739ef617fd89d (diff)
downloadFirmament-139fa705b36b845759cff9318191ff1cca526f2a.tar.gz
Firmament-139fa705b36b845759cff9318191ff1cca526f2a.tar.bz2
Firmament-139fa705b36b845759cff9318191ff1cca526f2a.zip
feat: Add Storage overlay searchHEADmaster
Diffstat (limited to 'src/main/kotlin/util/MoulConfigUtils.kt')
-rw-r--r--src/main/kotlin/util/MoulConfigUtils.kt13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main/kotlin/util/MoulConfigUtils.kt b/src/main/kotlin/util/MoulConfigUtils.kt
index 2e52092..62bf3dd 100644
--- a/src/main/kotlin/util/MoulConfigUtils.kt
+++ b/src/main/kotlin/util/MoulConfigUtils.kt
@@ -7,6 +7,7 @@ import io.github.notenoughupdates.moulconfig.gui.GuiComponent
import io.github.notenoughupdates.moulconfig.gui.GuiComponentWrapper
import io.github.notenoughupdates.moulconfig.gui.GuiContext
import io.github.notenoughupdates.moulconfig.gui.GuiImmediateContext
+import io.github.notenoughupdates.moulconfig.gui.KeyboardEvent
import io.github.notenoughupdates.moulconfig.gui.MouseEvent
import io.github.notenoughupdates.moulconfig.observer.GetSetter
import io.github.notenoughupdates.moulconfig.platform.ModernRenderContext
@@ -247,6 +248,18 @@ object MoulConfigUtils {
}
}
+ fun typeMCComponentInPlace(
+ component: GuiComponent,
+ x: Int,
+ y: Int,
+ w: Int,
+ h: Int,
+ keyboardEvent: KeyboardEvent
+ ): Boolean {
+ val immContext = createInPlaceFullContext(null, IMinecraft.instance.mouseX, IMinecraft.instance.mouseY)
+ return component.keyboardEvent(keyboardEvent, immContext.translated(x, y, w, h))
+ }
+
fun clickMCComponentInPlace(
component: GuiComponent,
x: Int,