aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-07-31 02:12:04 +0200
committernea <nea@nea.moe>2023-07-31 02:12:04 +0200
commita5155e33f226fea9d1684db4b5831952c081dde2 (patch)
treec067dce781285ade8db22a516eb088f9dcf3ee63
parentf72db06a407999b4c5a2b794bb26f616f6a229f3 (diff)
downloadFirmament-a5155e33f226fea9d1684db4b5831952c081dde2.tar.gz
Firmament-a5155e33f226fea9d1684db4b5831952c081dde2.tar.bz2
Firmament-a5155e33f226fea9d1684db4b5831952c081dde2.zip
add back button
-rw-r--r--src/main/kotlin/moe/nea/firmament/gui/config/ManagedConfig.kt15
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)