diff options
author | Roman / Linnea Gräf <nea@nea.moe> | 2023-04-12 12:38:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-12 12:38:00 +0200 |
commit | e9a6b9f6de0fd8d6bc0d97b03d07d9a8c2757f95 (patch) | |
tree | f8a29569864aa798e85906fac1412f0583b684c6 /src/main/java/at/hannibal2/skyhanni/config/features | |
parent | 0e2276bad532ffe06e1364900e6456cd5b50214e (diff) | |
download | skyhanni-e9a6b9f6de0fd8d6bc0d97b03d07d9a8c2757f95.tar.gz skyhanni-e9a6b9f6de0fd8d6bc0d97b03d07d9a8c2757f95.tar.bz2 skyhanni-e9a6b9f6de0fd8d6bc0d97b03d07d9a8c2757f95.zip |
Add AutoUpdater and license info gui (#26)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/config/features')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/About.java | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/About.java b/src/main/java/at/hannibal2/skyhanni/config/features/About.java new file mode 100644 index 000000000..0bb71a7e1 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/config/features/About.java @@ -0,0 +1,77 @@ +package at.hannibal2.skyhanni.config.features; + +import at.hannibal2.skyhanni.features.misc.update.ConfigVersionDisplay; +import com.google.gson.annotations.Expose; +import io.github.moulberry.moulconfig.annotations.*; +import io.github.moulberry.moulconfig.observer.Property; +import io.github.moulberry.notenoughupdates.util.Utils; + +public class About { + + + @ConfigOption(name = "Current Version", desc = "This is the SkyHanni version you are running currently") + @ConfigVersionDisplay + public Void currentVersion = null; + + @ConfigOption(name = "Auto Updates", desc = "Automatically check for updates on each startup") + @Expose + @ConfigEditorBoolean + public boolean autoUpdates = true; + + @ConfigOption(name = "Update Stream", desc = "How frequently do you want updates for SkyHanni") + @Expose + @ConfigEditorDropdown + public Property<UpdateStream> updateStream = Property.of(UpdateStream.RELEASES); + + + @ConfigOption(name = "Used Software", desc = "Information about used software and licenses") + @Accordion + public Licenses licenses = new Licenses(); + + public enum UpdateStream { + NONE("None", "none"), + BETA("Beta", "pre"), + RELEASES("Full", "full"); + + private final String label; + private final String stream; + + UpdateStream(String label, String stream) { + this.label = label; + this.stream = stream; + } + + public String getStream() { + return stream; + } + + @Override + public String toString() { + return label; + } + } + + public static class Licenses { + + @ConfigOption(name = "MoulConfig", desc = "MoulConfig is available under the LGPL 3.0 License or later version") + @ConfigEditorButton(buttonText = "GitHub") + public Runnable moulConfig = () -> Utils.openUrl("https://github.com/NotEnoughUpdates/MoulConfig"); + + @ConfigOption(name = "NotEnoughUpdates", desc = "NotEnoughUpdates is available under the LGPL 3.0 License or later version") + @ConfigEditorButton(buttonText = "GitHub") + public Runnable notEnoughUpdates = () -> Utils.openUrl("https://github.com/NotEnoughUpdates/NotEnoughUpdates"); + + @ConfigOption(name = "Forge", desc = "Forge is available under the LGPL 3.0 license") + @ConfigEditorButton(buttonText = "GitHub") + public Runnable forge = () -> Utils.openUrl("https://github.com/MinecraftForge/MinecraftForge"); + + @ConfigOption(name = "LibAutoUpdate", desc = "LibAutoUpdate is available under the BSD 2 Clause License") + @ConfigEditorButton(buttonText = "Git") + public Runnable libAutoUpdate = () -> Utils.openUrl("https://git.nea.moe/nea/libautoupdate/"); + + @ConfigOption(name = "Mixin", desc = "LibAutoUpdate is available under the MIT License") + @ConfigEditorButton(buttonText = "GitHub") + public Runnable mixin = () -> Utils.openUrl("https://github.com/SpongePowered/Mixin/"); + + } +} |