aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/notenoughupdates/gui/repogui.kt
diff options
context:
space:
mode:
authornea <romangraef@gmail.com>2022-08-07 22:30:28 +0200
committernea <romangraef@gmail.com>2022-08-07 22:30:28 +0200
commitdc4755eb79ab78f87b0e1e4ad6dac81912af0ee0 (patch)
treee3819f403e63fd79af08cccbf0e6c0c581336497 /src/main/kotlin/moe/nea/notenoughupdates/gui/repogui.kt
parent05a4a5b3817ea3e70662d3834fd56a1b249fa70e (diff)
downloadfirmament-dc4755eb79ab78f87b0e1e4ad6dac81912af0ee0.tar.gz
firmament-dc4755eb79ab78f87b0e1e4ad6dac81912af0ee0.tar.bz2
firmament-dc4755eb79ab78f87b0e1e4ad6dac81912af0ee0.zip
better screen building
Diffstat (limited to 'src/main/kotlin/moe/nea/notenoughupdates/gui/repogui.kt')
-rw-r--r--src/main/kotlin/moe/nea/notenoughupdates/gui/repogui.kt36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/main/kotlin/moe/nea/notenoughupdates/gui/repogui.kt b/src/main/kotlin/moe/nea/notenoughupdates/gui/repogui.kt
new file mode 100644
index 0000000..40301fd
--- /dev/null
+++ b/src/main/kotlin/moe/nea/notenoughupdates/gui/repogui.kt
@@ -0,0 +1,36 @@
+package moe.nea.notenoughupdates.gui
+
+import moe.nea.notenoughupdates.repo.RepoManager
+import net.minecraft.network.chat.Component
+
+fun repoGui(): ConfigGui<RepoManager.Config> {
+ return ConfigGui(RepoManager) {
+ title(Component.literal("NotEnoughUpdates Repo Settings"))
+ toggle(Component.literal("Auto Update"), RepoManager.Config::autoUpdate)
+ textfield(
+ Component.literal("Repo Username"),
+ Component.literal("<github user>"),
+ RepoManager.Config::user,
+ maxLength = 255
+ )
+ textfield(
+ Component.literal("Repo Name"),
+ Component.literal("<repo name>"),
+ RepoManager.Config::repo
+ )
+ textfield(
+ Component.literal("Repo Branch"),
+ Component.literal("<repo branch>"),
+ RepoManager.Config::branch
+ )
+ button(
+ Component.literal("Reset to Defaults"),
+ Component.literal("Reset"),
+ ) {
+ RepoManager.config.user = "NotEnoughUpdates"
+ RepoManager.config.repo = "NotEnoughUpdates-REPO"
+ RepoManager.config.branch = "dangerous"
+ reload()
+ }
+ }
+}