diff options
author | nextdaydelivery <79922345+nxtdaydelivery@users.noreply.github.com> | 2022-05-09 18:41:19 +0100 |
---|---|---|
committer | nextdaydelivery <79922345+nxtdaydelivery@users.noreply.github.com> | 2022-05-09 18:41:19 +0100 |
commit | 20cf8146e88f3ca06399fdf163badef759f01d2c (patch) | |
tree | d35d06a2049171673d803ab284f413de511ff938 /src/main | |
parent | f759dbc9f9582739cc693a18e128b0e37a3047d2 (diff) | |
parent | ee4c67da5f18ea3731383259389ac9609b2de3bd (diff) | |
download | OneConfig-20cf8146e88f3ca06399fdf163badef759f01d2c.tar.gz OneConfig-20cf8146e88f3ca06399fdf163badef759f01d2c.tar.bz2 OneConfig-20cf8146e88f3ca06399fdf163badef759f01d2c.zip |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java | 2 | ||||
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/gui/pages/ModsPage.java | 8 |
2 files changed, 2 insertions, 8 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java index 9e6d526..48a6218 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java @@ -38,7 +38,7 @@ public class ModCard extends BasicElement { toggled = active; this.disabled = disabled; this.favorite = favorite; - favoriteHitbox.setToggled(true); + favoriteHitbox.setToggled(favorite); toggled = active; } diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModsPage.java b/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModsPage.java index 3cb00ec..47068cf 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModsPage.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModsPage.java @@ -22,13 +22,7 @@ public class ModsPage extends Page { public ModsPage() { super("Mods"); for (Mod modData : OneConfig.loadedMods) { - modCards.add(new ModCard(modData, null, modData.config == null || modData.config.enabled, false, OneConfigConfig.favoriteMods.contains(modData.name))); - } - for (ModCard card : modCards) { - if (card.isFavorite()) { - modCards.remove(card); - modCards.add(0, card); - } + modCards.add(OneConfigConfig.favoriteMods.contains(modData.name) ? 0 : modCards.size(), new ModCard(modData, null, modData.config == null || modData.config.enabled, false, OneConfigConfig.favoriteMods.contains(modData.name))); } 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))); |