aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/thatgravyboat/skyblockhud/config
diff options
context:
space:
mode:
authorTymanWasTaken <tyman@tyman.tech>2021-07-06 17:20:49 -0400
committerTymanWasTaken <tyman@tyman.tech>2021-07-06 17:20:49 -0400
commitc04ca523f9fb9f7adefa74587db61f76deeae9f0 (patch)
treef148e7bcd9105813d3fe781badcb2cf3892712fd /src/main/java/com/thatgravyboat/skyblockhud/config
parenta8e475fa0a7977f64f072548459d592274169d66 (diff)
downloadSkyblockHud-Death-Defied-c04ca523f9fb9f7adefa74587db61f76deeae9f0.tar.gz
SkyblockHud-Death-Defied-c04ca523f9fb9f7adefa74587db61f76deeae9f0.tar.bz2
SkyblockHud-Death-Defied-c04ca523f9fb9f7adefa74587db61f76deeae9f0.zip
Increase line width
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/config')
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/config/KeyBindings.java6
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/config/SBHConfig.java158
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/config/SBHConfigEditor.java458
3 files changed, 109 insertions, 513 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/config/KeyBindings.java b/src/main/java/com/thatgravyboat/skyblockhud/config/KeyBindings.java
index 044bab9..9ffd352 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/config/KeyBindings.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/config/KeyBindings.java
@@ -4,9 +4,5 @@ import net.minecraft.client.settings.KeyBinding;
public class KeyBindings {
- public static KeyBinding map = new KeyBinding(
- "Opens the big map.",
- 50,
- "SkyblockHud"
- );
+ public static KeyBinding map = new KeyBinding("Opens the big map.", 50, "SkyblockHud");
}
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/config/SBHConfig.java b/src/main/java/com/thatgravyboat/skyblockhud/config/SBHConfig.java
index 52272b7..84e5483 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/config/SBHConfig.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/config/SBHConfig.java
@@ -11,12 +11,7 @@ import net.minecraft.client.Minecraft;
public class SBHConfig extends Config {
- private void editOverlay(
- String activeConfig,
- int width,
- int height,
- Position position
- ) {
+ private void editOverlay(String activeConfig, int width, int height, Position position) {
Minecraft
.getMinecraft()
.displayGuiScreen(
@@ -28,12 +23,7 @@ public class SBHConfig extends Config {
() -> {},
() ->
SkyblockHud.screenToOpen =
- new GuiScreenElementWrapper(
- new SBHConfigEditor(
- SkyblockHud.config,
- activeConfig
- )
- )
+ new GuiScreenElementWrapper(new SBHConfigEditor(SkyblockHud.config, activeConfig))
)
);
}
@@ -41,17 +31,10 @@ public class SBHConfig extends Config {
@Override
public void executeRunnable(String runnableId) {
String activeConfigCategory = null;
- if (
- Minecraft.getMinecraft()
- .currentScreen instanceof GuiScreenElementWrapper
- ) {
- GuiScreenElementWrapper wrapper = (GuiScreenElementWrapper) Minecraft.getMinecraft()
- .currentScreen;
+ if (Minecraft.getMinecraft().currentScreen instanceof GuiScreenElementWrapper) {
+ GuiScreenElementWrapper wrapper = (GuiScreenElementWrapper) Minecraft.getMinecraft().currentScreen;
if (wrapper.element instanceof SBHConfigEditor) {
- activeConfigCategory =
- (
- (SBHConfigEditor) wrapper.element
- ).getSelectedCategoryName();
+ activeConfigCategory = ((SBHConfigEditor) wrapper.element).getSelectedCategoryName();
}
}
@@ -60,36 +43,16 @@ public class SBHConfig extends Config {
editOverlay(activeConfigCategory, 120, 47, rpg.rpgHudPosition);
return;
case "d1":
- editOverlay(
- activeConfigCategory,
- 120,
- 32,
- dungeon.dungeonPlayer1
- );
+ editOverlay(activeConfigCategory, 120, 32, dungeon.dungeonPlayer1);
return;
case "d2":
- editOverlay(
- activeConfigCategory,
- 120,
- 32,
- dungeon.dungeonPlayer2
- );
+ editOverlay(activeConfigCategory, 120, 32, dungeon.dungeonPlayer2);
return;
case "d3":
- editOverlay(
- activeConfigCategory,
- 120,
- 32,
- dungeon.dungeonPlayer3
- );
+ editOverlay(activeConfigCategory, 120, 32, dungeon.dungeonPlayer3);
return;
case "d4":
- editOverlay(
- activeConfigCategory,
- 120,
- 32,
- dungeon.dungeonPlayer4
- );
+ editOverlay(activeConfigCategory, 120, 32, dungeon.dungeonPlayer4);
return;
case "main":
editOverlay(activeConfigCategory, 1000, 34, main.mainHudPos);
@@ -101,12 +64,7 @@ public class SBHConfig extends Config {
editOverlay(activeConfigCategory, 72, 72, map.miniMapPosition);
return;
case "tracker":
- editOverlay(
- activeConfigCategory,
- 120,
- 70,
- trackers.trackerPosition
- );
+ editOverlay(activeConfigCategory, 120, 70, trackers.trackerPosition);
return;
}
}
@@ -142,10 +100,7 @@ public class SBHConfig extends Config {
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;
}
@@ -166,10 +121,7 @@ public class SBHConfig extends Config {
public boolean twelveHourClock = false;
@Expose
- @ConfigOption(
- name = "Shift hud with boss",
- desc = "Shifts the hud when bossbar is visible."
- )
+ @ConfigOption(name = "Shift hud with boss", desc = "Shifts the hud when bossbar is visible.")
@ConfigEditorBoolean
public boolean bossShiftHud = true;
@@ -185,18 +137,12 @@ public class SBHConfig extends Config {
public static class RPGHud {
@Expose
- @ConfigOption(
- name = "Show RPG Hud",
- desc = "Allows you to show or hide the RPG Hud."
- )
+ @ConfigOption(name = "Show RPG Hud", desc = "Allows you to show or hide the RPG Hud.")
@ConfigEditorBoolean
public boolean showRpgHud = true;
@Expose
- @ConfigOption(
- name = "RPG Hud Position",
- desc = "Allows you to change the position of the RPG Hud."
- )
+ @ConfigOption(name = "RPG Hud Position", desc = "Allows you to change the position of the RPG Hud.")
@ConfigEditorButton(runnableId = "rpg", buttonText = "Edit")
public Position rpgHudPosition = new Position(1, 1);
}
@@ -209,48 +155,32 @@ public class SBHConfig extends Config {
public boolean ultimateBar = false;
@Expose
- @ConfigOption(
- name = "Hide Ultimate Bar",
- desc = "Hides the custom ultimate bar."
- )
+ @ConfigOption(name = "Hide Ultimate Bar", desc = "Hides the custom ultimate bar.")
@ConfigEditorBoolean
@ConfigAccordionId(id = 2)
public boolean hideUltimateBar = false;
@Expose
- @ConfigOption(
- name = "Bar Position",
- desc = "Change the position of the bar."
- )
+ @ConfigOption(name = "Bar Position", desc = "Change the position of the bar.")
@ConfigEditorButton(runnableId = "ultimate", buttonText = "Edit")
@ConfigAccordionId(id = 2)
public Position barPosition = new Position(0, 50, true, false);
@Expose
- @ConfigOption(
- name = "Bar Loading Color",
- desc = "The color of the bar when its loading."
- )
+ @ConfigOption(name = "Bar Loading Color", desc = "The color of the bar when its loading.")
@ConfigEditorColour
@ConfigAccordionId(id = 2)
public String barLoadColor = "159:0:0:0:255";
@Expose
- @ConfigOption(
- name = "Bar Full Color",
- desc = "The color of the bar when its full."
- )
+ @ConfigOption(name = "Bar Full Color", desc = "The color of the bar when its full.")
@ConfigEditorColour
@ConfigAccordionId(id = 2)
public String barFullColor = "255:0:0:0:255";
@Expose
@ConfigOption(name = "Bar Style", desc = "Change the style of the bar")
- @ConfigEditorDropdown(
- values = {
- "No Notch", "6 Notch", "10 Notch", "12 Notch", "20 Notch"
- }
- )
+ @ConfigEditorDropdown(values = { "No Notch", "6 Notch", "10 Notch", "12 Notch", "20 Notch" })
@ConfigAccordionId(id = 2)
public int barStyle = 2;
@@ -260,10 +190,7 @@ public class SBHConfig extends Config {
public boolean dungeonPlayerAccordion = false;
@Expose
- @ConfigOption(
- name = "Hide Dungeon Players",
- desc = "Allows you to hide the dungeon player hud"
- )
+ @ConfigOption(name = "Hide Dungeon Players", desc = "Allows you to hide the dungeon player hud")
@ConfigEditorBoolean
@ConfigAccordionId(id = 1)
public boolean hideDungeonPlayers = false;
@@ -278,46 +205,31 @@ public class SBHConfig extends Config {
public int dungeonPlayerOpacity = 0;
@Expose
- @ConfigOption(
- name = "Hide Dead Players",
- desc = "Allows you to hide players that are dead or have left."
- )
+ @ConfigOption(name = "Hide Dead Players", desc = "Allows you to hide players that are dead or have left.")
@ConfigEditorBoolean
@ConfigAccordionId(id = 1)
public boolean hideDeadDungeonPlayers = false;
@Expose
- @ConfigOption(
- name = "Player Position 1",
- desc = "Change the position of this dungeon player."
- )
+ @ConfigOption(name = "Player Position 1", desc = "Change the position of this dungeon player.")
@ConfigEditorButton(runnableId = "d1", buttonText = "Edit")
@ConfigAccordionId(id = 1)
public Position dungeonPlayer1 = new Position(5, 5);
@Expose
- @ConfigOption(
- name = "Player Position 2",
- desc = "Change the position of this dungeon player."
- )
+ @ConfigOption(name = "Player Position 2", desc = "Change the position of this dungeon player.")
@ConfigEditorButton(runnableId = "d2", buttonText = "Edit")
@ConfigAccordionId(id = 1)
public Position dungeonPlayer2 = new Position(5, 42);
@Expose
- @ConfigOption(
- name = "Player Position 3",
- desc = "Change the position of this dungeon player."
- )
+ @ConfigOption(name = "Player Position 3", desc = "Change the position of this dungeon player.")
@ConfigEditorButton(runnableId = "d3", buttonText = "Edit")
@ConfigAccordionId(id = 1)
public Position dungeonPlayer3 = new Position(5, 79);
@Expose
- @ConfigOption(
- name = "Player Position 4",
- desc = "Change the position of this dungeon player."
- )
+ @ConfigOption(name = "Player Position 4", desc = "Change the position of this dungeon player.")
@ConfigEditorButton(runnableId = "d4", buttonText = "Edit")
@ConfigAccordionId(id = 1)
public Position dungeonPlayer4 = new Position(5, 116);
@@ -359,10 +271,7 @@ public class SBHConfig extends Config {
public boolean hideArmor = true;
@Expose
- @ConfigOption(
- name = "Hide Animal Hearts",
- desc = "Hides Animal Hearts."
- )
+ @ConfigOption(name = "Hide Animal Hearts", desc = "Hides Animal Hearts.")
@ConfigEditorBoolean
public boolean hideAnimalHearts = true;
}
@@ -386,10 +295,7 @@ public class SBHConfig extends Config {
public boolean showMiniMap = false;
@Expose
- @ConfigOption(
- name = "Mini-Map Position",
- desc = "Allows you to change the position of the Mini-Map."
- )
+ @ConfigOption(name = "Mini-Map Position", desc = "Allows you to change the position of the Mini-Map.")
@ConfigEditorButton(runnableId = "map", buttonText = "Edit")
public Position miniMapPosition = new Position(0, 100, false, false);
@@ -432,18 +338,12 @@ public class SBHConfig extends Config {
public static class Trackers {
@Expose
- @ConfigOption(
- name = "Tracker Position",
- desc = "Allows you to change the position of the Trackers."
- )
+ @ConfigOption(name = "Tracker Position", desc = "Allows you to change the position of the Trackers.")
@ConfigEditorButton(runnableId = "tracker", buttonText = "Edit")
public Position trackerPosition = new Position(-1, 200);
@Expose
- @ConfigOption(
- name = "Hide Tracker",
- desc = "It will still track the data just in case."
- )
+ @ConfigOption(name = "Hide Tracker", desc = "It will still track the data just in case.")
@ConfigEditorBoolean
public boolean hideTracker = false;
}
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/config/SBHConfigEditor.java b/src/main/java/com/thatgravyboat/skyblockhud/config/SBHConfigEditor.java
index 0407607..3bac8ac 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/config/SBHConfigEditor.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/config/SBHConfigEditor.java
@@ -29,10 +29,7 @@ import org.lwjgl.opengl.GL11;
public class SBHConfigEditor extends GuiElement {
- private static final ResourceLocation[] socialsIco = new ResourceLocation[] {
- DISCORD,
- TWITTER
- };
+ private static final ResourceLocation[] socialsIco = new ResourceLocation[] { DISCORD, TWITTER };
private static final String[] socialsLink = new String[] {
"https://discord.gg/moulberry",
"https://twitter.com/thatgravytboat/"
@@ -71,12 +68,7 @@ public class SBHConfigEditor extends GuiElement {
}
if (selectedCategory == null) {
for (Map.Entry<String, ConfigProcessor.ProcessedCategory> category : processedConfig.entrySet()) {
- if (
- category
- .getValue()
- .name.toLowerCase()
- .startsWith(categoryOpen.toLowerCase())
- ) {
+ if (category.getValue().name.toLowerCase().startsWith(categoryOpen.toLowerCase())) {
selectedCategory = category.getKey();
break;
}
@@ -84,12 +76,7 @@ public class SBHConfigEditor extends GuiElement {
}
if (selectedCategory == null) {
for (Map.Entry<String, ConfigProcessor.ProcessedCategory> category : processedConfig.entrySet()) {
- if (
- category
- .getValue()
- .name.toLowerCase()
- .contains(categoryOpen.toLowerCase())
- ) {
+ if (category.getValue().name.toLowerCase().contains(categoryOpen.toLowerCase())) {
selectedCategory = category.getKey();
break;
}
@@ -130,19 +117,11 @@ public class SBHConfigEditor extends GuiElement {
long currentTime = System.currentTimeMillis();
long delta = currentTime - openedMillis;
- ScaledResolution scaledResolution = new ScaledResolution(
- Minecraft.getMinecraft()
- );
+ ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft());
int width = scaledResolution.getScaledWidth();
int height = scaledResolution.getScaledHeight();
- int mouseX =
- Mouse.getX() * width / Minecraft.getMinecraft().displayWidth;
- int mouseY =
- height -
- Mouse.getY() *
- height /
- Minecraft.getMinecraft().displayHeight -
- 1;
+ int mouseX = Mouse.getX() * width / Minecraft.getMinecraft().displayWidth;
+ int mouseY = height - Mouse.getY() * height / Minecraft.getMinecraft().displayHeight - 1;
float opacityFactor = LerpUtils.sigmoidZeroOne(delta / 500f);
RenderUtils.drawGradientRect(
@@ -155,18 +134,8 @@ public class SBHConfigEditor extends GuiElement {
(int) (0x90 * opacityFactor) << 24 | 0x101010
);
- int xSize = Math.min(
- scaledResolution.getScaledWidth() -
- 100 /
- scaledResolution.getScaleFactor(),
- 500
- );
- int ySize = Math.min(
- scaledResolution.getScaledHeight() -
- 100 /
- scaledResolution.getScaleFactor(),
- 400
- );
+ int xSize = Math.min(scaledResolution.getScaledWidth() - 100 / scaledResolution.getScaleFactor(), 500);
+ int ySize = Math.min(scaledResolution.getScaledHeight() - 100 / scaledResolution.getScaleFactor(), 400);
int x = (scaledResolution.getScaledWidth() - xSize) / 2;
int y = (scaledResolution.getScaledHeight() - ySize) / 2;
@@ -215,62 +184,20 @@ public class SBHConfigEditor extends GuiElement {
0xa0a0a0
);
- RenderUtils.drawFloatingRectDark(
- x + 4,
- y + 49 - 20,
- 140,
- ySize - 54 + 20,
- false
- );
+ RenderUtils.drawFloatingRectDark(x + 4, y + 49 - 20, 140, ySize - 54 + 20, false);
int innerPadding = 20 / adjScaleFactor;
int innerLeft = x + 4 + innerPadding;
int innerRight = x + 144 - innerPadding;
int innerTop = y + 49 + innerPadding;
int innerBottom = y + ySize - 5 - innerPadding;
- Gui.drawRect(
- innerLeft,
- innerTop,
- innerLeft + 1,
- innerBottom,
- 0xff08080E
- ); //Left
- Gui.drawRect(
- innerLeft + 1,
- innerTop,
- innerRight,
- innerTop + 1,
- 0xff08080E
- ); //Top
- Gui.drawRect(
- innerRight - 1,
- innerTop + 1,
- innerRight,
- innerBottom,
- 0xff28282E
- ); //Right
- Gui.drawRect(
- innerLeft + 1,
- innerBottom - 1,
- innerRight - 1,
- innerBottom,
- 0xff28282E
- ); //Bottom
- Gui.drawRect(
- innerLeft + 1,
- innerTop + 1,
- innerRight - 1,
- innerBottom - 1,
- 0x6008080E
- ); //Middle
+ Gui.drawRect(innerLeft, innerTop, innerLeft + 1, innerBottom, 0xff08080E); //Left
+ Gui.drawRect(innerLeft + 1, innerTop, innerRight, innerTop + 1, 0xff08080E); //Top
+ Gui.drawRect(innerRight - 1, innerTop + 1, innerRight, innerBottom, 0xff28282E); //Right
+ Gui.drawRect(innerLeft + 1, innerBottom - 1, innerRight - 1, innerBottom, 0xff28282E); //Bottom
+ Gui.drawRect(innerLeft + 1, innerTop + 1, innerRight - 1, innerBottom - 1, 0x6008080E); //Middle
- GlScissorStack.push(
- 0,
- innerTop + 1,
- scaledResolution.getScaledWidth(),
- innerBottom - 1,
- scaledResolution
- );
+ GlScissorStack.push(0, innerTop + 1, scaledResolution.getScaledWidth(), innerBottom - 1, scaledResolution);
float catBarSize = 1;
int catY = -categoryScroll.getValue();
@@ -278,79 +205,47 @@ public class SBHConfigEditor extends GuiElement {
LinkedHashMap<String, ConfigProcessor.ProcessedCategory> currentConfigEditing = getCurrentConfigEditing();
for (Map.Entry<String, ConfigProcessor.ProcessedCategory> entry : currentConfigEditing.entrySet()) {
String selectedCategory = getSelectedCategory();
- if (
- selectedCategory == null ||
- !currentConfigEditing.containsKey(selectedCategory)
- ) {
+ if (selectedCategory == null || !currentConfigEditing.containsKey(selectedCategory)) {
setSelectedCategory(entry.getKey());
}
String catName = entry.getValue().name;
if (entry.getKey().equals(getSelectedCategory())) {
- catName =
- EnumChatFormatting.DARK_AQUA.toString() +
- EnumChatFormatting.UNDERLINE +
- catName;
+ catName = EnumChatFormatting.DARK_AQUA.toString() + EnumChatFormatting.UNDERLINE + catName;
} else {
catName = EnumChatFormatting.GRAY + catName;
}
- TextRenderUtils.drawStringCenteredScaledMaxWidth(
- catName,
- fr,
- x + 75,
- y + 70 + catY,
- false,
- 100,
- -1
- );
+ TextRenderUtils.drawStringCenteredScaledMaxWidth(catName, fr, x + 75, y + 70 + catY, false, 100, -1);
catY += 15;
if (catY > 0) {
catBarSize =
LerpUtils.clampZeroOne(
- (float) (innerBottom - innerTop - 2) /
- (catY + 5 + categoryScroll.getValue())
+ (float) (innerBottom - innerTop - 2) / (catY + 5 + categoryScroll.getValue())
);
}
}
- float catBarStart =
- categoryScroll.getValue() /
- (float) (catY + categoryScroll.getValue());
+ float catBarStart = categoryScroll.getValue() / (float) (catY + categoryScroll.getValue());
float catBarEnd = catBarStart + catBarSize;
if (catBarEnd > 1) {
catBarEnd = 1;
- if (
- categoryScroll.getTarget() /
- (float) (catY + categoryScroll.getValue()) +
- catBarSize <
- 1
- ) {
+ if (categoryScroll.getTarget() / (float) (catY + categoryScroll.getValue()) + catBarSize < 1) {
int target = optionsScroll.getTarget();
categoryScroll.setValue(
(int) Math.ceil(
- (catY + 5 + categoryScroll.getValue()) -
- catBarSize *
- (catY + 5 + categoryScroll.getValue())
+ (catY + 5 + categoryScroll.getValue()) - catBarSize * (catY + 5 + categoryScroll.getValue())
)
);
categoryScroll.setTarget(target);
} else {
categoryScroll.setValue(
(int) Math.ceil(
- (catY + 5 + categoryScroll.getValue()) -
- catBarSize *
- (catY + 5 + categoryScroll.getValue())
+ (catY + 5 + categoryScroll.getValue()) - catBarSize * (catY + 5 + categoryScroll.getValue())
)
);
}
}
int catDist = innerBottom - innerTop - 12;
- Gui.drawRect(
- innerLeft + 2,
- innerTop + 5,
- innerLeft + 7,
- innerBottom - 5,
- 0xff101010
- );
+ Gui.drawRect(innerLeft + 2, innerTop + 5, innerLeft + 7, innerBottom - 5, 0xff101010);
Gui.drawRect(
innerLeft + 3,
innerTop + 6 + (int) (catDist * catBarStart),
@@ -361,23 +256,9 @@ public class SBHConfigEditor extends GuiElement {
GlScissorStack.pop(scaledResolution);
- TextRenderUtils.drawStringCenteredScaledMaxWidth(
- "Categories",
- fr,
- x + 75,
- y + 44,
- false,
- 120,
- 0xa368ef
- );
+ TextRenderUtils.drawStringCenteredScaledMaxWidth("Categories", fr, x + 75, y + 44, false, 120, 0xa368ef);
- RenderUtils.drawFloatingRectDark(
- x + 149,
- y + 29,
- xSize - 154,
- ySize - 34,
- false
- );
+ RenderUtils.drawFloatingRectDark(x + 149, y + 29, xSize - 154, ySize - 34, false);
innerLeft = x + 149 + innerPadding;
innerRight = x + xSize - 5 - innerPadding;
@@ -386,13 +267,8 @@ public class SBHConfigEditor extends GuiElement {
GlStateManager.color(1, 1, 1, 1);
int rightStuffLen = 20;
- if (
- getSelectedCategory() != null &&
- currentConfigEditing.containsKey(getSelectedCategory())
- ) {
- ConfigProcessor.ProcessedCategory cat = currentConfigEditing.get(
- getSelectedCategory()
- );
+ if (getSelectedCategory() != null && currentConfigEditing.containsKey(getSelectedCategory())) {
+ ConfigProcessor.ProcessedCategory cat = currentConfigEditing.get(getSelectedCategory());
TextRenderUtils.drawStringScaledMaxWidth(
cat.desc,
@@ -405,65 +281,21 @@ public class SBHConfigEditor extends GuiElement {
);
}
- Gui.drawRect(
- innerLeft,
- innerTop,
- innerLeft + 1,
- innerBottom,
- 0xff08080E
- ); //Left
- Gui.drawRect(
- innerLeft + 1,
- innerTop,
- innerRight,
- innerTop + 1,
- 0xff08080E
- ); //Top
- Gui.drawRect(
- innerRight - 1,
- innerTop + 1,
- innerRight,
- innerBottom,
- 0xff303036
- ); //Right
- Gui.drawRect(
- innerLeft + 1,
- innerBottom - 1,
- innerRight - 1,
- innerBottom,
- 0xff303036
- ); //Bottom
- Gui.drawRect(
- innerLeft + 1,
- innerTop + 1,
- innerRight - 1,
- innerBottom - 1,
- 0x6008080E
- ); //Middle
+ Gui.drawRect(innerLeft, innerTop, innerLeft + 1, innerBottom, 0xff08080E); //Left
+ Gui.drawRect(innerLeft + 1, innerTop, innerRight, innerTop + 1, 0xff08080E); //Top
+ Gui.drawRect(innerRight - 1, innerTop + 1, innerRight, innerBottom, 0xff303036); //Right
+ Gui.drawRect(innerLeft + 1, innerBottom - 1, innerRight - 1, innerBottom, 0xff303036); //Bottom
+ Gui.drawRect(innerLeft + 1, innerTop + 1, innerRight - 1, innerBottom - 1, 0x6008080E); //Middle
- GlScissorStack.push(
- innerLeft + 1,
- innerTop + 1,
- innerRight - 1,
- innerBottom - 1,
- scaledResolution
- );
+ GlScissorStack.push(innerLeft + 1, innerTop + 1, innerRight - 1, innerBottom - 1, scaledResolution);
float barSize = 1;
int optionY = -optionsScroll.getValue();
- if (
- getSelectedCategory() != null &&
- currentConfigEditing.containsKey(getSelectedCategory())
- ) {
- ConfigProcessor.ProcessedCategory cat = currentConfigEditing.get(
- getSelectedCategory()
- );
+ if (getSelectedCategory() != null && currentConfigEditing.containsKey(getSelectedCategory())) {
+ ConfigProcessor.ProcessedCategory cat = currentConfigEditing.get(getSelectedCategory());
int optionWidthDefault = innerRight - innerLeft - 20;
GlStateManager.enableDepth();
Set<Integer> activeAccordions = new HashSet<>();
- for (ConfigProcessor.ProcessedOption option : getOptionsInCategory(
- cat
- )
- .values()) {
+ for (ConfigProcessor.ProcessedOption option : getOptionsInCategory(cat).values()) {
int optionWidth = optionWidthDefault;
if (option.accordionId >= 0) {
if (!activeAccordions.contains(option.accordionId)) {
@@ -483,15 +315,8 @@ public class SBHConfigEditor extends GuiElement {
}
}
int optionHeight = editor.getHeight();
- if (
- innerTop + 5 + optionY + optionHeight > innerTop + 1 &&
- innerTop + 5 + optionY < innerBottom - 1
- ) {
- editor.render(
- (innerLeft + innerRight - optionWidth) / 2 - 5,
- innerTop + 5 + optionY,
- optionWidth
- );
+ if (innerTop + 5 + optionY + optionHeight > innerTop + 1 && innerTop + 5 + optionY < innerBottom - 1) {
+ editor.render((innerLeft + innerRight - optionWidth) / 2 - 5, innerTop + 5 + optionY, optionWidth);
}
optionY += optionHeight + 5;
}
@@ -499,8 +324,7 @@ public class SBHConfigEditor extends GuiElement {
if (optionY > 0) {
barSize =
LerpUtils.clampZeroOne(
- (float) (innerBottom - innerTop - 2) /
- (optionY + 5 + optionsScroll.getValue())
+ (float) (innerBottom - innerTop - 2) / (optionY + 5 + optionsScroll.getValue())
);
}
}
@@ -508,23 +332,15 @@ public class SBHConfigEditor extends GuiElement {
GlScissorStack.pop(scaledResolution);
GL11.glDisable(GL11.GL_SCISSOR_TEST);
- if (
- getSelectedCategory() != null &&
- currentConfigEditing.containsKey(getSelectedCategory())
- ) {
+ if (getSelectedCategory() != null && currentConfigEditing.containsKey(getSelectedCategory())) {
int optionYOverlay = -optionsScroll.getValue();
- ConfigProcessor.ProcessedCategory cat = currentConfigEditing.get(
- getSelectedCategory()
- );
+ ConfigProcessor.ProcessedCategory cat = currentConfigEditing.get(getSelectedCategory());
int optionWidthDefault = innerRight - innerLeft - 20;
GlStateManager.translate(0, 0, 10);
GlStateManager.enableDepth();
Set<Integer> activeAccordions = new HashSet<>();
- for (ConfigProcessor.ProcessedOption option : getOptionsInCategory(
- cat
- )
- .values()) {
+ for (ConfigProcessor.ProcessedOption option : getOptionsInCategory(cat).values()) {
int optionWidth = optionWidthDefault;
if (option.accordionId >= 0) {
if (!activeAccordions.contains(option.accordionId)) {
@@ -545,12 +361,7 @@ public class SBHConfigEditor extends GuiElement {
}
int optionHeight = editor.getHeight();
if (
- innerTop +
- 5 +
- optionYOverlay +
- optionHeight >
- innerTop +
- 1 &&
+ innerTop + 5 + optionYOverlay + optionHeight > innerTop + 1 &&
innerTop + 5 + optionYOverlay < innerBottom - 1
) {
editor.renderOverlay(
@@ -566,45 +377,28 @@ public class SBHConfigEditor extends GuiElement {
}
GL11.glEnable(GL11.GL_SCISSOR_TEST);
- float barStart =
- optionsScroll.getValue() /
- (float) (optionY + optionsScroll.getValue());
+ float barStart = optionsScroll.getValue() / (float) (optionY + optionsScroll.getValue());
float barEnd = barStart + barSize;
if (barEnd > 1) {
barEnd = 1;
- if (
- optionsScroll.getTarget() /
- (float) (optionY + optionsScroll.getValue()) +
- barSize <
- 1
- ) {
+ if (optionsScroll.getTarget() / (float) (optionY + optionsScroll.getValue()) + barSize < 1) {
int target = optionsScroll.getTarget();
optionsScroll.setValue(
(int) Math.ceil(
- (optionY + 5 + optionsScroll.getValue()) -
- barSize *
- (optionY + 5 + optionsScroll.getValue())
+ (optionY + 5 + optionsScroll.getValue()) - barSize * (optionY + 5 + optionsScroll.getValue())
)
);
optionsScroll.setTarget(target);
} else {
optionsScroll.setValue(
(int) Math.ceil(
- (optionY + 5 + optionsScroll.getValue()) -
- barSize *
- (optionY + 5 + optionsScroll.getValue())
+ (optionY + 5 + optionsScroll.getValue()) - barSize * (optionY + 5 + optionsScroll.getValue())
)
);
}
}
int dist = innerBottom - innerTop - 12;
- Gui.drawRect(
- innerRight - 10,
- innerTop + 5,
- innerRight - 5,
- innerBottom - 5,
- 0xff101010
- );
+ Gui.drawRect(innerRight - 10, innerTop + 5, innerRight - 5, innerBottom - 5, 0xff101010);
Gui.drawRect(
innerRight - 9,
innerTop + 6 + (int) (dist * barStart),
@@ -613,37 +407,16 @@ public class SBHConfigEditor extends GuiElement {
0xff303030
);
- for (
- int socialIndex = 0;
- socialIndex < socialsIco.length;
- socialIndex++
- ) {
- Minecraft
- .getMinecraft()
- .getTextureManager()
- .bindTexture(socialsIco[socialIndex]);
+ for (int socialIndex = 0; socialIndex < socialsIco.length; socialIndex++) {
+ Minecraft.getMinecraft().getTextureManager().bindTexture(socialsIco[socialIndex]);
GlStateManager.color(1, 1, 1, 1);
int socialLeft = x + xSize - 23 - 18 * socialIndex;
- RenderUtils.drawTexturedRect(
- socialLeft,
- y + 7,
- 16,
- 16,
- GL11.GL_LINEAR
- );
+ RenderUtils.drawTexturedRect(socialLeft, y + 7, 16, 16, GL11.GL_LINEAR);
- if (
- mouseX >= socialLeft &&
- mouseX <= socialLeft + 16 &&
- mouseY >= y + 6 &&
- mouseY <= y + 23
- ) {
+ if (mouseX >= socialLeft && mouseX <= socialLeft + 16 && mouseY >= y + 6 && mouseY <= y + 23) {
tooltipToDisplay =
Lists.newArrayList(
- EnumChatFormatting.YELLOW +
- "Go to: " +
- EnumChatFormatting.RESET +
- socialsLink[socialIndex]
+ EnumChatFormatting.YELLOW + "Go to: " + EnumChatFormatting.RESET + socialsLink[socialIndex]
);
}
}
@@ -651,35 +424,19 @@ public class SBHConfigEditor extends GuiElement {
GlScissorStack.clear();
if (tooltipToDisplay != null) {
- TextRenderUtils.drawHoveringText(
- tooltipToDisplay,
- mouseX,
- mouseY,
- width,
- height,
- -1,
- fr
- );
+ TextRenderUtils.drawHoveringText(tooltipToDisplay, mouseX, mouseY, width, height, -1, fr);
}
GlStateManager.translate(0, 0, -2);
}
public boolean mouseInput(int mouseX, int mouseY) {
- ScaledResolution scaledResolution = new ScaledResolution(
- Minecraft.getMinecraft()
- );
+ ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft());
int width = scaledResolution.getScaledWidth();
int height = scaledResolution.getScaledHeight();
- int xSize = Math.min(
- width - 100 / scaledResolution.getScaleFactor(),
- 500
- );
- int ySize = Math.min(
- height - 100 / scaledResolution.getScaleFactor(),
- 400
- );
+ int xSize = Math.min(width - 100 / scaledResolution.getScaleFactor(), 500);
+ int ySize = Math.min(height - 100 / scaledResolution.getScaleFactor(), 400);
int x = (scaledResolution.getScaledWidth() - xSize) / 2;
int y = (scaledResolution.getScaledHeight() - ySize) / 2;
@@ -717,16 +474,11 @@ public class SBHConfigEditor extends GuiElement {
catY += 15;
if (catY > 0) {
catBarSize =
- LerpUtils.clampZeroOne(
- (float) (innerBottom - innerTop - 2) /
- (catY + 5 + newTarget)
- );
+ LerpUtils.clampZeroOne((float) (innerBottom - innerTop - 2) / (catY + 5 + newTarget));
}
}
- int barMax = (int) Math.floor(
- (catY + 5 + newTarget) - catBarSize * (catY + 5 + newTarget)
- );
+ int barMax = (int) Math.floor((catY + 5 + newTarget) - catBarSize * (catY + 5 + newTarget));
if (newTarget > barMax) {
newTarget = barMax;
}
@@ -745,17 +497,11 @@ public class SBHConfigEditor extends GuiElement {
getCurrentConfigEditing() != null &&
getCurrentConfigEditing().containsKey(getSelectedCategory())
) {
- ConfigProcessor.ProcessedCategory cat = getCurrentConfigEditing()
- .get(getSelectedCategory());
+ ConfigProcessor.ProcessedCategory cat = getCurrentConfigEditing().get(getSelectedCategory());
Set<Integer> activeAccordions = new HashSet<>();
- for (ConfigProcessor.ProcessedOption option : getOptionsInCategory(
- cat
- )
- .values()) {
+ for (ConfigProcessor.ProcessedOption option : getOptionsInCategory(cat).values()) {
if (option.accordionId >= 0) {
- if (
- !activeAccordions.contains(option.accordionId)
- ) {
+ if (!activeAccordions.contains(option.accordionId)) {
continue;
}
}
@@ -767,9 +513,7 @@ public class SBHConfigEditor extends GuiElement {
if (editor instanceof GuiOptionEditorAccordion) {
GuiOptionEditorAccordion accordion = (GuiOptionEditorAccordion) editor;
if (accordion.getToggled()) {
- activeAccordions.add(
- accordion.getAccordionId()
- );
+ activeAccordions.add(accordion.getAccordionId());
}
}
optionY += editor.getHeight() + 5;
@@ -777,29 +521,18 @@ public class SBHConfigEditor extends GuiElement {
if (optionY > 0) {
barSize =
LerpUtils.clampZeroOne(
- (float) (innerBottom - innerTop - 2) /
- (optionY + 5 + newTarget)
+ (float) (innerBottom - innerTop - 2) / (optionY + 5 + newTarget)
);
}
}
}
- int barMax = (int) Math.floor(
- (optionY + 5 + newTarget) -
- barSize *
- (optionY + 5 + newTarget)
- );
+ int barMax = (int) Math.floor((optionY + 5 + newTarget) - barSize * (optionY + 5 + newTarget));
if (newTarget > barMax) {
newTarget = barMax;
}
optionsScroll.setTimeToReachTarget(
- Math.min(
- 150,
- Math.max(
- 10,
- 5 * Math.abs(newTarget - optionsScroll.getValue())
- )
- )
+ Math.min(150, Math.max(10, 5 * Math.abs(newTarget - optionsScroll.getValue())))
);
optionsScroll.resetTimer();
optionsScroll.setTarget(newTarget);
@@ -825,23 +558,12 @@ public class SBHConfigEditor extends GuiElement {
}
}
- for (
- int socialIndex = 0;
- socialIndex < socialsLink.length;
- socialIndex++
- ) {
+ for (int socialIndex = 0; socialIndex < socialsLink.length; socialIndex++) {
int socialLeft = x + xSize - 23 - 18 * socialIndex;
- if (
- mouseX >= socialLeft &&
- mouseX <= socialLeft + 16 &&
- mouseY >= y + 6 &&
- mouseY <= y + 23
- ) {
+ if (mouseX >= socialLeft && mouseX <= socialLeft + 16 && mouseY >= y + 6 && mouseY <= y + 23) {
try {
- Desktop
- .getDesktop()
- .browse(new URI(socialsLink[socialIndex]));
+ Desktop.getDesktop().browse(new URI(socialsLink[socialIndex]));
} catch (Exception ignored) {}
return true;
}
@@ -855,13 +577,9 @@ public class SBHConfigEditor extends GuiElement {
getCurrentConfigEditing().containsKey(getSelectedCategory())
) {
int optionWidthDefault = innerRight - innerLeft - 20;
- ConfigProcessor.ProcessedCategory cat = getCurrentConfigEditing()
- .get(getSelectedCategory());
+ ConfigProcessor.ProcessedCategory cat = getCurrentConfigEditing().get(getSelectedCategory());
Set<Integer> activeAccordions = new HashSet<>();
- for (ConfigProcessor.ProcessedOption option : getOptionsInCategory(
- cat
- )
- .values()) {
+ for (ConfigProcessor.ProcessedOption option : getOptionsInCategory(cat).values()) {
int optionWidth = optionWidthDefault;
if (option.accordionId >= 0) {
if (!activeAccordions.contains(option.accordionId)) {
@@ -895,12 +613,7 @@ public class SBHConfigEditor extends GuiElement {
}
}
- if (
- mouseX > innerLeft &&
- mouseX < innerRight &&
- mouseY > innerTop &&
- mouseY < innerBottom
- ) {
+ if (mouseX > innerLeft && mouseX < innerRight && mouseY > innerTop && mouseY < innerBottom) {
optionY = -optionsScroll.getValue();
if (
getSelectedCategory() != null &&
@@ -908,13 +621,9 @@ public class SBHConfigEditor extends GuiElement {
getCurrentConfigEditing().containsKey(getSelectedCategory())
) {
int optionWidthDefault = innerRight - innerLeft - 20;
- ConfigProcessor.ProcessedCategory cat = getCurrentConfigEditing()
- .get(getSelectedCategory());
+ ConfigProcessor.ProcessedCategory cat = getCurrentConfigEditing().get(getSelectedCategory());
Set<Integer> activeAccordions = new HashSet<>();
- for (ConfigProcessor.ProcessedOption option : getOptionsInCategory(
- cat
- )
- .values()) {
+ for (ConfigProcessor.ProcessedOption option : getOptionsInCategory(cat).values()) {
int optionWidth = optionWidthDefault;
if (option.accordionId >= 0) {
if (!activeAccordions.contains(option.accordionId)) {
@@ -953,15 +662,10 @@ public class SBHConfigEditor extends GuiElement {
}
public boolean keyboardInput() {
- ScaledResolution scaledResolution = new ScaledResolution(
- Minecraft.getMinecraft()
- );
+ ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft());
int width = scaledResolution.getScaledWidth();
- int xSize = Math.min(
- width - 100 / scaledResolution.getScaleFactor(),
- 500
- );
+ int xSize = Math.min(width - 100 / scaledResolution.getScaleFactor(), 500);
int adjScaleFactor = Math.max(2, scaledResolution.getScaleFactor());
@@ -973,13 +677,9 @@ public class SBHConfigEditor extends GuiElement {
getCurrentConfigEditing() != null &&
getCurrentConfigEditing().containsKey(getSelectedCategory())
) {
- ConfigProcessor.ProcessedCategory cat = getCurrentConfigEditing()
- .get(getSelectedCategory());
+ ConfigProcessor.ProcessedCategory cat = getCurrentConfigEditing().get(getSelectedCategory());
Set<Integer> activeAccordions = new HashSet<>();
- for (ConfigProcessor.ProcessedOption option : getOptionsInCategory(
- cat
- )
- .values()) {
+ for (ConfigProcessor.ProcessedOption option : getOptionsInCategory(cat).values()) {
if (option.accordionId >= 0) {
if (!activeAccordions.contains(option.accordionId)) {
continue;