aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/gui/elements
diff options
context:
space:
mode:
authorDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-06-05 11:49:34 +0200
committerDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-06-05 11:49:34 +0200
commit232cda5d0bab37e948c8ac31a437cf148d55832d (patch)
tree9a8e562c5bc7cbffb8aab163a849a6b42cc72629 /src/main/java/cc/polyfrost/oneconfig/gui/elements
parent17826161c67f6adf5976d7993ac0a229193e2eb6 (diff)
downloadOneConfig-232cda5d0bab37e948c8ac31a437cf148d55832d.tar.gz
OneConfig-232cda5d0bab37e948c8ac31a437cf148d55832d.tar.bz2
OneConfig-232cda5d0bab37e948c8ac31a437cf148d55832d.zip
very smol changes
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/gui/elements')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicButton.java12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicButton.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicButton.java
index a55d931..36acffa 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicButton.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicButton.java
@@ -1,5 +1,6 @@
package cc.polyfrost.oneconfig.gui.elements;
+import cc.polyfrost.oneconfig.config.OneConfigConfig;
import cc.polyfrost.oneconfig.gui.OneConfigGui;
import cc.polyfrost.oneconfig.gui.pages.Page;
import cc.polyfrost.oneconfig.lwjgl.RenderManager;
@@ -15,7 +16,6 @@ public class BasicButton extends BasicElement {
protected SVGs icon1, icon2;
private final int alignment;
private final float fontSize, cornerRadius;
- private float alpha;
private final int xSpacing, xPadding;
private final int iconSize;
public int x, y;
@@ -63,12 +63,12 @@ public class BasicButton extends BasicElement {
this.update(x, y);
if (disabled) RenderManager.setAlpha(vg, 0.5f);
float contentWidth = 0f;
- int color = -1;
+ int color;
if (colorPalette == ColorPalette.TERTIARY || colorPalette == ColorPalette.TERTIARY_DESTRUCTIVE) {
color = currentColor;
} else {
RenderManager.drawRoundedRect(vg, x, y, this.width, this.height, currentColor, this.cornerRadius);
- color = ColorUtils.getColor(1f, 1f, 1f, alpha);
+ color = ColorUtils.setAlpha(OneConfigConfig.WHITE, (int) (colorAnimation.getAlpha() * 255));
}
final float middle = x + width / 2f;
final float middleYIcon = y + height / 2f - iconSize / 2f;
@@ -114,12 +114,6 @@ public class BasicButton extends BasicElement {
}
@Override
- public void update(int x, int y) {
- super.update(x, y);
- this.alpha = colorAnimation.getAlpha();
- }
-
- @Override
public void onClick() {
if (this.page != null && OneConfigGui.INSTANCE != null) {
OneConfigGui.INSTANCE.openPage(page);