diff options
author | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-04-27 15:02:15 +0200 |
---|---|---|
committer | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-04-27 15:02:15 +0200 |
commit | a93ec306e83f51e121441cb00f04cd9bb36d6951 (patch) | |
tree | dfed34f8b89700276386ee941a76277e7ea26404 /src/main/java/io/polyfrost/oneconfig/gui/pages/ModsPage.java | |
parent | 32e80596448ca536335638a63b1c7eccb8a12e95 (diff) | |
download | OneConfig-a93ec306e83f51e121441cb00f04cd9bb36d6951.tar.gz OneConfig-a93ec306e83f51e121441cb00f04cd9bb36d6951.tar.bz2 OneConfig-a93ec306e83f51e121441cb00f04cd9bb36d6951.zip |
Some more config refinements and some gui improvements
Diffstat (limited to 'src/main/java/io/polyfrost/oneconfig/gui/pages/ModsPage.java')
-rw-r--r-- | src/main/java/io/polyfrost/oneconfig/gui/pages/ModsPage.java | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/src/main/java/io/polyfrost/oneconfig/gui/pages/ModsPage.java b/src/main/java/io/polyfrost/oneconfig/gui/pages/ModsPage.java index b45facb..7834e0b 100644 --- a/src/main/java/io/polyfrost/oneconfig/gui/pages/ModsPage.java +++ b/src/main/java/io/polyfrost/oneconfig/gui/pages/ModsPage.java @@ -28,13 +28,13 @@ public class ModsPage extends Page { modCards.add(0, card); } } - modCategories.add(new BasicButton(64, 32, "All", null, null, 0, BasicButton.ALIGNMENT_CENTER, true)); - modCategories.add(new BasicButton(80, 32, "Combat", null, null, 0, BasicButton.ALIGNMENT_CENTER, true)); - modCategories.add(new BasicButton(64, 32, "HUD", null, null, 0, BasicButton.ALIGNMENT_CENTER, true)); - modCategories.add(new BasicButton(104, 32, "Utility & QoL", null, null, 0, BasicButton.ALIGNMENT_CENTER, true)); - modCategories.add(new BasicButton(80, 32, "Hypixel", null, null, 0, BasicButton.ALIGNMENT_CENTER, true)); - modCategories.add(new BasicButton(80, 32, "Skyblock", null, null, 0, BasicButton.ALIGNMENT_CENTER, true)); - modCategories.add(new BasicButton(88, 32, "3rd Party", null, null, 0, BasicButton.ALIGNMENT_CENTER, true)); + modCategories.add(new BasicButton(64, 32, "All", null, null, 0, BasicButton.ALIGNMENT_CENTER, true, () -> unselect(0))); + modCategories.add(new BasicButton(80, 32, "Combat", null, null, 0, BasicButton.ALIGNMENT_CENTER, true, () -> unselect(1))); + modCategories.add(new BasicButton(64, 32, "HUD", null, null, 0, BasicButton.ALIGNMENT_CENTER, true, () -> unselect(2))); + modCategories.add(new BasicButton(104, 32, "Utility & QoL", null, null, 0, BasicButton.ALIGNMENT_CENTER, true, () -> unselect(3))); + modCategories.add(new BasicButton(80, 32, "Hypixel", null, null, 0, BasicButton.ALIGNMENT_CENTER, true, () -> unselect(4))); + modCategories.add(new BasicButton(80, 32, "Skyblock", null, null, 0, BasicButton.ALIGNMENT_CENTER, true, () -> unselect(5))); + modCategories.add(new BasicButton(88, 32, "3rd Party", null, null, 0, BasicButton.ALIGNMENT_CENTER, true, () -> unselect(6))); modCategories.get(0).setToggled(true); } @@ -44,20 +44,6 @@ public class ModsPage extends Page { btn.draw(vg, iXCat, y + 16); iXCat += btn.getWidth() + 8; } - if ((modCategories.get(1).isClicked() || modCategories.get(2).isClicked() || modCategories.get(3).isClicked() || modCategories.get(4).isClicked() || modCategories.get(5).isClicked() || modCategories.get(6).isClicked()) && modCategories.get(0).isToggled()) { - modCategories.get(0).setToggled(false); - } - if (!modCategories.get(0).isToggled() && !modCategories.get(1).isToggled() && !modCategories.get(2).isToggled() && !modCategories.get(3).isToggled() && !modCategories.get(4).isToggled() && !modCategories.get(5).isToggled() && !modCategories.get(6).isToggled()) { - modCategories.get(0).setToggled(true); - } - if (modCategories.get(0).isToggled()) { - for (BasicButton btn : modCategories) { - if (!btn.getText().equals("All")) { - btn.setToggled(false); - } - } - } - int iX = x + 16; int iY = y + 72; @@ -74,7 +60,12 @@ public class ModsPage extends Page { if (iX == x + 16 && iY == y + 72) { RenderManager.drawString(vg, "Looks like there is nothing here. Try another category?", x + 16, y + 72, OneConfigConfig.WHITE_60, 14f, Fonts.INTER_MEDIUM); } - } + private void unselect(int index) { + for (int i = 0; i < modCategories.size(); i++) { + if (index == i) continue; + modCategories.get(i).setToggled(false); + } + } } |