diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/gui/config/ManagedConfig.kt | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/gui/config/ManagedConfig.kt b/src/main/kotlin/moe/nea/firmament/gui/config/ManagedConfig.kt index 83d95ca..61d23c0 100644 --- a/src/main/kotlin/moe/nea/firmament/gui/config/ManagedConfig.kt +++ b/src/main/kotlin/moe/nea/firmament/gui/config/ManagedConfig.kt @@ -20,7 +20,12 @@ package moe.nea.firmament.gui.config import io.github.cottonmc.cotton.gui.client.CottonClientScreen import io.github.cottonmc.cotton.gui.client.LightweightGuiDescription +import io.github.cottonmc.cotton.gui.widget.WBox +import io.github.cottonmc.cotton.gui.widget.WButton +import io.github.cottonmc.cotton.gui.widget.WLabel +import io.github.cottonmc.cotton.gui.widget.data.Axis import io.github.cottonmc.cotton.gui.widget.data.Insets +import io.github.cottonmc.cotton.gui.widget.data.VerticalAlignment import moe.nea.jarvis.api.Point import kotlinx.serialization.decodeFromString import kotlinx.serialization.encodeToString @@ -193,6 +198,16 @@ abstract class ManagedConfig(val name: String) { val guiapp = GuiAppender(20, { requireNotNull(screen) { "Screen Accessor called too early" } }) latestGuiAppender = guiapp guiapp.panel.insets = Insets.ROOT_PANEL + guiapp.appendFullRow(WBox(Axis.HORIZONTAL).also { + it.add(WButton(Text.literal("←")).also { + it.setOnClick { + AllConfigsGui.showAllGuis() + } + }) + it.add(WLabel(Text.translatable("firmament.config.${name}")).also { + it.verticalAlignment = VerticalAlignment.CENTER + }) + }) sortedOptions.forEach { it.appendToGui(guiapp) } guiapp.reloadables.forEach { it() } lwgd.setRootPanel(guiapp.panel) |