diff options
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/gui/pages/ModConfigPage.java')
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/gui/pages/ModConfigPage.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModConfigPage.java b/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModConfigPage.java index 3e8fbf8..fb04dc2 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModConfigPage.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModConfigPage.java @@ -3,6 +3,7 @@ package cc.polyfrost.oneconfig.gui.pages; import cc.polyfrost.oneconfig.config.elements.OptionPage; import cc.polyfrost.oneconfig.config.elements.OptionSubcategory; import cc.polyfrost.oneconfig.config.elements.BasicOption; +import cc.polyfrost.oneconfig.gui.animations.DummyAnimation; import cc.polyfrost.oneconfig.gui.elements.BasicButton; import cc.polyfrost.oneconfig.renderer.RenderManager; import cc.polyfrost.oneconfig.renderer.font.Fonts; @@ -17,10 +18,12 @@ public class ModConfigPage extends Page { private final ArrayList<BasicButton> categories = new ArrayList<>(); private String selectedCategory; private int totalSize = 724; + private final boolean base; - public ModConfigPage(OptionPage page) { + public ModConfigPage(OptionPage page, boolean base) { super(page.name); this.page = page; + this.base = base; if (page.categories.size() == 0) return; for (String category : page.categories.keySet()) { selectedCategory = category; @@ -36,6 +39,10 @@ public class ModConfigPage extends Page { } } + public ModConfigPage(OptionPage page) { + this(page, false); + } + @Override public void draw(long vg, int x, int y) { if (page.categories.size() == 0) return; @@ -84,6 +91,8 @@ public class ModConfigPage extends Page { for (BasicButton button : categories) { if (button.getText().equals(newCategory)) continue; button.setToggled(false); + scrollTarget = 0; + scrollAnimation = null; } } @@ -91,4 +100,9 @@ public class ModConfigPage extends Page { public int getMaxScrollHeight() { return totalSize; } + + @Override + public boolean isBase() { + return base; + } } |