From 982e460c861579f49959c08e25505a27e9c6b3f0 Mon Sep 17 00:00:00 2001 From: syeyoung Date: Tue, 3 Aug 2021 17:23:41 +0900 Subject: Too many changes to describe Config gui overhaul. v2 --- .../commands/CommandDungeonsGuide.java | 54 ++++- .../config/guiconfig/nyu/GuiConfigV2.java | 1 - .../config/guiconfig/nyu/MCategoryElement.java | 8 +- .../config/guiconfig/nyu/MFeature.java | 10 +- .../config/guiconfig/nyu/MFeatureEdit.java | 30 ++- .../config/guiconfig/nyu/MPanelCategory.java | 16 +- .../config/guiconfig/nyu/NestedCategory.java | 8 + .../config/guiconfig/nyu/RootConfigPanel.java | 79 +++++- .../dungeonsguide/features/AbstractFeature.java | 4 + .../dungeonsguide/features/FeatureParameter.java | 17 ++ .../dungeonsguide/features/FeatureRegistry.java | 44 ++-- .../features/impl/boss/FeatureAutoReparty.java | 2 +- .../features/impl/boss/FeatureBoxRealLivid.java | 2 +- .../features/impl/boss/FeatureHideAnimals.java | 2 +- .../features/impl/boss/FeatureTerracotaTimer.java | 2 +- .../impl/boss/FeatureThornBearPercentage.java | 2 +- .../impl/boss/FeatureThornSpiritBowTimer.java | 2 +- .../features/impl/boss/FeatureWarningOnPortal.java | 2 +- .../impl/boss/terminal/FeatureSimonSaysSolver.java | 2 +- .../impl/boss/terminal/FeatureTerminalSolvers.java | 2 +- .../features/impl/dungeon/FeatureBoxBats.java | 2 +- .../impl/dungeon/FeatureBoxSkelemaster.java | 2 +- .../features/impl/dungeon/FeatureBoxStarMobs.java | 2 +- .../dungeon/FeatureDungeonCurrentRoomSecrets.java | 2 +- .../impl/dungeon/FeatureDungeonDeaths.java | 2 +- .../impl/dungeon/FeatureDungeonMilestone.java | 2 +- .../impl/dungeon/FeatureDungeonRealTime.java | 2 +- .../impl/dungeon/FeatureDungeonRoomName.java | 2 +- .../impl/dungeon/FeatureDungeonSBTime.java | 2 +- .../features/impl/dungeon/FeatureDungeonScore.java | 2 +- .../impl/dungeon/FeatureDungeonSecrets.java | 2 +- .../features/impl/dungeon/FeatureDungeonTombs.java | 2 +- .../features/impl/dungeon/FeatureHideNameTags.java | 2 +- .../features/impl/dungeon/FeaturePlayerESP.java | 2 +- .../impl/dungeon/FeatureWarnLowHealth.java | 2 +- .../impl/dungeon/FeatureWatcherWarning.java | 2 +- .../impl/etc/FeatureAutoAcceptReparty.java | 2 +- .../features/impl/etc/FeatureCooldownCounter.java | 2 +- .../features/impl/etc/FeatureCopyMessages.java | 2 +- .../impl/etc/FeatureDecreaseExplosionSound.java | 2 +- .../features/impl/etc/FeatureDisableMessage.java | 2 +- .../features/impl/etc/FeaturePenguins.java | 2 +- .../features/impl/etc/FeatureRepartyCommand.java | 2 +- .../impl/etc/FeatureTooltipDungeonStat.java | 2 +- .../features/impl/etc/FeatureTooltipPrice.java | 2 +- .../features/impl/etc/FeatureUpdateAlarm.java | 2 +- .../impl/etc/ability/FeatureAbilityCooldown.java | 2 +- .../dungeonsguide/features/impl/party/APIKey.java | 2 +- .../party/customgui/FeatureCustomPartyFinder.java | 2 +- .../party/playerpreview/DataRendererEditor.java | 7 +- .../playerpreview/FeatureViewPlayerOnJoin.java | 2 +- .../impl/secret/FeatureMechanicBrowse.java | 2 +- .../impl/secret/FeatureSoulRoomWarning.java | 2 +- .../features/text/PanelTextParameterConfig.java | 270 ++++++++++++--------- .../features/text/TextHUDFeature.java | 7 + .../dungeonsguide/gui/elements/MButton.java | 8 +- .../dungeonsguide/gui/elements/MModal.java | 87 +++++++ .../gui/elements/MModalConfirmation.java | 88 +++++++ .../dungeonsguide/gui/elements/MRootPanel.java | 1 + .../dungeonsguide/gui/elements/MTextField.java | 2 +- .../dungeonsguide/gui/elements/MToggleButton.java | 5 +- .../syeyoung/dungeonsguide/utils/RenderUtils.java | 29 +++ 62 files changed, 648 insertions(+), 209 deletions(-) create mode 100644 src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MModal.java create mode 100644 src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MModalConfirmation.java (limited to 'src/main/java') diff --git a/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java b/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java index 437c1689..84c677ab 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java @@ -22,6 +22,7 @@ import com.google.gson.JsonObject; import kr.syeyoung.dungeonsguide.DungeonsGuide; import kr.syeyoung.dungeonsguide.SkyblockStatus; import kr.syeyoung.dungeonsguide.config.guiconfig.nyu.GuiConfigV2; +import kr.syeyoung.dungeonsguide.config.guiconfig.nyu.NestedCategory; import kr.syeyoung.dungeonsguide.cosmetics.CosmeticsManager; import kr.syeyoung.dungeonsguide.dungeon.DungeonContext; import kr.syeyoung.dungeonsguide.dungeon.MapProcessor; @@ -35,6 +36,7 @@ import kr.syeyoung.dungeonsguide.dungeon.mechanics.*; import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoomInfoRegistry; import kr.syeyoung.dungeonsguide.events.DungeonLeftEvent; +import kr.syeyoung.dungeonsguide.features.AbstractFeature; import kr.syeyoung.dungeonsguide.features.FeatureRegistry; import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.FeatureViewPlayerOnJoin; import kr.syeyoung.dungeonsguide.features.impl.party.api.ApiFetchur; @@ -61,6 +63,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; import net.minecraft.util.ChatStyle; +import net.minecraft.util.Tuple; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; import net.minecraftforge.common.MinecraftForge; @@ -78,10 +81,8 @@ import java.io.*; import java.security.*; import java.security.cert.CertificateException; import java.text.SimpleDateFormat; -import java.util.Arrays; -import java.util.Date; -import java.util.Map; -import java.util.UUID; +import java.util.*; +import java.util.List; import java.util.regex.Pattern; public class CommandDungeonsGuide extends CommandBase { @@ -489,6 +490,51 @@ public class CommandDungeonsGuide extends CommandBase { } else if (args[0].equals("CloseContext")) { DungeonsGuide.getDungeonsGuide().getSkyblockStatus().setForceIsOnDungeon(false); DungeonsGuide.getDungeonsGuide().getSkyblockStatus().setContext(null); + } else if (args[0].equals("dumpsettings")) { + NestedCategory root = new NestedCategory("ROOT"); + for (AbstractFeature abstractFeature : FeatureRegistry.getFeatureList()) { + String category = abstractFeature.getCategory(); + NestedCategory currentRoot = root; + for (String s : category.split("\\.")) { + NestedCategory finalCurrentRoot = currentRoot; + if (currentRoot.children().containsKey(s)) + currentRoot = currentRoot.children().get(s); + else { + currentRoot.child(currentRoot = new NestedCategory(finalCurrentRoot.categoryFull()+"."+s)); + } + } + } + + StringBuilder stringBuilder = new StringBuilder(); + StringBuilder stringBuilder2 = new StringBuilder(); + + Stack> stak = new Stack<>(); + stak.push(new Tuple<>(root, 0)); + Set discovered = new HashSet<>(); + while (!stak.isEmpty()) { + Tuple n = stak.pop(); + if (discovered.contains(n.getFirst())) continue; + discovered.add(n.getFirst()); + for (Map.Entry stringNestedCategoryEntry : n.getFirst().children().entrySet()) { + stak.push(new Tuple<>(stringNestedCategoryEntry.getValue(), n.getSecond() + 1)); + } + + if (n.getFirst().categoryFull().equals("ROOT")) continue; + + String prefix = ""; + for (int i = 0; i < n.getSecond()-1; i++) { + prefix += " "; + } + + List abstractFeatureList = FeatureRegistry.getFeaturesByCategory().getOrDefault(n.getFirst().categoryFull().substring(5), Collections.emptyList()); + stringBuilder.append(prefix).append("- C ").append(n.getFirst().categoryFull()).append("\n"); + stringBuilder2.append(n.getFirst().categoryFull()).append("\n"); + for (AbstractFeature abstractFeature : abstractFeatureList) { + stringBuilder.append(prefix).append(" - F ").append(abstractFeature.getName()).append(" / ").append(abstractFeature.getDescription().replace("\n", "$NEW_LINE$")).append("\n"); + } + } + System.out.println(stringBuilder.toString()); + System.out.println(stringBuilder2.toString()); } else { sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg §7-§fOpens configuration gui")); sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg gui §7-§fOpens configuration gui")); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/GuiConfigV2.java b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/GuiConfigV2.java index 267d9a5a..8b3e3eb4 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/GuiConfigV2.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/GuiConfigV2.java @@ -31,7 +31,6 @@ public class GuiConfigV2 extends MGui { public GuiConfigV2() { rootConfigPanel = new RootConfigPanel(this); - rootConfigPanel.setPageGenerator(ConfigPanelCreator.INSTANCE); getMainPanel().add(rootConfigPanel); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/MCategoryElement.java b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/MCategoryElement.java index 67087dd8..7df00626 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/MCategoryElement.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/MCategoryElement.java @@ -22,8 +22,10 @@ import kr.syeyoung.dungeonsguide.gui.MPanel; import kr.syeyoung.dungeonsguide.utils.RenderUtils; import kr.syeyoung.dungeonsguide.utils.cursor.EnumCursor; import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; import java.awt.*; @@ -48,7 +50,7 @@ public class MCategoryElement extends MPanel { if (rootConfigPanel.getCurrentPage().equals(category)) { clip(0,scissor.y, Minecraft.getMinecraft().displayWidth, scissor.height); Gui.drawRect(leftPad - offsetX, 0, getBounds().width, getBounds().height, RenderUtils.blendAlpha(0x141414, 0.13f)); - } else if (lastAbsClip.contains(absMousex, absMousey)) { + } else if (lastAbsClip.contains(absMousex, absMousey) && getTooltipsOpen() == 0) { clip(0,scissor.y, Minecraft.getMinecraft().displayWidth, scissor.height); Gui.drawRect(leftPad - offsetX, 0, getBounds().width, getBounds().height, RenderUtils.blendAlpha(0x141414, 0.09f)); } @@ -69,8 +71,10 @@ public class MCategoryElement extends MPanel { @Override public void mouseClicked(int absMouseX, int absMouseY, int relMouseX, int relMouseY, int mouseButton) { - if (!lastAbsClip.contains(absMouseX, absMouseY)) { return; } + if (!lastAbsClip.contains(absMouseX, absMouseY) || getTooltipsOpen() > 0) { return; } if (onClick != null) onClick.run(); + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0F)); + } @Override public void mouseMoved(int absMouseX, int absMouseY, int relMouseX0, int relMouseY0) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/MFeature.java b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/MFeature.java index 15b36216..7585d56c 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/MFeature.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/MFeature.java @@ -106,9 +106,15 @@ public class MFeature extends MPanel { @Override public void render(int absMousex, int absMousey, int relMousex0, int relMousey0, float partialTicks, Rectangle scissor) { - Gui.drawRect(0,0,getBounds().width, getBounds().height, RenderUtils.blendAlpha(0x141414, 0.12f)); + + int border = RenderUtils.blendAlpha(0x141414, 0.12f); + if (!panel.getSearchWord().isEmpty() && (feature.getName().contains(panel.getSearchWord()) || feature.getDescription().contains(panel.getSearchWord()))) { + border = 0xFF02EE67; + } + + Gui.drawRect(0,0,getBounds().width, getBounds().height,border); Gui.drawRect(1,18,getBounds().width -1, getBounds().height-1, RenderUtils.blendAlpha(0x141414, 0.15f)); - Gui.drawRect(0,17,getBounds().width, 18,RenderUtils.blendAlpha(0x141414, 0.12f)); + Gui.drawRect(1,1,getBounds().width-1, 18, RenderUtils.blendAlpha(0x141414, 0.12f)); FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/MFeatureEdit.java b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/MFeatureEdit.java index 3256c408..fbc1924f 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/MFeatureEdit.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/MFeatureEdit.java @@ -23,6 +23,8 @@ import kr.syeyoung.dungeonsguide.features.FeatureParameter; import kr.syeyoung.dungeonsguide.gui.MPanel; import kr.syeyoung.dungeonsguide.gui.elements.MButton; import kr.syeyoung.dungeonsguide.gui.elements.MList; +import kr.syeyoung.dungeonsguide.gui.elements.MModal; +import kr.syeyoung.dungeonsguide.gui.elements.MModalConfirmation; import java.awt.*; import java.util.HashMap; @@ -30,7 +32,7 @@ import java.util.Map; public class MFeatureEdit extends MPanel { private MList list; - private MButton goBack; + private MButton goBack, resetToDefault; private RootConfigPanel rootConfigPanel; private AbstractFeature abstractFeature; @@ -48,6 +50,30 @@ public class MFeatureEdit extends MPanel { goBack.setText("< Go Back"); goBack.setOnActionPerformed(rootConfigPanel::goBack); add(goBack); + resetToDefault = new MButton(); + resetToDefault.setText("Reset To Default"); + resetToDefault.setForeground(Color.red); + resetToDefault.setOnActionPerformed(() -> { + openResetConfirmation(); + }); + add(resetToDefault); + } + + public void openResetConfirmation() { + MModalConfirmation mModal = new MModalConfirmation("Are you sure?", + "Resetting to default will reset your configuration for the selected feature to default", + () -> { + for (FeatureParameter parameter : abstractFeature.getParameters()) { + parameter.setToDefault(); + } + abstractFeature.onParameterReset(); + rootConfigPanel.invalidatePage(abstractFeature.getEditRoute(rootConfigPanel)); + }, () -> {}); + mModal.setScale(getScale()); + mModal.getYes().setBorder(0xFFFF0000); + mModal.getYes().setText("Yes, Reset it"); + mModal.getNo().setText("Cancel"); + mModal.open(MFeatureEdit.this); } public void addParameterEdit(String name, MPanel paramEdit) { @@ -73,9 +99,11 @@ public class MFeatureEdit extends MPanel { public void setBounds(Rectangle bounds) { super.setBounds(bounds); goBack.setBounds(new Rectangle(5,5,75,15)); + resetToDefault.setBounds(new Rectangle(bounds.width - 105, 5, 100, 15)); list.setBounds(new Rectangle(5,25,bounds.width - 10, bounds.height - 10)); list.realignChildren(); + } @Override diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/MPanelCategory.java b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/MPanelCategory.java index 5df29c3b..c2033f7a 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/MPanelCategory.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/MPanelCategory.java @@ -45,13 +45,15 @@ public class MPanelCategory extends MPanel { for (NestedCategory value : nestedCategory.children().values()) { list.add(new MCategory(value, rootConfigPanel)); } - String actualCategory = nestedCategory.categoryFull().substring(5); - if (FeatureRegistry.getFeaturesByCategory().containsKey(actualCategory)) - for (AbstractFeature abstractFeature : FeatureRegistry.getFeaturesByCategory().get(actualCategory)) { - MFeature mFeature = new MFeature(abstractFeature, rootConfigPanel); - list.add(mFeature); - mFeature.setHover(new Color(94, 94, 94, 255)); - } + if (nestedCategory.parent() != null) { + String actualCategory = nestedCategory.categoryFull().substring(5); + if (FeatureRegistry.getFeaturesByCategory().containsKey(actualCategory)) + for (AbstractFeature abstractFeature : FeatureRegistry.getFeaturesByCategory().get(actualCategory)) { + MFeature mFeature = new MFeature(abstractFeature, rootConfigPanel); + list.add(mFeature); + mFeature.setHover(new Color(94, 94, 94, 255)); + } + } list.realignChildren(); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/NestedCategory.java b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/NestedCategory.java index ac3b8f49..25e262b3 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/NestedCategory.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/NestedCategory.java @@ -19,6 +19,8 @@ package kr.syeyoung.dungeonsguide.config.guiconfig.nyu; import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; import lombok.experimental.Accessors; import java.util.HashMap; @@ -26,9 +28,13 @@ import java.util.Map; @Data @Accessors(chain = true, fluent = true) +public class NestedCategory { private final String categoryFull; + @EqualsAndHashCode.Exclude private String categoryName; + @EqualsAndHashCode.Exclude + @ToString.Exclude private NestedCategory parent; public NestedCategory(String categoryFull) { @@ -36,6 +42,8 @@ class NestedCategory { this.categoryName = categoryFull.substring(categoryFull.lastIndexOf(".") + 1); } + @EqualsAndHashCode.Exclude + @ToString.Exclude private Map children = new HashMap<>(); public NestedCategory child(NestedCategory child) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/RootConfigPanel.java b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/RootConfigPanel.java index e2b97b7f..d43a45da 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/RootConfigPanel.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/RootConfigPanel.java @@ -32,9 +32,7 @@ import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; import java.awt.*; -import java.util.HashMap; -import java.util.Map; -import java.util.Stack; +import java.util.*; public class RootConfigPanel extends MPanelScaledGUI { private MScrollablePanel navigationScroll; @@ -47,7 +45,7 @@ public class RootConfigPanel extends MPanelScaledGUI { private final Map pages = new HashMap(); @Getter @Setter - private Function pageGenerator; + private Function pageGenerator = ConfigPanelCreator.INSTANCE; @Getter private String currentPage = ""; @@ -60,12 +58,34 @@ public class RootConfigPanel extends MPanelScaledGUI { private final Stack history = new Stack(); + public String getSearchWord() { + return search.getText().trim(); + } + public RootConfigPanel(GuiConfigV2 guiConfigV2) { this.gui = guiConfigV2; search = new MTextField() { @Override public void edit(String str) { + setupNavigation(); + + setCurrentPageAndPushHistory(""); + if (!categoryMap.containsKey(lastOpenCategory)) { + for (Map.Entry nestedCategoryMPanelEntry : categoryMap.entrySet()) { + if (nestedCategoryMPanelEntry.getValue() instanceof MCategoryElement) { + setCurrentPageAndPushHistory(nestedCategoryMPanelEntry.getKey().categoryFull()); + lastOpenCategory = nestedCategoryMPanelEntry.getKey(); + break; + } + } + } + for (Map.Entry nestedCategoryMPanelEntry : categoryMap.entrySet()) { + if (nestedCategoryMPanelEntry.getValue() instanceof MCollapsable) { + ((MCollapsable) nestedCategoryMPanelEntry.getValue()).setCollapsed(false); + } + } + rePlaceElements(); } }; search.setPlaceHolder("Search..."); @@ -95,18 +115,49 @@ public class RootConfigPanel extends MPanelScaledGUI { navigation.setDrawLine(false); + setCurrentPageAndPushHistory("ROOT"); rePlaceElements(); } + + private Map categoryMap = new HashMap<>(); + private NestedCategory lastOpenCategory; private void setupNavigation() { + categoryMap.clear(); + for (MPanel childComponent : navigation.getChildComponents()) { + navigation.remove(childComponent); + } NestedCategory root = new NestedCategory("ROOT"); + Set categoryAllowed = new HashSet<>(); + String search = this.search.getText().trim(); + for (AbstractFeature abstractFeature : FeatureRegistry.getFeatureList()) { + if (search.isEmpty()) { + categoryAllowed.add("ROOT."+abstractFeature.getCategory()); + } else if (abstractFeature.getName().contains(search)) { + categoryAllowed.add("ROOT."+abstractFeature.getCategory()); + } else if (abstractFeature.getDescription().contains(search)) { + categoryAllowed.add("ROOT."+abstractFeature.getCategory()); + } + } for (AbstractFeature abstractFeature : FeatureRegistry.getFeatureList()) { String category = abstractFeature.getCategory(); + boolean test =false; + for (String s : categoryAllowed) { + if (("ROOT."+category).startsWith(s)) { + test = true; + break; + } + } + if (!test) continue; NestedCategory currentRoot = root; for (String s : category.split("\\.")) { NestedCategory finalCurrentRoot = currentRoot; - currentRoot = currentRoot.children().computeIfAbsent(s, k -> new NestedCategory(finalCurrentRoot.categoryFull()+"."+k)); + if (currentRoot.children().containsKey(s)) + currentRoot = currentRoot.children().get(s); + else { + currentRoot.child(currentRoot = new NestedCategory(finalCurrentRoot.categoryFull()+"."+s)); + } } } @@ -114,6 +165,7 @@ public class RootConfigPanel extends MPanelScaledGUI { for (NestedCategory value : root.children().values()) { setupNavigationRecursive(value, navigation, 0, 17); } + ConfigPanelCreator.map.put("ROOT", () -> new MPanelCategory(root, this)); } private void setupNavigationRecursive(NestedCategory nestedCategory, MPanel parent, int depth, int offset) { ConfigPanelCreator.map.put(nestedCategory.categoryFull(), () -> new MPanelCategory(nestedCategory, this)); @@ -121,11 +173,14 @@ public class RootConfigPanel extends MPanelScaledGUI { if (nestedCategory.children().size() == 0) { MCategoryElement current = new MCategoryElement(nestedCategory.categoryFull(),() -> { setCurrentPageAndPushHistory(nestedCategory.categoryFull()); + lastOpenCategory = nestedCategory; }, 13 * depth + 17, offset, this); parent.add(current); + categoryMap.put(nestedCategory, current); } else { MCategoryElement current = new MCategoryElement(nestedCategory.categoryFull(),() -> { setCurrentPageAndPushHistory(nestedCategory.categoryFull()); + lastOpenCategory = nestedCategory; }, 3,offset, this); MCollapsable mCollapsable = new MCollapsable(current, this::rePlaceElements); mCollapsable.setLeftPad(offset-13); @@ -133,6 +188,7 @@ public class RootConfigPanel extends MPanelScaledGUI { mCollapsable.getLowerElements().setGap(0); mCollapsable.setLeftPadElements(0); parent.add(mCollapsable); + categoryMap.put(nestedCategory, mCollapsable); for (NestedCategory value : nestedCategory.children().values()) { setupNavigationRecursive(value, mCollapsable, depth+1, offset+13); @@ -144,6 +200,7 @@ public class RootConfigPanel extends MPanelScaledGUI { public void setCurrentPageAndPushHistory(String currentPage) { if (!this.currentPage.equals(currentPage)) history.push(this.currentPage); + lastOpenCategory = null; this.currentPage = currentPage; setupPage(); } @@ -164,6 +221,12 @@ public class RootConfigPanel extends MPanelScaledGUI { rePlaceElements(); } + public void invalidatePage(String page) { + pages.remove(page); + if (page.equals(currentPage)) + setupPage(); + } + @Override public void render(int absMousex, int absMousey, int relMousex0, int relMousey0, float partialTicks, Rectangle scissor) { Dimension effectiveDim = getEffectiveDimension(); @@ -190,6 +253,12 @@ public class RootConfigPanel extends MPanelScaledGUI { rePlaceElements(); } + @Override + public void setScale(double scale) { + super.setScale(scale); + rePlaceElements(); + } + private void rePlaceElements() { Dimension effectiveDim = getEffectiveDimension(); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/AbstractFeature.java b/src/main/java/kr/syeyoung/dungeonsguide/features/AbstractFeature.java index c71639cd..575dee1a 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/AbstractFeature.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/AbstractFeature.java @@ -63,7 +63,9 @@ public abstract class AbstractFeature { public void loadConfig(JsonObject jsonObject) { // gets key, calls it enabled = jsonObject.get("$enabled").getAsBoolean(); + for (Map.Entry parameterEntry : parameters.entrySet()) { + parameterEntry.getValue().setToDefault(); JsonElement element = jsonObject.get(parameterEntry.getKey()); if (element == null) continue; TypeConverter typeConverter = TypeConverterRegistry.getTypeConverter(parameterEntry.getValue().getValue_type()); @@ -96,6 +98,8 @@ public abstract class AbstractFeature { return "base." + key ; } + public void onParameterReset() {} + public boolean isDisyllable() { return true; } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureParameter.java b/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureParameter.java index ce8a5501..f5a2133a 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureParameter.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureParameter.java @@ -18,6 +18,8 @@ package kr.syeyoung.dungeonsguide.features; +import kr.syeyoung.dungeonsguide.config.types.TypeConverter; +import kr.syeyoung.dungeonsguide.config.types.TypeConverterRegistry; import lombok.AllArgsConstructor; import lombok.Data; @@ -30,5 +32,20 @@ public class FeatureParameter { private String description; private T value; + private T default_value; private String value_type; + + public FeatureParameter(String key, String name, String description, T default_value, String value_type) { + this.key = key; this.name = name; this.default_value = default_value; + this.description = description; this.value_type = value_type; + } + + public void setToDefault() { + TypeConverter typeConverter = TypeConverterRegistry.getTypeConverter(getValue_type()); + value = (T) typeConverter.deserialize(typeConverter.serialize(default_value)); + } + + public T getValue() { + return value == null ? default_value : value; + } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java b/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java index bf0d8961..d70b9066 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java @@ -75,26 +75,26 @@ public class FeatureRegistry { public static final FeatureRoomDebugInfo ADVANCED_DEBUG_ROOM = register(new FeatureRoomDebugInfo()); public static final FeatureDebuggableMap ADVANCED_DEBUGGABLE_MAP = register(new FeatureDebuggableMap()); public static final FeatureRoomCoordDisplay ADVANCED_COORDS = register(new FeatureRoomCoordDisplay()); - public static final SimpleFeature ADVANCED_RICHPRESENCE = register(new SimpleFeature("Advanced", "Discord Rich presence", "Discord rich presence with ASK-TO-JOIN Support!\n\nSimply type /dg asktojoin or /dg atj to toggle whether ask-to-join would be presented as option on discord!", "advanced.richpresence", true) { + public static final SimpleFeature ADVANCED_RICHPRESENCE = register(new SimpleFeature("Misc", "Discord RPC", "Discord rich presence with ASK-TO-JOIN Support!\n\nSimply type /dg asktojoin or /dg atj to toggle whether ask-to-join would be presented as option on discord!", "advanced.richpresence", true) { { parameters.put("disablenotskyblock", new FeatureParameter("disablenotskyblock", "Disable When not on Skyblock", "Disable When not on skyblock", false, "boolean")); } }); - public static final SimpleFeature SOLVER_RIDDLE = register(new SimpleFeature("Solver", "Riddle Puzzle (3 weirdo) Solver", "Highlights the correct box after clicking on all 3 weirdos", "solver.riddle")); - public static final SimpleFeature SOLVER_KAHOOT = register(new SimpleFeature("Solver", "Trivia Puzzle (Omnicrescent) Solver", "Highlights the correct solution for trivia puzzle", "solver.trivia")); - public static final SimpleFeature SOLVER_BLAZE = register(new SimpleFeature("Solver", "Blaze Puzzle Solver", "Highlights the blaze that needs to be killed in an blaze room", "solver.blaze") {{ + public static final SimpleFeature SOLVER_RIDDLE = register(new SimpleFeature("Solver.Any Floor", "Riddle", "Highlights the correct box after clicking on all 3 weirdos", "solver.riddle")); + public static final SimpleFeature SOLVER_KAHOOT = register(new SimpleFeature("Solver.Floor 4+", "Quiz", "Highlights the correct solution for trivia puzzle", "solver.trivia")); + public static final SimpleFeature SOLVER_BLAZE = register(new SimpleFeature("Solver.Floor 2+", "Blaze", "Highlights the blaze that needs to be killed in an blaze room", "solver.blaze") {{ parameters.put("blazeborder", new FeatureParameter("blazeborder", "Blaze Border Color", "Blaze border color", new AColor(255,255,255,0), "acolor")); }}); - public static final SimpleFeature SOLVER_TICTACTOE = register(new SimpleFeature("Solver", "Tictactoe Solver", "Shows the best move that could be taken by player in the tictactoe room", "solver.tictactoe")); - public static final SimpleFeature SOLVER_ICEPATH = register(new SimpleFeature("Solver", "Icepath Puzzle Solver (Advanced)", "Calculates solution for icepath puzzle and displays it to user", "solver.icepath")); - public static final SimpleFeature SOLVER_SILVERFISH = register(new SimpleFeature("Solver", "Silverfish Puzzle Solver (Advanced)", "Actively calculates solution for silverfish puzzle and displays it to user", "solver.silverfish")); - public static final SimpleFeature SOLVER_WATERPUZZLE = register(new SimpleFeature("Solver", "Waterboard Puzzle Solver (Advanced)", "Calculates solution for waterboard puzzle and displays it to user", "solver.waterboard")); - public static final SimpleFeature SOLVER_BOX = register(new SimpleFeature("Solver", "Box Puzzle Solver (Advanced)", "Calculates solution for box puzzle room, and displays it to user", "solver.box")); - public static final SimpleFeature SOLVER_BOX_DISABLE_TEXT = register(new SimpleFeature("Solver", "Box Puzzle Solver Disable text", "Disable 'Type recalc to recalculate solution' showing up on top left.\nYou can still type recalc to recalc solution after disabling this feature", "solver.boxrecalc", false)); - public static final SimpleFeature SOLVER_CREEPER = register(new SimpleFeature("Solver", "Creeper Puzzle Solver", "Draws line between prismarine lamps in creeper room", "solver.creeper")); - public static final SimpleFeature SOLVER_TELEPORT = register(new SimpleFeature("Solver", "Teleport Puzzle Solver", "Shows teleport pads you've visited in a teleport maze room", "solver.teleport")); - public static final SimpleFeature SOLVER_BOMBDEFUSE = register(new SimpleFeature("Solver", "Bomb Defuse Puzzle Solver", "Communicates with others dg using key 'F' for solutions and displays it", "solver.bombdefuse")); + public static final SimpleFeature SOLVER_TICTACTOE = register(new SimpleFeature("Solver.Any Floor", "Tictactoe", "Shows the best move that could be taken by player in the tictactoe room", "solver.tictactoe")); + public static final SimpleFeature SOLVER_ICEPATH = register(new SimpleFeature("Solver.Floor 3+", "Icepath (Advanced)", "Calculates solution for icepath puzzle and displays it to user", "solver.icepath")); + public static final SimpleFeature SOLVER_SILVERFISH = register(new SimpleFeature("Solver.Floor 3+", "Silverfish (Advanced)", "Actively calculates solution for silverfish puzzle and displays it to user", "solver.silverfish")); + public static final SimpleFeature SOLVER_WATERPUZZLE = register(new SimpleFeature("Solver.Any Floor", "Waterboard (Advanced)", "Calculates solution for waterboard puzzle and displays it to user", "solver.waterboard")); + public static final SimpleFeature SOLVER_BOX = register(new SimpleFeature("Solver.Floor 3+", "Box (Advanced)", "Calculates solution for box puzzle room, and displays it to user", "solver.box")); + public static final SimpleFeature SOLVER_BOX_DISABLE_TEXT = register(new SimpleFeature("Solver.Floor 3+", "Box Puzzle Solver Disable text", "Disable 'Type recalc to recalculate solution' showing up on top left.\nYou can still type recalc to recalc solution after disabling this feature", "solver.boxrecalc", false)); + public static final SimpleFeature SOLVER_CREEPER = register(new SimpleFeature("Solver.Any Floor", "Creeper", "Draws line between prismarine lamps in creeper room", "solver.creeper")); + public static final SimpleFeature SOLVER_TELEPORT = register(new SimpleFeature("Solver.Any Floor", "Teleport", "Shows teleport pads you've visited in a teleport maze room", "solver.teleport")); + public static final SimpleFeature SOLVER_BOMBDEFUSE = register(new SimpleFeature("Solver.Floor 7+", "Bomb Defuse", "Communicates with others dg using key 'F' for solutions and displays it", "solver.bombdefuse")); public static final FeatureTooltipDungeonStat ETC_DUNGEONSTAT = register(new FeatureTooltipDungeonStat()); public static final FeatureTooltipPrice ETC_PRICE = register(new FeatureTooltipPrice()); @@ -105,7 +105,7 @@ public class FeatureRegistry { public static final FeatureAutoAcceptReparty ETC_AUTO_ACCEPT_REPARTY = register(new FeatureAutoAcceptReparty()); public static final FeatureUpdateAlarm ETC_TEST = register(new FeatureUpdateAlarm()); - public static final SimpleFeature FIX_SPIRIT_BOOTS = register(new SimpleFeature("ETC", "Spirit Boots Fixer", "Fix Spirit boots messing up with inventory", "fixes.spirit", true)); + public static final SimpleFeature FIX_SPIRIT_BOOTS = register(new SimpleFeature("Misc", "Spirit Boots Fixer", "Fix Spirit boots messing up with inventory", "fixes.spirit", true)); public static final FeatureDisableMessage FIX_MESSAGES = register(new FeatureDisableMessage()); public static final FeatureCopyMessages ETC_COPY_MSG = register(new FeatureCopyMessages()); @@ -114,7 +114,6 @@ public class FeatureRegistry { public static final APIKey PARTYKICKER_APIKEY = register(new APIKey()); public static final FeatureViewPlayerOnJoin PARTYKICKER_VIEWPLAYER = register(new FeatureViewPlayerOnJoin()); - public static final FeatureGoodParties PARTYKICKER_GOODPARTIES = register(new FeatureGoodParties()); public static final FeatureCustomPartyFinder PARTYKICKER_CUSTOM = register(new FeatureCustomPartyFinder()); public static final FeatureWarningOnPortal BOSSFIGHT_WARNING_ON_PORTAL = register(new FeatureWarningOnPortal()); @@ -147,25 +146,20 @@ public class FeatureRegistry { public static final FeatureDungeonTombs DUNGEON_TOMBS = register(new FeatureDungeonTombs()); public static final FeatureDungeonScore DUNGEON_SCORE = register(new FeatureDungeonScore()); public static final FeatureWarnLowHealth DUNGEON_LOWHEALTH_WARN = register(new FeatureWarnLowHealth()); - public static final SimpleFeature DUNGEON_INTERMODCOMM = register(new SimpleFeature("Dungeon", "Communicate With Other's Dungeons Guide", "Sends total secret in the room to others\nSo that they can use the data to calculate total secret in dungeon run\n\nThis automates player chatting action, (chatting data) Thus it might be against hypixel's rules.\nBut mods like auto-gg which also automate player action and is kinda allowed mod exist so I'm leaving this feature.\nThis option is use-at-your-risk and you'll be responsible for ban if you somehow get banned because of this feature\n(Although it is not likely to happen)\nDefaults to off", "dungeon.intermodcomm", false)); + public static final SimpleFeature DUNGEON_INTERMODCOMM = register(new SimpleFeature("Dungeon.Teammates", "Communicate With Other's Dungeons Guide", "Sends total secret in the room to others\nSo that they can use the data to calculate total secret in dungeon run\n\nThis automates player chatting action, (chatting data) Thus it might be against hypixel's rules.\nBut mods like auto-gg which also automate player action and is kinda allowed mod exist so I'm leaving this feature.\nThis option is use-at-your-risk and you'll be responsible for ban if you somehow get banned because of this feature\n(Although it is not likely to happen)\nDefaults to off", "dungeon.intermodcomm", false)); public static final FeaturePlayerESP DUNGEON_PLAYERESP = register(new FeaturePlayerESP()); public static final FeatureHideNameTags DUNGEON_HIDENAMETAGS = register(new FeatureHideNameTags()); public static final FeatureMechanicBrowse SECRET_BROWSE = register(new FeatureMechanicBrowse()); public static final FeatureActions SECRET_ACTIONS = register(new FeatureActions()); public static final FeatureSoulRoomWarning SECRET_FAIRYSOUL = register(new FeatureSoulRoomWarning()); - public static final SimpleFeature SECRET_AUTO_BROWSE_NEXT = register(new SimpleFeature("Dungeon Secret.Secret Pathfind", "Auto browse next secret.", "Auto browse best next secret after current one completes.\nthe first pathfinding of first secret needs to be triggered first in order for this option to work", "secret.autobrowse", false)); - public static final SimpleFeature SECRET_AUTO_START = register(new SimpleFeature("Dungeon Secret.Secret Pathfind", "Auto browse secret upon entering room", "Auto browse best secret upon entering the room.", "secret.autouponenter", false)); - public static final SimpleFeature SECRET_NEXT_KEY = register(new SimpleFeature("Dungeon Secret.Secret Pathfind", "Auto browse next secret upon pressing a key", "Auto browse the best next secret when you press key.\nChange key at your key settings (Settings -> Controls)", "secret.keyfornext", false)); - public static final SimpleFeature SECRET_TOGGLE_KEY = register(new SimpleFeature("Dungeon Secret.Pathfind Display", "Press a key to toggle pathfind lines", "A key for toggling pathfound line visibility.\nChange key at your key settings (Settings -> Controls)", "secret.togglePathfind")); + public static final SimpleFeature SECRET_AUTO_BROWSE_NEXT = register(new SimpleFeature("Dungeon Secret.Secret Pathfind", "Auto Pathfind to next secret", "Auto browse best next secret after current one completes.\nthe first pathfinding of first secret needs to be triggered first in order for this option to work", "secret.autobrowse", false)); + public static final SimpleFeature SECRET_AUTO_START = register(new SimpleFeature("Dungeon Secret.Secret Pathfind", "Auto pathfind to new secret", "Auto browse best secret upon entering the room.", "secret.autouponenter", false)); + public static final SimpleFeature SECRET_NEXT_KEY = register(new SimpleFeature("Dungeon Secret.Secret Pathfind", "Auto Pathfind to new secret upon pressing a key", "Auto browse the best next secret when you press key.\nChange key at your key settings (Settings -> Controls)", "secret.keyfornext", false)); + public static final SimpleFeature SECRET_TOGGLE_KEY = register(new SimpleFeature("Dungeon Secret.Pathfind Display", "Toggle Pathfind Lines", "A key for toggling pathfound line visibility.\nChange key at your key settings (Settings -> Controls)", "secret.togglePathfind")); public static final SimpleFeature SECRET_FREEZE_LINES = register(new FeatureFreezePathfind()); public static final FeatureNicknamePrefix COSMETIC_PREFIX = register(new FeatureNicknamePrefix()); public static final FeatureNicknameColor COSMETIC_NICKNAMECOLOR = register(new FeatureNicknameColor()); - public static final SimpleFeature TEST_1 = register(new SimpleFeature("Test", "t", "t", "emp")); - public static final SimpleFeature TEST_1_1 = register(new SimpleFeature("Test.Test1", "t", "t", "emp")); - public static final SimpleFeature TEST_1_2 = register(new SimpleFeature("Test.Test2", "t", "t", "emp")); - public static final SimpleFeature TEST_1_2_1 = register(new SimpleFeature("Test.Test2.Test1", "t", "t", "emp")); - } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureAutoReparty.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureAutoReparty.java index 992802c2..67254ff1 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureAutoReparty.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureAutoReparty.java @@ -24,7 +24,7 @@ import kr.syeyoung.dungeonsguide.features.listener.DungeonQuitListener; public class FeatureAutoReparty extends SimpleFeature implements DungeonQuitListener { public FeatureAutoReparty() { - super("Bossfight", "Auto reparty when dungeon finishes","Auto reparty on dungeon finish\n\nThis automates player chatting action, (disbanding, repartying) Thus it might be against hypixel's rules.\nBut mods like auto-gg exist so I'm leaving this feature.\nThis option is use-at-your-risk and you'll be responsible for ban if you somehow get banned because of this feature\n(Although it is not likely to happen)\nDefaults to off", "bossfight.autoreparty", false); + super("Party.Reparty", "Auto reparty when dungeon finishes","Auto reparty on dungeon finish\n\nThis automates player chatting action, (disbanding, repartying) Thus it might be against hypixel's rules.\nBut mods like auto-gg exist so I'm leaving this feature.\nThis option is use-at-your-risk and you'll be responsible for ban if you somehow get banned because of this feature\n(Although it is not likely to happen)\nDefaults to off", "bossfight.autoreparty", false); } @Override diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureBoxRealLivid.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureBoxRealLivid.java index 51d649eb..415753b5 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureBoxRealLivid.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureBoxRealLivid.java @@ -32,7 +32,7 @@ import net.minecraft.util.AxisAlignedBB; public class FeatureBoxRealLivid extends SimpleFeature implements WorldRenderListener { public FeatureBoxRealLivid() { - super("Bossfight", "Box Real Livid", "Box Real Livid in bossfight", "bossfight.realLividBox", true); + super("Bossfight.Floor 5", "Box Real Livid", "Box Real Livid in bossfight", "bossfight.realLividBox", true); parameters.put("color", new FeatureParameter("color", "Highlight Color", "Highlight Color of Livid", new AColor(0,255,0,150), "acolor")); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureHideAnimals.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureHideAnimals.java index 4bd2d4e8..6330f5bb 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureHideAnimals.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureHideAnimals.java @@ -30,7 +30,7 @@ import net.minecraftforge.client.event.RenderLivingEvent; public class FeatureHideAnimals extends SimpleFeature implements EntityLivingRenderListener { public FeatureHideAnimals() { - super("Bossfight", "Hide animals on f4", "Hide Spirit Animals on F4. \nClick on Edit for precise setting", "bossfight.hideanimals", false); + super("Bossfight.Floor 4", "Hide animals on f4", "Hide Spirit Animals on F4. \nClick on Edit for precise setting", "bossfight.hideanimals", false); parameters.put("sheep", new FeatureParameter("sheep", "Hide Sheeps", "Hide Sheeps", true, "boolean")); parameters.put("cow", new FeatureParameter("cow", "Hide Cows", "Hide Cows", true, "boolean")); parameters.put("chicken", new FeatureParameter("chicken", "Hide Chickens", "Hide Chickens", true, "boolean")); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureTerracotaTimer.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureTerracotaTimer.java index 6a705499..22538cca 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureTerracotaTimer.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureTerracotaTimer.java @@ -34,7 +34,7 @@ import java.util.List; public class FeatureTerracotaTimer extends TextHUDFeature { public FeatureTerracotaTimer() { - super("Bossfight", "Display Terracotta phase timer", "Displays Terracotta phase timer", "bossfight.terracota", true, getFontRenderer().getStringWidth("Terracottas: 1m 99s"), getFontRenderer().FONT_HEIGHT); + super("Bossfight.Floor 6", "Display Terracotta phase timer", "Displays Terracotta phase timer", "bossfight.terracota", true, getFontRenderer().getStringWidth("Terracottas: 1m 99s"), getFontRenderer().FONT_HEIGHT); this.setEnabled(true); getStyles().add(new TextStyle("title", new AColor(0x00, 0xAA,0xAA,255), new AColor(0, 0,0,0), false)); getStyles().add(new TextStyle("separator", new AColor(0x55, 0x55,0x55,255), new AColor(0, 0,0,0), false)); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureThornBearPercentage.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureThornBearPercentage.java index c7365386..542beb6e 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureThornBearPercentage.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureThornBearPercentage.java @@ -32,7 +32,7 @@ import java.util.List; public class FeatureThornBearPercentage extends TextHUDFeature { public FeatureThornBearPercentage() { - super("Bossfight", "Display Spirit Bear Summon Percentage", "Displays spirit bear summon percentage in hud", "bossfight.spiritbear", true, getFontRenderer().getStringWidth("Spirit Bear: 100%"), getFontRenderer().FONT_HEIGHT); + super("Bossfight.Floor 4", "Display Spirit Bear Summon Percentage", "Displays spirit bear summon percentage in hud", "bossfight.spiritbear", true, getFontRenderer().getStringWidth("Spirit Bear: 100%"), getFontRenderer().FONT_HEIGHT); this.setEnabled(true); getStyles().add(new TextStyle("title", new AColor(0x00, 0xAA,0xAA,255), new AColor(0, 0,0,0), false)); getStyles().add(new TextStyle("separator", new AColor(0x55, 0x55,0x55,255), new AColor(0, 0,0,0), false)); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureThornSpiritBowTimer.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureThornSpiritBowTimer.java index 4c9bfd2b..24b289e1 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureThornSpiritBowTimer.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureThornSpiritBowTimer.java @@ -37,7 +37,7 @@ import java.util.List; public class FeatureThornSpiritBowTimer extends TextHUDFeature implements ChatListener, TitleListener { public FeatureThornSpiritBowTimer() { - super("Bossfight", "Display Spirit bow timer", "Displays how long until spirit bow gets destroyed", "bossfight.spiritbowdisplay", false, getFontRenderer().getStringWidth("Spirit Bow Destruction: 2m 00s"), getFontRenderer().FONT_HEIGHT); + super("Bossfight.Floor 4", "Display Spirit bow timer", "Displays how long until spirit bow gets destroyed", "bossfight.spiritbowdisplay", false, getFontRenderer().getStringWidth("Spirit Bow Destruction: 2m 00s"), getFontRenderer().FONT_HEIGHT); getStyles().add(new TextStyle("title", new AColor(0x00, 0xAA,0xAA,255), new AColor(0, 0,0,0), false)); getStyles().add(new TextStyle("separator", new AColor(0x55, 0x55,0x55,255), new AColor(0, 0,0,0), false)); getStyles().add(new TextStyle("time", new AColor(0x55, 0xFF,0xFF,255), new AColor(0, 0,0,0), false)); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureWarningOnPortal.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureWarningOnPortal.java index 8e585a0b..97683eb2 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureWarningOnPortal.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureWarningOnPortal.java @@ -40,7 +40,7 @@ import java.util.*; public class FeatureWarningOnPortal extends SimpleFeature implements StyledTextProvider { public FeatureWarningOnPortal() { - super("Bossfight", "Show warnings on red portal", "Display warnings such as\n- 'NOT ALL ROOMS DISCOVERED'\n- 'NOT ALL ROOMS COMPLETED'\n- 'Expected Score: 304'\n- 'MISSING 3 CRYPTS'\non portal", "bossfight.warningonportal"); + super("Dungeon.Blood Room", "Score Warning on Watcher portal", "Display warnings such as\n- 'NOT ALL ROOMS DISCOVERED'\n- 'NOT ALL ROOMS COMPLETED'\n- 'Expected Score: 304'\n- 'MISSING 3 CRYPTS'\non portal", "bossfight.warningonportal"); this.parameters.put("textStyles", new FeatureParameter>("textStyles", "", "", new ArrayList(), "list_textStyle")); getStyles().add(new TextStyle("warning", new AColor(255, 0,0,255), new AColor(255, 255,255,255), false)); getStyles().add(new TextStyle("field_name", new AColor(255, 72,255,255), new AColor(0, 0,0,0), false)); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/FeatureSimonSaysSolver.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/FeatureSimonSaysSolver.java index ba0322f6..d8f1bcc1 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/FeatureSimonSaysSolver.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/FeatureSimonSaysSolver.java @@ -40,7 +40,7 @@ import java.util.List; public class FeatureSimonSaysSolver extends SimpleFeature implements WorldRenderListener, TickListener, InteractListener { public FeatureSimonSaysSolver() { - super("Bossfight","Simon Says Solver","Solver for Simon says puzzle", "bossfight.simonsays2"); + super("Solver.Floor 7+.Bossfight","Simon Says Solver","Solver for Simon says puzzle", "bossfight.simonsays2"); } private final SkyblockStatus ss = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/FeatureTerminalSolvers.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/FeatureTerminalSolvers.java index f86bbf3c..749f1e2a 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/FeatureTerminalSolvers.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/FeatureTerminalSolvers.java @@ -38,7 +38,7 @@ import java.util.List; public class FeatureTerminalSolvers extends SimpleFeature implements GuiOpenListener, TickListener, GuiPostRenderListener, GuiClickListener, TooltipListener { public FeatureTerminalSolvers() { - super("Bossfight","F7 GUI Terminal Solver", "Solve f7 gui terminals. (color, startswith, order, navigate, correct panes)", "bossfight.terminals"); + super("Solver.Floor 7+.Bossfight","F7 GUI Terminal Solver", "Solve f7 gui terminals. (color, startswith, order, navigate, correct panes)", "bossfight.terminals"); } public static final List solutionProviders = new ArrayList(); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxBats.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxBats.java index a7c58ea4..5fac96b9 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxBats.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxBats.java @@ -36,7 +36,7 @@ import java.util.List; public class FeatureBoxBats extends SimpleFeature implements WorldRenderListener { public FeatureBoxBats() { - super("Dungeon", "Box Bats", "Box bats in dungeons\nDoes not appear through walls", "dungeon.batbox", true); + super("Dungeon.Mobs", "Box Bats", "Box bats in dungeons\nDoes not appear through walls", "dungeon.batbox", true); parameters.put("radius", new FeatureParameter("radius", "Highlight Radius", "The maximum distance between player and bats to be boxed", 20, "integer")); parameters.put("color", new FeatureParameter("color", "Highlight Color", "Highlight Color of Bats", new AColor(255,0,0,50), "acolor")); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxSkelemaster.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxSkelemaster.java index 4e80ccf6..7e8c736b 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxSkelemaster.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxSkelemaster.java @@ -36,7 +36,7 @@ import java.util.List; public class FeatureBoxSkelemaster extends SimpleFeature implements WorldRenderListener { public FeatureBoxSkelemaster() { - super("Dungeon", "Box Skeleton Masters", "Box skeleton masters in dungeons", "dungeon.skeletonmasterbox", true); + super("Dungeon.Mobs", "Box Skeleton Masters", "Box skeleton masters in dungeons", "dungeon.skeletonmasterbox", true); parameters.put("radius", new FeatureParameter("radius", "Highlight Radius", "The maximum distance between player and skeletonmaster to be boxed", 20, "integer")); parameters.put("color", new FeatureParameter("color", "Highlight Color", "Highlight Color of Skeleton master", new AColor(255,0,0,50), "acolor")); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxStarMobs.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxStarMobs.java index bce0ef21..e41e9f69 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxStarMobs.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxStarMobs.java @@ -36,7 +36,7 @@ import java.util.List; public class FeatureBoxStarMobs extends SimpleFeature implements WorldRenderListener { public FeatureBoxStarMobs() { - super("Dungeon", "Box Starred mobs", "Box Starred mobs in dungeons", "dungeon.starmobbox", false); + super("Dungeon.Mobs", "Box Starred mobs", "Box Starred mobs in dungeons", "dungeon.starmobbox", false); parameters.put("radius", new FeatureParameter("radius", "Highlight Radius", "The maximum distance between player and starred mobs to be boxed", 20, "integer")); parameters.put("color", new FeatureParameter("color", "Highlight Color", "Highlight Color of Starred mobs", new AColor(0,255,255,50), "acolor")); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonCurrentRoomSecrets.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonCurrentRoomSecrets.java index df6553e4..cf1ebc08 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonCurrentRoomSecrets.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonCurrentRoomSecrets.java @@ -33,7 +33,7 @@ import java.util.List; public class FeatureDungeonCurrentRoomSecrets extends TextHUDFeature implements ChatListener { public FeatureDungeonCurrentRoomSecrets() { - super("Dungeon", "Display #Secrets in current room", "Display what your actionbar says", "dungeon.stats.secretsroom", true, getFontRenderer().getStringWidth("Secrets In Room: 8/8"), getFontRenderer().FONT_HEIGHT); + super("Dungeon.Dungeon Information", "Display # Secrets in current room", "Display what your actionbar says", "dungeon.stats.secretsroom", true, getFontRenderer().getStringWidth("Secrets In Room: 8/8"), getFontRenderer().FONT_HEIGHT); this.setEnabled(false); getStyles().add(new TextStyle("title", new AColor(0x00, 0xAA,0xAA,255), new AColor(0, 0,0,0), false)); getStyles().add(new TextStyle("separator", new AColor(0x55, 0x55,0x55,255), new AColor(0, 0,0,0), false)); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonDeaths.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonDeaths.java index 58f6e83a..bb3d5241 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonDeaths.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonDeaths.java @@ -41,7 +41,7 @@ import java.util.regex.Pattern; public class FeatureDungeonDeaths extends TextHUDFeature implements ChatListener { public FeatureDungeonDeaths() { - super("Dungeon", "Display Deaths", "Display names of player and death count in dungeon run", "dungeon.stats.deaths", false, getFontRenderer().getStringWidth("longestplayernamepos: 100"), getFontRenderer().FONT_HEIGHT * 6); + super("Dungeon.Dungeon Information", "Display Deaths", "Display names of player and death count in dungeon run", "dungeon.stats.deaths", false, getFontRenderer().getStringWidth("longestplayernamepos: 100"), getFontRenderer().FONT_HEIGHT * 6); this.setEnabled(false); getStyles().add(new TextStyle("username", new AColor(0x00, 0xAA,0xAA,255), new AColor(0, 0,0,0), false)); getStyles().add(new TextStyle("total", new AColor(0x00, 0xAA,0xAA,255), new AColor(0, 0,0,0), false)); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonMilestone.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonMilestone.java index dd3a8a50..e9819690 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonMilestone.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonMilestone.java @@ -41,7 +41,7 @@ import java.util.regex.Pattern; public class FeatureDungeonMilestone extends TextHUDFeature implements ChatListener { public FeatureDungeonMilestone() { - super("Dungeon", "Display Current Class Milestone", "Display current class milestone of yourself", "dungeon.stats.milestone", true, getFontRenderer().getStringWidth("Milestone: 12"), getFontRenderer().FONT_HEIGHT); + super("Dungeon.Dungeon Information", "Display Current Class Milestone", "Display current class milestone of yourself", "dungeon.stats.milestone", true, getFontRenderer().getStringWidth("Milestone: 12"), getFontRenderer().FONT_HEIGHT); this.setEnabled(false); getStyles().add(new TextStyle("title", new AColor(0x00, 0xAA,0xAA,255), new AColor(0, 0,0,0), false)); getStyles().add(new TextStyle("separator", new AColor(0x55, 0x55,0x55,255), new AColor(0, 0,0,0), false)); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonRealTime.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonRealTime.java index 0718ab0f..fa69f006 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonRealTime.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonRealTime.java @@ -32,7 +32,7 @@ import java.util.List; public class FeatureDungeonRealTime extends TextHUDFeature implements DungeonStartListener, DungeonEndListener { public FeatureDungeonRealTime() { - super("Dungeon", "Display Real Time-Dungeon Time", "Display how much real time has passed since dungeon run started", "dungeon.stats.realtime", true, getFontRenderer().getStringWidth("Time(Real): 59m 59s"), getFontRenderer().FONT_HEIGHT); + super("Dungeon.Dungeon Information", "Display Real Time-Dungeon Time", "Display how much real time has passed since dungeon run started", "dungeon.stats.realtime", true, getFontRenderer().getStringWidth("Time(Real): 59m 59s"), getFontRenderer().FONT_HEIGHT); this.setEnabled(false); getStyles().add(new TextStyle("title", new AColor(0x00, 0xAA,0xAA,255), new AColor(0, 0,0,0), false)); getStyles().add(new TextStyle("discriminator", new AColor(0xAA,0xAA,0xAA,255), new AColor(0, 0,0,0), false)); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonRoomName.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonRoomName.java index 56ae9be8..03217b30 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonRoomName.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonRoomName.java @@ -39,7 +39,7 @@ import java.util.List; public class FeatureDungeonRoomName extends TextHUDFeature { public FeatureDungeonRoomName() { - super("Dungeon", "Display name of the room you are in", "Display name of the room you are in", "dungeon.roomname", false, getFontRenderer().getStringWidth("You're in puzzle-tictactoe"), getFontRenderer().FONT_HEIGHT); + super("Dungeon.Dungeon Information", "Display name of the room you are in", "Display name of the room