aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/config/features
diff options
context:
space:
mode:
authorCalMWolfs <94038482+CalMWolfs@users.noreply.github.com>2024-05-24 17:37:44 +1000
committerGitHub <noreply@github.com>2024-05-24 09:37:44 +0200
commit17ac70d7cd8416324acfffcde656930b4e9ae612 (patch)
tree97774ea6f112879386bf69df4830a4091f3cd13b /src/main/java/at/hannibal2/skyhanni/config/features
parent2a036647d4a06d8d1c5bcbfe9437c4def1aa7eee (diff)
downloadskyhanni-17ac70d7cd8416324acfffcde656930b4e9ae612.tar.gz
skyhanni-17ac70d7cd8416324acfffcde656930b4e9ae612.tar.bz2
skyhanni-17ac70d7cd8416324acfffcde656930b4e9ae612.zip
Add: Ability to switch repo branch (#1835)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/config/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/dev/DevConfig.java17
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/dev/RepositoryConfig.java50
2 files changed, 58 insertions, 9 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/dev/DevConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/dev/DevConfig.java
index 950aa2169..a53cc4e72 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/dev/DevConfig.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/dev/DevConfig.java
@@ -14,15 +14,9 @@ import org.lwjgl.input.Keyboard;
public class DevConfig {
@Expose
- @ConfigOption(name = "Repo Auto Update", desc = "Update the repository on every startup.\n" +
- "§cOnly disable this if you know what you are doing!")
- @ConfigEditorBoolean
- public boolean repoAutoUpdate = true;
-
- @Expose
- @ConfigOption(name = "Log Expiry Time", desc = "Deletes your SkyHanni logs after this time period in days.")
- @ConfigEditorSlider(minValue = 1, maxValue = 30, minStep = 1)
- public int logExpiryTime = 14;
+ @ConfigOption(name = "Repository", desc = "")
+ @Accordion
+ public RepositoryConfig repo = new RepositoryConfig();
@Expose
@ConfigOption(name = "Debug", desc = "")
@@ -35,6 +29,11 @@ public class DevConfig {
public RepoPatternConfig repoPattern = new RepoPatternConfig();
@Expose
+ @ConfigOption(name = "Log Expiry Time", desc = "Deletes your SkyHanni logs after this time period in days.")
+ @ConfigEditorSlider(minValue = 1, maxValue = 30, minStep = 1)
+ public int logExpiryTime = 14;
+
+ @Expose
@ConfigOption(name = "Slot Number", desc = "Show slot number in inventory while pressing this key.")
@ConfigEditorKeybind(defaultKey = Keyboard.KEY_NONE)
public int showSlotNumberKey = Keyboard.KEY_NONE;
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/dev/RepositoryConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/dev/RepositoryConfig.java
new file mode 100644
index 000000000..697cb3c91
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/dev/RepositoryConfig.java
@@ -0,0 +1,50 @@
+package at.hannibal2.skyhanni.config.features.dev;
+
+import at.hannibal2.skyhanni.data.repo.RepoUtils;
+import com.google.gson.annotations.Expose;
+import io.github.notenoughupdates.moulconfig.annotations.Accordion;
+import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean;
+import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorButton;
+import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorText;
+import io.github.notenoughupdates.moulconfig.annotations.ConfigOption;
+
+public class RepositoryConfig {
+
+ @Expose
+ @ConfigOption(name = "Repo Auto Update", desc = "Update the repository on every startup.\n" +
+ "§cOnly disable this if you know what you are doing!")
+ @ConfigEditorBoolean
+ public boolean repoAutoUpdate = true;
+
+ @ConfigOption(name = "Update Repo Now", desc = "Update your repository to the latest version")
+ @ConfigEditorButton(buttonText = "Update")
+ public Runnable updateRepo = RepoUtils::updateRepo;
+
+ @Expose
+ @ConfigOption(name = "Repository Location", desc = "")
+ @Accordion
+ public RepositoryLocation location = new RepositoryLocation();
+
+ public static class RepositoryLocation {
+
+ @ConfigOption(name = "Reset Repository Location", desc = "Reset your repository location to the default.")
+ @ConfigEditorButton(buttonText = "Reset")
+ public Runnable resetRepoLocation = RepoUtils::resetRepoLocation;
+
+ @Expose
+ @ConfigOption(name = "Repository User", desc = "The Repository Branch, default: hannibal002")
+ @ConfigEditorText
+ public String user = "hannibal002";
+
+ @Expose
+ @ConfigOption(name = "Repository Name", desc = "The Repository Name, default: SkyHanni-Repo")
+ @ConfigEditorText
+ public String name = "SkyHanni-REPO";
+
+ @Expose
+ @ConfigOption(name = "Repository Branch", desc = "The Repository Branch, default: main")
+ @ConfigEditorText
+ public String branch = "main";
+ }
+
+}