aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/gui/elements/config
diff options
context:
space:
mode:
authornextdaydelivery <79922345+nxtdaydelivery@users.noreply.github.com>2022-06-11 12:52:33 +0100
committernextdaydelivery <79922345+nxtdaydelivery@users.noreply.github.com>2022-06-11 12:52:33 +0100
commitc0b24f80a50d1c5968bbda16a555e9aa94707112 (patch)
tree2c761abd0142fa1520e60b571cdd5e6f0b2c1b0c /src/main/java/cc/polyfrost/oneconfig/gui/elements/config
parent6239cf215a789a21e702cb793706ca0fa5a4bcca (diff)
downloadOneConfig-c0b24f80a50d1c5968bbda16a555e9aa94707112.tar.gz
OneConfig-c0b24f80a50d1c5968bbda16a555e9aa94707112.tar.bz2
OneConfig-c0b24f80a50d1c5968bbda16a555e9aa94707112.zip
color selector avec no alpha
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/gui/elements/config')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigColorElement.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigColorElement.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigColorElement.java
index 5cd9c83..581babd 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigColorElement.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigColorElement.java
@@ -20,12 +20,14 @@ public class ConfigColorElement extends BasicOption {
private final TextInputField alphaField = new TextInputField(72, 32, "", false, false);
private final BasicElement element = new BasicElement(64, 32, false);
private boolean open = false;
+ private final boolean isAlphaAllowed;
public ConfigColorElement(Field field, Object parent, String name, String category, String subcategory, int size) {
super(field, parent, name, category, subcategory, size);
hexField.setCentered(true);
alphaField.setCentered(true);
alphaField.onlyAcceptNumbers(true);
+ isAlphaAllowed = true;
}
public static ConfigColorElement create(Field field, Object parent) {
@@ -37,7 +39,7 @@ public class ConfigColorElement extends BasicOption {
public void draw(long vg, int x, int y) {
if (!isEnabled()) RenderManager.setAlpha(vg, 0.5f);
hexField.disable(!isEnabled());
- alphaField.disable(!isEnabled());
+ alphaField.disable(!isEnabled() || isAlphaAllowed);
element.disable(!isEnabled());
int x1 = size == 1 ? x : x + 512;