aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModConfigPage.java
diff options
context:
space:
mode:
authorWyvest <45589059+Wyvest@users.noreply.github.com>2022-06-12 17:21:36 +0700
committerWyvest <45589059+Wyvest@users.noreply.github.com>2022-06-12 17:21:36 +0700
commit636df2c2b3b8e4aa0de64cf3b9aa5c089afd70a9 (patch)
tree521d8bc2f6e6f307f62e12a3deb7a05f0f72213e /src/main/java/cc/polyfrost/oneconfig/gui/pages/ModConfigPage.java
parentda5288bd5c80611acfeb1ebe33af1860f27f23fc (diff)
parentcf8b1a7f962ad3a9c31e6698fb7caf82aac42a18 (diff)
downloadOneConfig-636df2c2b3b8e4aa0de64cf3b9aa5c089afd70a9.tar.gz
OneConfig-636df2c2b3b8e4aa0de64cf3b9aa5c089afd70a9.tar.bz2
OneConfig-636df2c2b3b8e4aa0de64cf3b9aa5c089afd70a9.zip
Merge remote-tracking branch 'origin/master'
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.java16
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;
+ }
}