diff options
author | Roman / Linnea Gräf <roman.graef@gmail.com> | 2023-06-08 09:34:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-08 17:34:43 +1000 |
commit | 374a1f1bb7b884622824d804592b83bb7d4094bc (patch) | |
tree | e89533cd11e3e11e419dfc0cb1081473c7f699d1 /src/main/java | |
parent | 5a422e5b879bf62b562bd811ebeba2877c005f78 (diff) | |
download | NotEnoughUpdates-374a1f1bb7b884622824d804592b83bb7d4094bc.tar.gz NotEnoughUpdates-374a1f1bb7b884622824d804592b83bb7d4094bc.tar.bz2 NotEnoughUpdates-374a1f1bb7b884622824d804592b83bb7d4094bc.zip |
NEUConfig: Add manadatory IQ test to api tab (#703)
Diffstat (limited to 'src/main/java')
3 files changed, 20 insertions, 3 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 2d66f595..7513a5b3 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java @@ -30,6 +30,7 @@ import io.github.moulberry.notenoughupdates.core.config.annotations.Category; import io.github.moulberry.notenoughupdates.core.config.gui.GuiPositionEditor; import io.github.moulberry.notenoughupdates.dungeons.GuiDungeonMapEditor; import io.github.moulberry.notenoughupdates.miscfeatures.FairySouls; +import io.github.moulberry.notenoughupdates.miscfeatures.IQTest; import io.github.moulberry.notenoughupdates.miscgui.GuiEnchantColour; import io.github.moulberry.notenoughupdates.miscgui.GuiInvButtonEditor; import io.github.moulberry.notenoughupdates.miscgui.NEUOverlayPlacements; @@ -168,6 +169,9 @@ public class NEUConfig extends Config { case 26: OverlayManager.powderGrindingOverlay.reset(); return; + case 27: + IQTest.testIQ(); + return; default: System.err.printf("Unknown runnableId = %d in category %s%n", runnableId, activeConfigCategory); } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfigEditor.java b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfigEditor.java index 2b12118c..62bb730b 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfigEditor.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfigEditor.java @@ -32,6 +32,7 @@ import io.github.moulberry.notenoughupdates.core.util.lerp.LerpUtils; import io.github.moulberry.notenoughupdates.core.util.lerp.LerpingInteger; import io.github.moulberry.notenoughupdates.core.util.render.RenderUtils; import io.github.moulberry.notenoughupdates.core.util.render.TextRenderUtils; +import io.github.moulberry.notenoughupdates.miscfeatures.IQTest; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; @@ -120,14 +121,14 @@ public class NEUConfigEditor extends GuiElement { if (categoryOpen != null) { for (Map.Entry<String, ConfigProcessor.ProcessedCategory> category : processedConfig.entrySet()) { if (category.getValue().name.equalsIgnoreCase(categoryOpen)) { - selectedCategory = category.getKey(); + setSelectedCategory(category.getKey()); break; } } if (selectedCategory == null) { for (Map.Entry<String, ConfigProcessor.ProcessedCategory> category : processedConfig.entrySet()) { if (category.getValue().name.toLowerCase().startsWith(categoryOpen.toLowerCase())) { - selectedCategory = category.getKey(); + setSelectedCategory(category.getKey()); break; } } @@ -135,7 +136,7 @@ public class NEUConfigEditor extends GuiElement { if (selectedCategory == null) { for (Map.Entry<String, ConfigProcessor.ProcessedCategory> category : processedConfig.entrySet()) { if (category.getValue().name.toLowerCase().contains(categoryOpen.toLowerCase())) { - selectedCategory = category.getKey(); + setSelectedCategory(category.getKey()); break; } } @@ -152,6 +153,9 @@ public class NEUConfigEditor extends GuiElement { } private LinkedHashMap<String, ConfigProcessor.ProcessedOption> getOptionsInCategory(ConfigProcessor.ProcessedCategory cat) { + if (cat.options.containsKey("apiDataUnlocked") && !NotEnoughUpdates.INSTANCE.config.apiData.apiDataUnlocked) { + return IQTest.getOptions(); + } LinkedHashMap<String, ConfigProcessor.ProcessedOption> newMap = new LinkedHashMap<>(cat.options); if (searchedOptions != null) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ApiData.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ApiData.java index 63faf940..3267e661 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ApiData.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ApiData.java @@ -28,6 +28,15 @@ import io.github.moulberry.notenoughupdates.core.config.annotations.ConfigEditor import io.github.moulberry.notenoughupdates.core.config.annotations.ConfigOption; public class ApiData { + + @Expose + @ConfigOption( + name = "Unlock the API data tab", + desc = "If you turn this off, you will need to re-do the IQ test" + ) + @ConfigEditorBoolean + public boolean apiDataUnlocked = false; + @Expose @ConfigOption( name = "Api Key", |