aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/thatgravyboat/skyblockhud/config
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/config')
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/config/SBHConfig.java27
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/config/SBHConfigEditor.java83
2 files changed, 74 insertions, 36 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/config/SBHConfig.java b/src/main/java/com/thatgravyboat/skyblockhud/config/SBHConfig.java
index 8d84833..9b42192 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/config/SBHConfig.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/config/SBHConfig.java
@@ -50,9 +50,9 @@ public class SBHConfig extends Config {
case "map":
editOverlay(activeConfigCategory, 72, 72, map.miniMapPosition);
return;
- // case "tracker":
- // editOverlay(activeConfigCategory, 120, 70, trackers.trackerPosition);
- // return;
+ case "tracker":
+ editOverlay(activeConfigCategory, 130, 70, trackers.trackerPosition);
+ return;
}
}
@@ -84,17 +84,26 @@ public class SBHConfig extends Config {
@Category(name = "Mining", desc = "All Options for the Mining Stuff.")
public Mining mining = new Mining();
- //TODO ENABLED WHEN TRACKER GETS ADDED BACK
- // @Expose
- // @Category(name = "Tracker", desc = "All Options for the Trackers.")
- // public Trackers trackers = new Trackers();
+ @Expose
+ @Category(name = "Tracker", desc = "All Options for the Trackers.")
+ public Trackers trackers = new Trackers();
public static class Misc {
@Expose
- @ConfigOption(name = "Hide Scoreboard", desc = "Hides the scoreboard when in skyblock.")
+ @ConfigOption(name = "Hide Scoreboard", desc = "Hides the scoreboard when in Skyblock.")
@ConfigEditorBoolean
public boolean hideScoreboard = false;
+
+ @Expose
+ @ConfigOption(
+ name = "Bar Textures",
+ desc = "Change the style of bars. Dont change this unless the pack ur using tells you can."
+ )
+ @ConfigEditorDropdown(
+ values = {"Style 1", "Style 2"}
+ )
+ public int barTexture = 0;
}
public static class MainHud {
@@ -342,6 +351,6 @@ public class SBHConfig extends Config {
@Expose
@ConfigOption(name = "Hide Tracker", desc = "It will still track the data just in case.")
@ConfigEditorBoolean
- public boolean hideTracker = false;
+ public boolean hideTracker = true;
}
}
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/config/SBHConfigEditor.java b/src/main/java/com/thatgravyboat/skyblockhud/config/SBHConfigEditor.java
index 8bbeaa7..90325f8 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/config/SBHConfigEditor.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/config/SBHConfigEditor.java
@@ -1,8 +1,5 @@
package com.thatgravyboat.skyblockhud.config;
-import static com.thatgravyboat.skyblockhud.GuiTextures.DISCORD;
-import static com.thatgravyboat.skyblockhud.GuiTextures.TWITTER;
-
import com.google.common.collect.Lists;
import com.thatgravyboat.skyblockhud.core.GlScissorStack;
import com.thatgravyboat.skyblockhud.core.GuiElement;
@@ -16,8 +13,8 @@ import com.thatgravyboat.skyblockhud.core.util.render.RenderUtils;
import com.thatgravyboat.skyblockhud.core.util.render.TextRenderUtils;
import java.awt.*;
import java.net.URI;
-import java.util.*;
import java.util.List;
+import java.util.*;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.Gui;
@@ -28,6 +25,9 @@ import net.minecraft.util.ResourceLocation;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
+import static com.thatgravyboat.skyblockhud.GuiTextures.DISCORD;
+import static com.thatgravyboat.skyblockhud.GuiTextures.TWITTER;
+
public class SBHConfigEditor extends GuiElement {
private static final ResourceLocation[] socialsIco = new ResourceLocation[] { DISCORD, TWITTER };
@@ -41,6 +41,7 @@ public class SBHConfigEditor extends GuiElement {
private final LerpingInteger categoryScroll = new LerpingInteger(0, 150);
private LinkedHashMap<String, ConfigProcessor.ProcessedCategory> processedConfig;
+ private TreeMap<String, Set<ConfigProcessor.ProcessedOption>> searchOptionMap = new TreeMap<>();
private HashMap<ConfigProcessor.ProcessedOption, ConfigProcessor.ProcessedCategory> categoryForOption = new HashMap<>();
public SBHConfigEditor(Config config) {
@@ -232,14 +233,15 @@ public class SBHConfigEditor extends GuiElement {
ConfigProcessor.ProcessedCategory cat = currentConfigEditing.get(getSelectedCategory());
int optionWidthDefault = innerRight - innerLeft - 20;
GlStateManager.enableDepth();
- Set<Integer> activeAccordions = new HashSet<>();
+ HashMap<Integer, Integer> activeAccordions = new HashMap<>();
for (ConfigProcessor.ProcessedOption option : getOptionsInCategory(cat).values()) {
int optionWidth = optionWidthDefault;
if (option.accordionId >= 0) {
- if (!activeAccordions.contains(option.accordionId)) {
+ if(!activeAccordions.containsKey(option.accordionId)) {
continue;
}
- optionWidth = optionWidthDefault - 2 * innerPadding;
+ int accordionDepth = activeAccordions.get(option.accordionId);
+ optionWidth = optionWidthDefault - (2 * innerPadding)*(accordionDepth + 1);
}
GuiOptionEditor editor = option.editor;
@@ -249,7 +251,11 @@ public class SBHConfigEditor extends GuiElement {
if (editor instanceof GuiOptionEditorAccordion) {
GuiOptionEditorAccordion accordion = (GuiOptionEditorAccordion) editor;
if (accordion.getToggled()) {
- activeAccordions.add(accordion.getAccordionId());
+ int accordionDepth = 0;
+ if (option.accordionId >= 0) {
+ accordionDepth = activeAccordions.get(option.accordionId)+1;
+ }
+ activeAccordions.put(accordion.getAccordionId(), accordionDepth);
}
}
int optionHeight = editor.getHeight();
@@ -274,14 +280,15 @@ public class SBHConfigEditor extends GuiElement {
GlStateManager.translate(0, 0, 10);
GlStateManager.enableDepth();
- Set<Integer> activeAccordions = new HashSet<>();
+ HashMap<Integer, Integer> activeAccordions = new HashMap<>();
for (ConfigProcessor.ProcessedOption option : getOptionsInCategory(cat).values()) {
int optionWidth = optionWidthDefault;
if (option.accordionId >= 0) {
- if (!activeAccordions.contains(option.accordionId)) {
+ if (!activeAccordions.containsKey(option.accordionId)) {
continue;
}
- optionWidth = optionWidthDefault - 2 * innerPadding;
+ int accordionDepth = activeAccordions.get(option.accordionId);
+ optionWidth = optionWidthDefault - (2 * innerPadding) * (accordionDepth + 1);
}
GuiOptionEditor editor = option.editor;
@@ -291,7 +298,11 @@ public class SBHConfigEditor extends GuiElement {
if (editor instanceof GuiOptionEditorAccordion) {
GuiOptionEditorAccordion accordion = (GuiOptionEditorAccordion) editor;
if (accordion.getToggled()) {
- activeAccordions.add(accordion.getAccordionId());
+ int accordionDepth = 0;
+ if (option.accordionId >= 0) {
+ accordionDepth = activeAccordions.get(option.accordionId)+1;
+ }
+ activeAccordions.put(accordion.getAccordionId(), accordionDepth);
}
}
int optionHeight = editor.getHeight();
@@ -403,10 +414,10 @@ public class SBHConfigEditor extends GuiElement {
int optionY = -newTarget;
if (getSelectedCategory() != null && getCurrentConfigEditing() != null && getCurrentConfigEditing().containsKey(getSelectedCategory())) {
ConfigProcessor.ProcessedCategory cat = getCurrentConfigEditing().get(getSelectedCategory());
- Set<Integer> activeAccordions = new HashSet<>();
+ HashMap<Integer, Integer> activeAccordions = new HashMap<>();
for (ConfigProcessor.ProcessedOption option : getOptionsInCategory(cat).values()) {
if (option.accordionId >= 0) {
- if (!activeAccordions.contains(option.accordionId)) {
+ if (!activeAccordions.containsKey(option.accordionId)) {
continue;
}
}
@@ -418,7 +429,11 @@ public class SBHConfigEditor extends GuiElement {
if (editor instanceof GuiOptionEditorAccordion) {
GuiOptionEditorAccordion accordion = (GuiOptionEditorAccordion) editor;
if (accordion.getToggled()) {
- activeAccordions.add(accordion.getAccordionId());
+ int accordionDepth = 0;
+ if (option.accordionId >= 0) {
+ accordionDepth = activeAccordions.get(option.accordionId)+1;
+ }
+ activeAccordions.put(accordion.getAccordionId(), accordionDepth);
}
}
optionY += editor.getHeight() + 5;
@@ -468,14 +483,15 @@ public class SBHConfigEditor extends GuiElement {
if (getSelectedCategory() != null && getCurrentConfigEditing() != null && getCurrentConfigEditing().containsKey(getSelectedCategory())) {
int optionWidthDefault = innerRight - innerLeft - 20;
ConfigProcessor.ProcessedCategory cat = getCurrentConfigEditing().get(getSelectedCategory());
- Set<Integer> activeAccordions = new HashSet<>();
+ HashMap<Integer, Integer> activeAccordions = new HashMap<>();
for (ConfigProcessor.ProcessedOption option : getOptionsInCategory(cat).values()) {
int optionWidth = optionWidthDefault;
if (option.accordionId >= 0) {
- if (!activeAccordions.contains(option.accordionId)) {
+ if (!activeAccordions.containsKey(option.accordionId)) {
continue;
}
- optionWidth = optionWidthDefault - 2 * innerPadding;
+ int accordionDepth = activeAccordions.get(option.accordionId);
+ optionWidth = optionWidthDefault - (2*innerPadding)*(accordionDepth+1);
}
GuiOptionEditor editor = option.editor;
@@ -485,7 +501,11 @@ public class SBHConfigEditor extends GuiElement {
if (editor instanceof GuiOptionEditorAccordion) {
GuiOptionEditorAccordion accordion = (GuiOptionEditorAccordion) editor;
if (accordion.getToggled()) {
- activeAccordions.add(accordion.getAccordionId());
+ int accordionDepth = 0;
+ if (option.accordionId >= 0) {
+ accordionDepth = activeAccordions.get(option.accordionId)+1;
+ }
+ activeAccordions.put(accordion.getAccordionId(), accordionDepth);
}
}
if (editor.mouseInputOverlay((innerLeft + innerRight - optionWidth) / 2 - 5, innerTop + 5 + optionY, optionWidth, mouseX, mouseY)) {
@@ -500,14 +520,15 @@ public class SBHConfigEditor extends GuiElement {
if (getSelectedCategory() != null && getCurrentConfigEditing() != null && getCurrentConfigEditing().containsKey(getSelectedCategory())) {
int optionWidthDefault = innerRight - innerLeft - 20;
ConfigProcessor.ProcessedCategory cat = getCurrentConfigEditing().get(getSelectedCategory());
- Set<Integer> activeAccordions = new HashSet<>();
+ HashMap<Integer, Integer> activeAccordions = new HashMap<>();
for (ConfigProcessor.ProcessedOption option : getOptionsInCategory(cat).values()) {
int optionWidth = optionWidthDefault;
if (option.accordionId >= 0) {
- if (!activeAccordions.contains(option.accordionId)) {
+ if (!activeAccordions.containsKey(option.accordionId)) {
continue;
}
- optionWidth = optionWidthDefault - 2 * innerPadding;
+ int accordionDepth = activeAccordions.get(option.accordionId);
+ optionWidth = optionWidthDefault - (2*innerPadding)*(accordionDepth+1);
}
GuiOptionEditor editor = option.editor;
@@ -517,7 +538,11 @@ public class SBHConfigEditor extends GuiElement {
if (editor instanceof GuiOptionEditorAccordion) {
GuiOptionEditorAccordion accordion = (GuiOptionEditorAccordion) editor;
if (accordion.getToggled()) {
- activeAccordions.add(accordion.getAccordionId());
+ int accordionDepth = 0;
+ if (option.accordionId >= 0) {
+ accordionDepth = activeAccordions.get(option.accordionId)+1;
+ }
+ activeAccordions.put(accordion.getAccordionId(), accordionDepth);
}
}
if (editor.mouseInput((innerLeft + innerRight - optionWidth) / 2 - 5, innerTop + 5 + optionY, optionWidth, mouseX, mouseY)) {
@@ -544,10 +569,10 @@ public class SBHConfigEditor extends GuiElement {
if (getSelectedCategory() != null && getCurrentConfigEditing() != null && getCurrentConfigEditing().containsKey(getSelectedCategory())) {
ConfigProcessor.ProcessedCategory cat = getCurrentConfigEditing().get(getSelectedCategory());
- Set<Integer> activeAccordions = new HashSet<>();
+ HashMap<Integer, Integer> activeAccordions = new HashMap<>();
for (ConfigProcessor.ProcessedOption option : getOptionsInCategory(cat).values()) {
if (option.accordionId >= 0) {
- if (!activeAccordions.contains(option.accordionId)) {
+ if (!activeAccordions.containsKey(option.accordionId)) {
continue;
}
}
@@ -559,7 +584,11 @@ public class SBHConfigEditor extends GuiElement {
if (editor instanceof GuiOptionEditorAccordion) {
GuiOptionEditorAccordion accordion = (GuiOptionEditorAccordion) editor;
if (accordion.getToggled()) {
- activeAccordions.add(accordion.getAccordionId());
+ int accordionDepth = 0;
+ if (option.accordionId >= 0) {
+ accordionDepth = activeAccordions.get(option.accordionId)+1;
+ }
+ activeAccordions.put(accordion.getAccordionId(), accordionDepth);
}
}
if (editor.keyboardInput()) {
@@ -570,4 +599,4 @@ public class SBHConfigEditor extends GuiElement {
return true;
}
-}
+} \ No newline at end of file