From dc4755eb79ab78f87b0e1e4ad6dac81912af0ee0 Mon Sep 17 00:00:00 2001 From: nea Date: Sun, 7 Aug 2022 22:30:28 +0200 Subject: better screen building --- .../kotlin/moe/nea/notenoughupdates/gui/repogui.kt | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/main/kotlin/moe/nea/notenoughupdates/gui/repogui.kt (limited to 'src/main/kotlin/moe/nea/notenoughupdates/gui/repogui.kt') 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 { + return ConfigGui(RepoManager) { + title(Component.literal("NotEnoughUpdates Repo Settings")) + toggle(Component.literal("Auto Update"), RepoManager.Config::autoUpdate) + textfield( + Component.literal("Repo Username"), + Component.literal(""), + RepoManager.Config::user, + maxLength = 255 + ) + textfield( + Component.literal("Repo Name"), + Component.literal(""), + RepoManager.Config::repo + ) + textfield( + Component.literal("Repo Branch"), + Component.literal(""), + 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() + } + } +} -- cgit