aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/com/dulkirfabric/config/DulkirConfig.kt
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-07-31 23:07:36 +0200
committernea <nea@nea.moe>2023-07-31 23:12:15 +0200
commit0aceb412e0eec21379805286afb59788530f4fb6 (patch)
treee14da1c0b06c7411804dd406ed41b9db6413b0b9 /src/main/kotlin/com/dulkirfabric/config/DulkirConfig.kt
parentead0b68578d40562728aec8c725fe35cf6724d73 (diff)
downloadDulkirMod-Fabric-0aceb412e0eec21379805286afb59788530f4fb6.tar.gz
DulkirMod-Fabric-0aceb412e0eec21379805286afb59788530f4fb6.tar.bz2
DulkirMod-Fabric-0aceb412e0eec21379805286afb59788530f4fb6.zip
Add modmenu supportfeat/modmenu
Diffstat (limited to 'src/main/kotlin/com/dulkirfabric/config/DulkirConfig.kt')
-rw-r--r--src/main/kotlin/com/dulkirfabric/config/DulkirConfig.kt8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/kotlin/com/dulkirfabric/config/DulkirConfig.kt b/src/main/kotlin/com/dulkirfabric/config/DulkirConfig.kt
index 5e2eb5d..93db1a0 100644
--- a/src/main/kotlin/com/dulkirfabric/config/DulkirConfig.kt
+++ b/src/main/kotlin/com/dulkirfabric/config/DulkirConfig.kt
@@ -38,9 +38,9 @@ class DulkirConfig {
private val buttonText: Text =
MutableText.of(LiteralTextContent("Dulkir")).formatted(Formatting.BOLD, Formatting.YELLOW)
- var screen: Screen
+ var screen: Screen = buildScreen(null)
- init {
+ fun buildScreen(parentScreen: Screen? = null): Screen {
val builder = ConfigBuilder.create().setTitle(buttonText)
builder.setDefaultBackgroundTexture(Identifier("minecraft:textures/block/oak_planks.png"))
builder.setGlobalized(true)
@@ -408,7 +408,9 @@ class DulkirConfig {
// .build()
// )
builder.transparentBackground()
- screen = builder.build()
+ if (parentScreen != null)
+ builder.setParentScreen(parentScreen)
+ return builder.build()
}
@Serializable