diff options
author | nextdaydelivery <79922345+nxtdaydelivery@users.noreply.github.com> | 2022-07-25 13:01:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-25 13:01:16 +0100 |
commit | 8a01f36d1021159f2c49ae8083febc046a4a8502 (patch) | |
tree | ab79fa993952543131fb3b3f9fddc645c1456d1a /src/main/java/cc/polyfrost/oneconfig/gui | |
parent | 2159b8d6cc7e0de418062fecb8e57244184e8820 (diff) | |
download | OneConfig-8a01f36d1021159f2c49ae8083febc046a4a8502.tar.gz OneConfig-8a01f36d1021159f2c49ae8083febc046a4a8502.tar.bz2 OneConfig-8a01f36d1021159f2c49ae8083febc046a4a8502.zip |
page button changes (#71)
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/gui')
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigPageButton.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigPageButton.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigPageButton.java index ece2888..60fc8fd 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigPageButton.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigPageButton.java @@ -1,5 +1,6 @@ package cc.polyfrost.oneconfig.gui.elements.config; +import cc.polyfrost.oneconfig.gui.pages.Page; import cc.polyfrost.oneconfig.internal.assets.Colors; import cc.polyfrost.oneconfig.config.elements.OptionPage; import cc.polyfrost.oneconfig.config.elements.BasicOption; @@ -16,13 +17,19 @@ import cc.polyfrost.oneconfig.utils.color.ColorPalette; import java.lang.reflect.Field; public class ConfigPageButton extends BasicOption { - public final OptionPage page; + public final Page page; public final String description; private final ColorAnimation backgroundColor = new ColorAnimation(ColorPalette.SECONDARY); public ConfigPageButton(Field field, Object parent, String name, String description, String category, String subcategory, OptionPage page) { super(field, parent, name, category, subcategory, 2); this.description = description; + this.page = new ModConfigPage(page); + } + + public ConfigPageButton(Field field, Object parent, String name, String description, String category, String subcategory, Page page) { + super(field, parent, name, category, subcategory, 2); + this.description = description; this.page = page; } @@ -40,7 +47,7 @@ public class ConfigPageButton extends BasicOption { RenderManager.drawText(vg, name, x + 10, y + 70, Colors.WHITE_90, 14, Fonts.MEDIUM); RenderManager.drawSvg(vg, SVGs.CARET_RIGHT, x + 981f, y + (description.equals("") ? 20f : 36f), 13, 22); - if (clicked) OneConfigGui.INSTANCE.openPage(new ModConfigPage(page)); + if (clicked) OneConfigGui.INSTANCE.openPage(page); RenderManager.setAlpha(vg, 1f); } |