Skip to content

Commit 5f3de55

Browse files
committed
test: Add wide toggle for testing
1 parent 09c70bf commit 5f3de55

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

modern/templates/kotlin/test/FabricMain.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package io.github.notenoughupdates.moulconfig.test
22

33
import io.github.notenoughupdates.moulconfig.common.IItemStack
4+
import io.github.notenoughupdates.moulconfig.common.IMinecraft
45
import io.github.notenoughupdates.moulconfig.gui.CloseEventListener
56
import io.github.notenoughupdates.moulconfig.gui.GuiComponentWrapper
67
import io.github.notenoughupdates.moulconfig.gui.GuiContext
@@ -27,7 +28,9 @@ class FabricMain : ModInitializer {
2728
ClientCommandRegistrationCallback.EVENT.register { a, b ->
2829
a.register(literal("moulconfig").executes {
2930
MinecraftClient.getInstance().send {
30-
config.openConfigGui()
31+
val editor = config.getEditor()
32+
editor.setWide(config.instance.testCategoryA.isWide)
33+
IMinecraft.instance.openWrappedScreen(editor)
3134
}
3235
0
3336
})

modern/templates/kotlin/test/TestCategoryA.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ import org.lwjgl.glfw.GLFW
88
import java.util.Arrays
99

1010
class TestCategoryA {
11+
12+
@ConfigOption(name ="Open Wide", desc= "Use a wider config menu")
13+
@ConfigEditorBoolean
14+
var isWide: Boolean = false
1115
@ConfigOption(name = "Test Option", desc = "Test toggle")
1216
@ConfigEditorBoolean
1317
var shouldTestToggle: Boolean = false

0 commit comments

Comments
 (0)