diff options
| author | Roman / Nea <roman.graef@gmail.com> | 2022-05-31 20:53:26 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-31 20:53:26 +0200 |
| commit | dfdc2d9519556dfec528ab9d1732cdf32aab0639 (patch) | |
| tree | 6f046db7b581f40b2deedd202ceaf98ba9ec2567 /src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java | |
| parent | a6546a1abe954b394c40be58d73d6fb03d93709e (diff) | |
| download | notenoughupdates-dfdc2d9519556dfec528ab9d1732cdf32aab0639.tar.gz notenoughupdates-dfdc2d9519556dfec528ab9d1732cdf32aab0639.tar.bz2 notenoughupdates-dfdc2d9519556dfec528ab9d1732cdf32aab0639.zip | |
Move repository related configuration to GUI. (#151)
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java | 49 |
1 files changed, 37 insertions, 12 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java index 5ed990a4..d9cc77e3 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java @@ -17,7 +17,7 @@ import io.github.moulberry.notenoughupdates.options.customtypes.NEUDebugFlag; import io.github.moulberry.notenoughupdates.options.seperateSections.AHGraph; import io.github.moulberry.notenoughupdates.options.seperateSections.AHTweaks; import io.github.moulberry.notenoughupdates.options.seperateSections.AccessoryBag; -import io.github.moulberry.notenoughupdates.options.seperateSections.ApiKey; +import io.github.moulberry.notenoughupdates.options.seperateSections.ApiData; import io.github.moulberry.notenoughupdates.options.seperateSections.Calendar; import io.github.moulberry.notenoughupdates.options.seperateSections.CustomArmour; import io.github.moulberry.notenoughupdates.options.seperateSections.DungeonMapConfig; @@ -46,6 +46,7 @@ import io.github.moulberry.notenoughupdates.options.seperateSections.TradeMenu; import io.github.moulberry.notenoughupdates.overlays.MiningOverlay; import io.github.moulberry.notenoughupdates.overlays.OverlayManager; import io.github.moulberry.notenoughupdates.overlays.TextOverlay; +import io.github.moulberry.notenoughupdates.util.NotificationHandler; import io.github.moulberry.notenoughupdates.util.SBInfo; import net.minecraft.client.Minecraft; import net.minecraftforge.client.ClientCommandHandler; @@ -155,6 +156,29 @@ public class NEUConfig extends Config { case 21: NotEnoughUpdates.INSTANCE.overlay.updateSearch(); return; + case 22: + NotEnoughUpdates.INSTANCE.manager + .userFacingRepositoryReload() + .thenAccept(strings -> + NotificationHandler.displayNotification(strings, true, true)); + Minecraft.getMinecraft().displayGuiScreen(null); + return; + case 23: + NotEnoughUpdates.INSTANCE.config.apiData.repoUser = "NotEnoughUpdates"; + NotEnoughUpdates.INSTANCE.config.apiData.repoName = "NotEnoughUpdates-REPO"; + NotEnoughUpdates.INSTANCE.config.apiData.repoBranch = "master"; + NotEnoughUpdates.INSTANCE.openGui = + new GuiScreenElementWrapper(new NEUConfigEditor(NotEnoughUpdates.INSTANCE.config, "apis")); + return; + case 24: + NotEnoughUpdates.INSTANCE.config.apiData.repoUser = "NotEnoughUpdates"; + NotEnoughUpdates.INSTANCE.config.apiData.repoName = "NotEnoughUpdates-REPO"; + NotEnoughUpdates.INSTANCE.config.apiData.repoBranch = "dangerous"; + NotEnoughUpdates.INSTANCE.openGui = + new GuiScreenElementWrapper(new NEUConfigEditor(NotEnoughUpdates.INSTANCE.config, "apis")); + return; + default: + System.err.printf("Unknown runnableId = %d in category %s%n", runnableId, activeConfigCategory); } } @@ -349,10 +373,19 @@ public class NEUConfig extends Config { @Expose @Category( - name = "Api Key", - desc = "Api Key" + name = "Apis", + desc = "Api Data" ) - public ApiKey apiKey = new ApiKey(); + public ApiData apiData = new ApiData(); + + @Expose + public LegacyApiKey apiKey = null; + + public static class LegacyApiKey { + // Blame Ironmoon for this (still better than my idea tho) + @Expose + public String apiKey = null; + } @Expose public Hidden hidden = new Hidden(); @@ -371,12 +404,8 @@ public class NEUConfig extends Config { @Expose public EnumSet<NEUDebugFlag> debugFlags = EnumSet.noneOf(NEUDebugFlag.class); @Expose - public boolean enableItemEditing = false; - @Expose public boolean cacheRenderedItempane = true; @Expose - public boolean autoupdate = true; - @Expose public String overlaySearchBar = ""; @Expose public String overlayQuickCommand = ""; @@ -402,10 +431,6 @@ public class NEUConfig extends Config { public ArrayList<String> quickCommands = createDefaultQuickCommands(); @Expose public ArrayList<String> enchantColours = createDefaultEnchantColours(); - @Expose - public String repoURL = "https://github.com/Moulberry/NotEnoughUpdates-REPO/archive/master.zip"; - @Expose - public String repoCommitsURL = "https://api.github.com/repos/Moulberry/NotEnoughUpdates-REPO/commits/master"; @Expose public boolean firstTimeSearchFocus = true; |
