aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/io/polyfrost/oneconfig/config/OneConfigConfig.java3
-rw-r--r--src/main/java/io/polyfrost/oneconfig/config/annotations/Option.java18
-rw-r--r--src/main/java/io/polyfrost/oneconfig/config/interfaces/Config.java5
-rw-r--r--src/main/java/io/polyfrost/oneconfig/gui/OneConfigGui.java1
-rw-r--r--src/main/java/io/polyfrost/oneconfig/gui/elements/TextInputField.java58
-rw-r--r--src/main/java/io/polyfrost/oneconfig/gui/elements/config/ConfigDualOption.java6
-rw-r--r--src/main/java/io/polyfrost/oneconfig/gui/elements/config/ConfigSlider.java178
-rw-r--r--src/main/java/io/polyfrost/oneconfig/test/TestConfig.java14
-rw-r--r--src/main/java/io/polyfrost/oneconfig/utils/ColorUtils.java3
-rw-r--r--src/main/resources/assets/oneconfig/icons/TestIcon.svg4
-rw-r--r--src/main/resources/assets/oneconfig/textures/pc.svg1
-rw-r--r--src/main/resources/assets/oneconfig/textures/smallUpArrow.pngbin0 -> 162 bytes
12 files changed, 260 insertions, 31 deletions
diff --git a/src/main/java/io/polyfrost/oneconfig/config/OneConfigConfig.java b/src/main/java/io/polyfrost/oneconfig/config/OneConfigConfig.java
index d812f89..da6b4c2 100644
--- a/src/main/java/io/polyfrost/oneconfig/config/OneConfigConfig.java
+++ b/src/main/java/io/polyfrost/oneconfig/config/OneConfigConfig.java
@@ -19,7 +19,6 @@ public class OneConfigConfig extends Config {
public static final int GRAY_900 = new Color(13, 14, 15, 255).getRGB(); // Gray 900
public static final int GRAY_900_80 = new Color(13, 14, 15, 204).getRGB(); // Gray 900 80%
- // im waiting for u to say the gray button colors
public static final int GRAY_800 = new Color(21, 22, 23, 255).getRGB(); // Gray 800
public static final int GRAY_700 = new Color(34, 35, 38, 255).getRGB(); // Gray 700
public static final int GRAY_600 = new Color(42, 44, 48, 255).getRGB(); // Gray 600
@@ -42,6 +41,8 @@ public class OneConfigConfig extends Config {
public static final int WHITE_90 = new Color(255, 255, 255, 229).getRGB(); // White 90%
public static final int WHITE = new Color(255, 255, 255, 255).getRGB(); // White 100%
+ public static final int ERROR_700 = new Color(180, 24, 24, 255).getRGB(); // Red 700
+
public static boolean ROUNDED_CORNERS = true;
public static float CORNER_RADIUS_WIN = 20f;
public static float CORNER_RADIUS = 12f;
diff --git a/src/main/java/io/polyfrost/oneconfig/config/annotations/Option.java b/src/main/java/io/polyfrost/oneconfig/config/annotations/Option.java
index 7a0b6c1..a4f4a67 100644
--- a/src/main/java/io/polyfrost/oneconfig/config/annotations/Option.java
+++ b/src/main/java/io/polyfrost/oneconfig/config/annotations/Option.java
@@ -31,13 +31,11 @@ public @interface Option {
*/
String subcategory();
- /** The name shown on the Left option of a DualOption slider. */
- String optionLeft() default "Option 1";
- /** The name shown on the Right option of a DualOption slider. */
- String optionRight() default "Option 2";
-
- /** A String array of all the possible values for the UniSelector, dropdownList, and ComboBox */
+ /** A String array of all the possible values for the UniSelector, dropdownList, and ComboBox.
+ * Also used in the DualOption slider, index 0 is the left, index 1 is the right; for example:
+ * {"Option 1", "Option 2"}
+ * */
String[] options() default {};
/**
@@ -64,6 +62,14 @@ public @interface Option {
* Steps of slider (0 for no steps)
*/
int step() default 0;
+ /**
+ * Minimum value of slider
+ */
+ float min() default 0;
+ /**
+ * The maximum value of the slider
+ */
+ float max() default 0;
/**
* Option for info option type
diff --git a/src/main/java/io/polyfrost/oneconfig/config/interfaces/Config.java b/src/main/java/io/polyfrost/oneconfig/config/interfaces/Config.java
index 8ed51f8..ca151db 100644
--- a/src/main/java/io/polyfrost/oneconfig/config/interfaces/Config.java
+++ b/src/main/java/io/polyfrost/oneconfig/config/interfaces/Config.java
@@ -115,7 +115,7 @@ public class Config {
options.add(new ConfigTextBox(field, option.name(), option.size(), option.placeholder(), option.secure(), option.multiLine()));
break;
case DUAL_OPTION:
- options.add(new ConfigDualOption(field, option.name(), option.size(), option.optionLeft(), option.optionRight()));
+ options.add(new ConfigDualOption(field, option.name(), option.size(), option.options()));
break;
case UNI_SELECTOR:
options.add(new ConfigUniSelector(field, option.name(), option.size(), option.options()));
@@ -123,6 +123,9 @@ public class Config {
case DROPDOWN:
options.add(new ConfigDropdown(field, option.name(), option.size(), option.options()));
break;
+ case SLIDER:
+ options.add(new ConfigSlider(field, option.name(), option.size(), option.min(), option.max(), option.step()));
+ break;
}
}
}
diff --git a/src/main/java/io/polyfrost/oneconfig/gui/OneConfigGui.java b/src/main/java/io/polyfrost/oneconfig/gui/OneConfigGui.java
index 1f7da18..130df7f 100644
--- a/src/main/java/io/polyfrost/oneconfig/gui/OneConfigGui.java
+++ b/src/main/java/io/polyfrost/oneconfig/gui/OneConfigGui.java
@@ -97,6 +97,7 @@ public class OneConfigGui extends GuiScreen {
}
public void openPage(@NotNull Page page) {
+ if(page == currentPage) return;
currentPage.finishUpAndClose();
if (prevPage == null) {
prevPage = currentPage;
diff --git a/src/main/java/io/polyfrost/oneconfig/gui/elements/TextInputField.java b/src/main/java/io/polyfrost/oneconfig/gui/elements/TextInputField.java
index 8f7f77c..081c99b 100644
--- a/src/main/java/io/polyfrost/oneconfig/gui/elements/TextInputField.java
+++ b/src/main/java/io/polyfrost/oneconfig/gui/elements/TextInputField.java
@@ -28,6 +28,9 @@ public class TextInputField extends BasicElement {
protected long vg;
protected int prevCaret = 0;
protected boolean isDoubleClick = false;
+ protected boolean onlyNums = false;
+ protected boolean errored = false;
+ protected boolean centered = false;
public TextInputField(int width, int height, String defaultText, boolean multiLine, boolean password) {
super(width, height, false);
@@ -37,6 +40,10 @@ public class TextInputField extends BasicElement {
this.input = "";
}
+ public void onlyAcceptNumbers(boolean state) {
+ onlyNums = state;
+ }
+
public void setInput(String input) {
this.input = input;
}
@@ -53,18 +60,32 @@ public class TextInputField extends BasicElement {
return password;
}
+ public void setErrored(boolean errored) {
+ this.errored = errored;
+ }
+
+ public void setCentered(boolean centered) {
+ this.centered = centered;
+ }
+
+ public boolean isErrored() {
+ return errored;
+ }
+
@Override
public void draw(long vg, int x, int y) {
this.x = x;
this.y = y;
this.vg = vg;
try {
- RenderManager.drawHollowRoundRect(vg, x, y, width, height, OneConfigConfig.GRAY_700, 12f, 2f);
+ int colorOutline = errored ? OneConfigConfig.ERROR_700 : OneConfigConfig.GRAY_700;
+ RenderManager.drawHollowRoundRect(vg, x, y, width, height, colorOutline, 12f, 2f);
super.update(x, y);
if (Mouse.isButtonDown(0) && !InputUtils.isAreaHovered(x - 40, y - 20, width + 90, height + 20)) {
toggled = false;
}
int color = toggled ? OneConfigConfig.WHITE : OneConfigConfig.WHITE_60;
+ if(!toggled) caretPos = input.length();
float width;
StringBuilder s = new StringBuilder();
if (!password) {
@@ -102,6 +123,7 @@ public class TextInputField extends BasicElement {
}
}
}
+ float halfTextWidth = this.getTextWidth(vg, input) / 2f;
if (start != 0f && end != 0f && toggled) {
RenderManager.drawRect(vg, start, y + height / 2f - 10, end, 20, OneConfigConfig.GRAY_300);
}
@@ -109,11 +131,13 @@ public class TextInputField extends BasicElement {
if (Mouse.isButtonDown(0) && !isDoubleClick) {
caretPos = calculatePos(Mouse.getX());
if (caretPos > prevCaret) {
- start = x + 12 + this.getTextWidth(vg, input.substring(0, prevCaret));
+ if(!centered) start = x + 12 + this.getTextWidth(vg, input.substring(0, prevCaret));
+ else start = x + this.width / 2f - halfTextWidth + this.getTextWidth(vg, input.substring(0, prevCaret));
end = this.getTextWidth(vg, input.substring(prevCaret, caretPos));
selectedText = input.substring(prevCaret, caretPos);
} else {
- start = x + 12 + this.getTextWidth(vg, input.substring(0, prevCaret));
+ if(!centered) start = x + 12 + this.getTextWidth(vg, input.substring(0, prevCaret));
+ else start = x + this.width / 2f - halfTextWidth + this.getTextWidth(vg, input.substring(0, prevCaret));
end = -this.getTextWidth(vg, input.substring(caretPos, prevCaret));
selectedText = input.substring(caretPos, prevCaret);
}
@@ -122,16 +146,28 @@ public class TextInputField extends BasicElement {
if (toggled) {
- RenderManager.drawLine(vg, x + width + 12, (float) y + height / 2f - 10, x + width + 12, (float) y + height / 2f + 10, 1, OneConfigConfig.WHITE);
+ if(!centered) {
+ RenderManager.drawLine(vg, x + width + 12, (float) y + height / 2f - 10, x + width + 12, (float) y + height / 2f + 10, 1, OneConfigConfig.WHITE);
+ } else {
+ RenderManager.drawLine(vg, x + this.width / 2f - halfTextWidth + width, (float) y + height / 2f - 10, x + this.width / 2f - halfTextWidth + width, (float) y + height / 2f + 10, 1, OneConfigConfig.WHITE);
+ }
}
if (input.equals("")) {
- RenderManager.drawString(vg, defaultText, x + 12, y + height / 2f + 1, color, 14f, Fonts.INTER_REGULAR);
+ if(!centered) {
+ RenderManager.drawString(vg, defaultText, x + 12, y + height / 2f + 1, color, 14f, Fonts.INTER_REGULAR);
+ } else {
+ RenderManager.drawString(vg, defaultText, x + this.width / 2f - halfTextWidth, y + height / 2f + 1, color, 14f, Fonts.INTER_REGULAR);
+ }
}
if (!password) {
- RenderManager.drawString(vg, input, x + 12, y + height / 2f + 1, color, 14f, Fonts.INTER_REGULAR);
+ if(!centered) {
+ RenderManager.drawString(vg, input, x + 12, y + height / 2f + 1, color, 14f, Fonts.INTER_REGULAR);
+ } else {
+ RenderManager.drawString(vg, input, x + this.width / 2f - halfTextWidth, y + height / 2f + 1, color, 14f, Fonts.INTER_REGULAR);
+ }
} else {
RenderManager.drawString(vg, s.toString(), x + 12, y + height / 2f + 1, color, 14f, Fonts.INTER_REGULAR);
}
@@ -178,7 +214,7 @@ public class TextInputField extends BasicElement {
if (GuiScreen.isKeyComboCtrlA(key)) {
prevCaret = 0;
caretPos = input.length();
- start = x + 12;
+ start = !centered ? x + 12 : x + this.width / 2f - this.getTextWidth(vg, input) / 2f;
selectedText = input;
end = this.getTextWidth(vg, input);
return;
@@ -222,6 +258,7 @@ public class TextInputField extends BasicElement {
return;
}
if (key == Keyboard.KEY_TAB) {
+ if(onlyNums) return;
input += " ";
caretPos += 4;
return;
@@ -282,6 +319,9 @@ public class TextInputField extends BasicElement {
if (key == Keyboard.KEY_LCONTROL || key == Keyboard.KEY_RCONTROL || key == Keyboard.KEY_LMENU || key == Keyboard.KEY_RMENU || key == Keyboard.KEY_LMETA || key == Keyboard.KEY_RMETA || key == Keyboard.KEY_LSHIFT || key == Keyboard.KEY_RSHIFT || key == Keyboard.KEY_RETURN || key == Keyboard.KEY_CAPITAL || key == 221 || key == Keyboard.KEY_HOME) {
return;
}
+ if(onlyNums) {
+ if(!Character.isDigit(c) && key != 52) return;
+ }
if (!Character.isDefined(key)) return;
if (!Character.isDefined(c)) return;
if(GuiScreen.isCtrlKeyDown()) return;
@@ -329,11 +369,13 @@ public class TextInputField extends BasicElement {
caretPos = input.indexOf(' ', caretPos);
if(caretPos == -1) caretPos = input.length();
selectedText = input.substring(prevCaret, caretPos);
- start = x + 12 + this.getTextWidth(vg, input.substring(0, prevCaret));
+ if(!centered) start = x + 12 + this.getTextWidth(vg, input.substring(0, prevCaret));
+ else start = x + this.width / 2f - this.getTextWidth(vg, input) / 2f + this.getTextWidth(vg, input.substring(0, prevCaret));
end = this.getTextWidth(vg, input.substring(prevCaret, caretPos));
}
private int calculatePos(int pos) {
+ if(centered) pos -= 12;
String s1 = "";
int i;
for (char c : input.toCharArray()) {
diff --git a/src/main/java/io/polyfrost/oneconfig/gui/elements/config/ConfigDualOption.java b/src/main/java/io/polyfrost/oneconfig/gui/elements/config/ConfigDualOption.java
index 705ab1a..3e90e57 100644
--- a/src/main/java/io/polyfrost/oneconfig/gui/elements/config/ConfigDualOption.java
+++ b/src/main/java/io/polyfrost/oneconfig/gui/elements/config/ConfigDualOption.java
@@ -13,10 +13,10 @@ public class ConfigDualOption extends BasicOption {
private float percentMove = 0f;
private final String left, right;
- public ConfigDualOption(Field field, String name, int size, String left, String right) {
+ public ConfigDualOption(Field field, String name, int size, String[] options) {
super(field, name, size);
- this.left = left;
- this.right = right;
+ this.left = options[0];
+ this.right = options[1];
}
diff --git a/src/main/java/io/polyfrost/oneconfig/gui/elements/config/ConfigSlider.java b/src/main/java/io/polyfrost/oneconfig/gui/elements/config/ConfigSlider.java
new file mode 100644
index 0000000..54df53e
--- /dev/null
+++ b/src/main/java/io/polyfrost/oneconfig/gui/elements/config/ConfigSlider.java
@@ -0,0 +1,178 @@
+package io.polyfrost.oneconfig.gui.elements.config;
+
+import io.polyfrost.oneconfig.config.OneConfigConfig;
+import io.polyfrost.oneconfig.config.interfaces.BasicOption;
+import io.polyfrost.oneconfig.gui.elements.BasicElement;
+import io.polyfrost.oneconfig.gui.elements.TextInputField;
+import io.polyfrost.oneconfig.lwjgl.RenderManager;
+import io.polyfrost.oneconfig.lwjgl.font.Fonts;
+import io.polyfrost.oneconfig.utils.ColorUtils;
+import io.polyfrost.oneconfig.utils.InputUtils;
+import io.polyfrost.oneconfig.utils.MathUtils;
+import org.lwjgl.input.Mouse;
+import org.lwjgl.nanovg.NanoVG;
+
+import java.lang.reflect.Field;
+
+public class ConfigSlider extends BasicOption {
+ private final BasicElement slideYBoi = new BasicElement(24, 24, false);
+ private final TextInputField inputField = new TextInputField(84, 24, "", false, false);
+ private final BasicElement upArrow = new BasicElement(12, 14, false);
+ private final BasicElement downArrow = new BasicElement(12, 14, false);
+ private final float min, max;
+ private final int step;
+ private float current;
+ private int colorTop, colorBottom;
+
+ public ConfigSlider(Field field, String name, int size, float min, float max, int step) {
+ super(field, name, size);
+ this.min = min;
+ this.max = max;
+ this.step = step - 1; // it adds one more step than actual
+ slideYBoi.setCustomHitbox(28, 8);
+ inputField.onlyAcceptNumbers(true);
+ inputField.setCentered(true);
+ try {
+ inputField.setInput(String.valueOf(get()));
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ @Override
+ public int getHeight() {
+ return 32;
+ }
+
+ @Override
+ public void draw(long vg, int x, int y) {
+ RenderManager.drawString(vg, name, x, y + 15, OneConfigConfig.WHITE_90, 18f, Fonts.INTER_MEDIUM);
+ RenderManager.drawRoundedRect(vg, x + 352, y + 13, 512, 6, OneConfigConfig.GRAY_300, 4f);
+ slideYBoi.update(x + 340 + (int) (current * 512), y + 4);
+ if(step != 0) {
+ for(float i = 0; i <= 1.005f; i += 1f / step) { // sometimes it's just more than 1, so we add a little
+ int color = current > i ? OneConfigConfig.BLUE_500 : OneConfigConfig.GRAY_300;
+ RenderManager.drawRoundedRect(vg, x + 351 + (int) (i * 512), y + 9, 4, 14, color, 2f);
+ }
+ }
+ RenderManager.drawRoundedRect(vg, x + 352, y + 13, (int) (current * 512), 6, OneConfigConfig.BLUE_500, 4f);
+ if(step == 0) RenderManager.drawRoundedRect(vg, x + 340 + (int) (current * 512), y + 4, 24, 24, OneConfigConfig.WHITE, 12f);
+ else RenderManager.drawRoundedRect(vg, x + 346 + (int) (current * 512), y + 4, 8, 24, OneConfigConfig.WHITE, 4f);
+
+
+ int mouseX = InputUtils.mouseX() - (x + 352);
+ if(InputUtils.isAreaClicked(x + 332, y + 9, 542, 10) && !slideYBoi.isHovered()) {
+ if(step == 0) {
+ current = MathUtils.clamp(mouseX / 512f);
+ } else current = MathUtils.clamp(toNearestStep(mouseX / 512f));
+ }
+ if(slideYBoi.isHovered() && Mouse.isButtonDown(0)) {
+ if(step == 0) {
+ current = MathUtils.clamp(mouseX / 512f);
+ } else current = MathUtils.clamp(toNearestStep(mouseX / 512f));
+ }
+ float currentAsNum = current * (max - min) + min;
+
+ if(!inputField.isToggled()) inputField.setInput(String.format("%.01f", currentAsNum));
+ inputField.setErrored(false);
+ if(inputField.isToggled()) {
+ try {
+ float input = Float.parseFloat(inputField.getInput());
+ if(input < min) {
+ inputField.setErrored(true);
+ input = min;
+ }
+ if(input > max) {
+ inputField.setErrored(true);
+ input = max;
+ }
+ if(step == 0) {
+ current = MathUtils.clamp((input - min) / (max - min));
+ } else {
+ current = toNearestStep(MathUtils.clamp((input - min) / (max - min)));
+ }
+ } catch (NumberFormatException ignored) {
+ inputField.setErrored(true);
+ }
+ }
+ inputField.draw(vg, x + 892, y);
+
+ RenderManager.drawRoundedRect(vg, x + 980, y, 12, 28, OneConfigConfig.GRAY_500, 6f);
+ upArrow.update(x + 980, y);
+ downArrow.update(x + 980, y + 14);
+ if(current == 1f) colorTop = OneConfigConfig.GRAY_500_80;
+ if(current == 0f) colorBottom = OneConfigConfig.GRAY_500_80;
+ colorTop = ColorUtils.getColor(colorTop, 2, upArrow.isHovered(), upArrow.isClicked());
+ colorBottom = ColorUtils.getColor(colorBottom, 2, downArrow.isHovered(), downArrow.isClicked());
+ if(upArrow.isClicked()) {
+ if(step == 0) {
+ currentAsNum += 1;
+ current = MathUtils.clamp((currentAsNum - min) / (max - min));
+ } else {
+ for(float i1 = 0f; i1 <= 1f; i1 += 1f / step) {
+ if(i1 > current) {
+ current = i1;
+ break;
+ }
+ }
+ }
+ }
+ if(downArrow.isClicked()) {
+ if(step == 0) {
+ currentAsNum -= 1;
+ current = MathUtils.clamp((currentAsNum - min) / (max - min));
+ } else {
+ for(float i1 = 1f; i1 >= 0f; i1 -= 1f / step) {
+ if(i1 < current) {
+ current = i1;
+ break;
+ }
+ }
+ }
+ }
+ if(current == 1f) NanoVG.nvgGlobalAlpha(vg, 0.3f);
+ RenderManager.drawRoundedRectVaried(vg, x + 980, y, 12, 14, colorTop,6f, 6f, 0f, 0f);
+ RenderManager.drawImage(vg, "/assets/oneconfig/textures/smallUpArrow.png", x + 981, y + 2, 10, 10);
+ if(current == 1f) NanoVG.nvgGlobalAlpha(vg, 1f);
+
+ if(current == 0f) NanoVG.nvgGlobalAlpha(vg, 0.3f);
+ RenderManager.drawRoundedRectVaried(vg, x + 980, y + 14, 12, 14, colorBottom,0f, 0f, 6f, 6f);
+ NanoVG.nvgTranslate(vg, x + 991, y + 25);
+ NanoVG.nvgRotate(vg, (float) Math.toRadians(180));
+ RenderManager.drawImage(vg, "/assets/oneconfig/textures/smallUpArrow.png", 0, 0, 10, 10);
+ NanoVG.nvgResetTransform(vg);
+ NanoVG.nvgGlobalAlpha(vg, 1f);
+ }
+
+ private float toNearestStep(float input) {
+ float stepF = 1f / step;
+ float stepAbove = 1f, stepBelow = 0f;
+ for(float a = 0f; a <= 1f; a += stepF) {
+ if(a > input) {
+ stepAbove = a;
+ break;
+ }
+ }
+ for(float a = 1f; a >= 0f; a -= stepF) {
+ if(a <= input) {
+ stepBelow = a;
+ break;
+ }
+ }
+ if(stepAbove - input > input - stepBelow) {
+ return stepBelow;
+ } else {
+ return stepAbove;
+ }
+ }
+
+ @Override
+ public boolean hasHalfSize() {
+ return false;
+ }
+
+ @Override
+ public void keyTyped(char key, int keyCode) {
+ inputField.keyTyped(key, keyCode);
+ }
+}
diff --git a/src/main/java/io/polyfrost/oneconfig/test/TestConfig.java b/src/main/java/io/polyfrost/oneconfig/test/TestConfig.java
index f49d958..08d4153 100644
--- a/src/main/java/io/polyfrost/oneconfig/test/TestConfig.java
+++ b/src/main/java/io/polyfrost/oneconfig/test/TestConfig.java
@@ -13,15 +13,15 @@ public class TestConfig extends Config {
@Option(
name = "Test dual thing",
subcategory = "Test",
- optionLeft = "FUNNY", optionRight = "not funny",
- type = OptionType.DUAL_OPTION
+ min = 3f, max = 127f,
+ type = OptionType.SLIDER
)
- public static boolean switchTest;
+ public static float sliderText;
@Option(
name = "Test string",
subcategory = "Test",
- optionLeft = "HI", optionRight = "BYE",
+ options = {"NO", "YES"},
type = OptionType.DUAL_OPTION
)
public static boolean switchTest1;
@@ -29,12 +29,12 @@ public class TestConfig extends Config {
@Option(
name = "Test dual option",
subcategory = "Test",
- optionRight = "cool", optionLeft = "not cool",
- type = OptionType.DUAL_OPTION,
- size = 2
+ options = {"HI", "BYE"},
+ type = OptionType.DUAL_OPTION
)
public static boolean switchTest2;
+
@Option(
name = "Test option",
subcategory = "Test",
diff --git a/src/main/java/io/polyfrost/oneconfig/utils/ColorUtils.java b/src/main/java/io/polyfrost/oneconfig/utils/ColorUtils.java
index abc36a5..499e59b 100644
--- a/src/main/java/io/polyfrost/oneconfig/utils/ColorUtils.java
+++ b/src/main/java/io/polyfrost/oneconfig/utils/ColorUtils.java
@@ -17,6 +17,7 @@ public class ColorUtils {
case -1:
return OneConfigConfig.GRAY_500_80;
default:
+ case 2:
case 0:
return OneConfigConfig.GRAY_400_80;
case 1:
@@ -34,6 +35,8 @@ public class ColorUtils {
return getColorComponents(color, splitColor(OneConfigConfig.GRAY_600), splitColor(OneConfigConfig.GRAY_300), hover, 25f);
case 1:
return getColorComponents(color, splitColor(OneConfigConfig.BLUE_600), splitColor(OneConfigConfig.BLUE_500), hover, 150f);
+ case 2:
+ return getColorComponents(color, splitColor(OneConfigConfig.GRAY_500), splitColor(OneConfigConfig.GRAY_300), hover, 50f);
}
diff --git a/src/main/resources/assets/oneconfig/icons/TestIcon.svg b/src/main/resources/assets/oneconfig/icons/TestIcon.svg
index bfbc91e..e69de29 100644
--- a/src/main/resources/assets/oneconfig/icons/TestIcon.svg
+++ b/src/main/resources/assets/oneconfig/icons/TestIcon.svg
@@ -1,4 +0,0 @@
-<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path fill-rule="evenodd" clip-rule="evenodd" d="M16.8921 12.0002C16.8921 9.30023 14.6999 7.10803 11.9999 7.10803C9.29987 7.10803 7.10767 9.30023 7.10767 12.0002C7.10767 14.7002 9.29987 16.8924 11.9999 16.8924C14.6999 16.8924 16.8921 14.7002 16.8921 12.0002ZM11.7741 14.599V10.3318L11.0523 10.857C10.9456 10.9283 10.8151 10.9547 10.6891 10.9303C10.5631 10.9059 10.4518 10.8328 10.3795 10.7268L10.2787 10.5794C10.242 10.5258 10.2165 10.4654 10.2035 10.4017C10.1906 10.338 10.1906 10.2724 10.2034 10.2087C10.2162 10.145 10.2416 10.0846 10.2782 10.0309C10.3148 9.97715 10.3617 9.93131 10.4163 9.89603C10.6006 9.77673 10.846 9.60252 11.0643 9.44752C11.2391 9.32344 11.3966 9.21167 11.4915 9.15023C11.5775 9.09463 11.6779 9.06503 11.7803 9.06503H12.4913C12.6204 9.06503 12.7443 9.11634 12.8356 9.20767C12.927 9.299 12.9783 9.42287 12.9783 9.55203V14.599C12.9783 14.868 12.7417 15.086 12.4727 15.086H12.2513C12.1221 15.086 12.0081 15.0348 11.9167 14.9434C11.8255 14.852 11.7741 14.7282 11.7741 14.599Z" fill="white"/>
-<path fill-rule="evenodd" clip-rule="evenodd" d="M24 12C24 5.377 18.623 0 12 0C5.377 0 0 5.377 0 12C0 18.623 5.377 24 12 24C18.623 24 24 18.623 24 12ZM14.6264 3.23929C14.3316 3.33328 14.0794 3.52813 13.914 3.7896C13.5146 4.4262 12.8064 4.85 12 4.85C11.6172 4.84997 11.2407 4.75267 10.9058 4.56721C10.571 4.38176 10.2887 4.11425 10.0856 3.7898C9.92029 3.52841 9.66817 3.33363 9.37351 3.23966C9.07885 3.1457 8.76051 3.15857 8.4744 3.276C7.66092 3.60564 6.89758 4.04753 6.2066 4.5888C5.96271 4.77807 5.79311 5.04706 5.72749 5.34872C5.66186 5.65038 5.70438 5.96551 5.8476 6.239C6.02666 6.57692 6.11694 6.95478 6.10998 7.33714C6.10302 7.7195 5.99904 8.09383 5.8078 8.425C5.61662 8.75637 5.34429 9.03365 5.01642 9.23077C4.68855 9.42789 4.31593 9.53836 3.9336 9.5518C3.62551 9.56433 3.3316 9.68462 3.10312 9.89168C2.87465 10.0987 2.7261 10.3794 2.6834 10.6848C2.56132 11.5574 2.56153 12.4427 2.684 13.3152C2.72674 13.6204 2.87523 13.9009 3.10359 14.1079C3.33194 14.3148 3.62568 14.435 3.9336 14.4476C4.31594 14.4613 4.68853 14.5719 5.01637 14.7691C5.34421 14.9663 5.61655 15.2436 5.8078 15.575C5.99902 15.9062 6.10299 16.2806 6.10999 16.6629C6.11699 17.0453 6.02677 17.4232 5.8478 17.7612C5.70458 18.0346 5.66205 18.3497 5.72764 18.6512C5.79323 18.9528 5.96277 19.2218 6.2066 19.411C6.89761 19.9523 7.66085 20.3943 8.4742 20.7244C8.76042 20.8419 9.07888 20.8547 9.37364 20.7607C9.6684 20.6667 9.92062 20.4719 10.086 20.2104C10.289 19.8859 10.5711 19.6183 10.9059 19.4328C11.2407 19.2473 11.6172 19.15 12 19.15C12.3828 19.15 12.7593 19.2473 13.0942 19.4328C13.429 19.6182 13.7113 19.8857 13.9144 20.2102C14.0797 20.4716 14.3318 20.6664 14.6265 20.7603C14.9211 20.8543 15.2395 20.8414 15.5256 20.724C16.3391 20.3944 17.1024 19.9525 17.7934 19.4112C18.0373 19.2219 18.2069 18.9529 18.2725 18.6513C18.3381 18.3496 18.2956 18.0345 18.1524 17.761C17.9733 17.4231 17.8831 17.0452 17.89 16.6629C17.897 16.2805 18.001 15.9062 18.1922 15.575C18.3834 15.2436 18.6557 14.9663 18.9836 14.7692C19.3115 14.5721 19.6841 14.4616 20.0664 14.4482C20.3745 14.4357 20.6684 14.3154 20.8969 14.1083C21.1254 13.9013 21.2739 13.6206 21.3166 13.3152C21.4387 12.4426 21.4385 11.5573 21.316 10.6848C21.2733 10.3796 21.1248 10.0991 20.8964 9.89215C20.6681 9.68521 20.3743 9.56497 20.0664 9.5524C19.6841 9.53872 19.3115 9.42807 18.9836 9.23087C18.6558 9.03366 18.3834 8.75635 18.1922 8.425C18.001 8.09379 17.897 7.71944 17.89 7.33706C17.883 6.95468 17.9732 6.57679 18.1522 6.2388C18.2954 5.9654 18.3379 5.65034 18.2724 5.34875C18.2068 5.04716 18.0372 4.77823 17.7934 4.589C17.1024 4.04773 16.3391 3.60566 15.5258 3.2756C15.2396 3.15815 14.9211 3.14529 14.6264 3.23929Z" fill="white"/>
-</svg>
diff --git a/src/main/resources/assets/oneconfig/textures/pc.svg b/src/main/resources/assets/oneconfig/textures/pc.svg
deleted file mode 100644
index 56a44c0..0000000
--- a/src/main/resources/assets/oneconfig/textures/pc.svg
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'><svg width="32px" height="32px" viewBox="0 0 32 32" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;" version="1.1" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:serif="http://www.serif.com/" xmlns:xlink="http://www.w3.org/1999/xlink"><rect height="32" id="Computer" style="fill:none;" width="32" x="0" y="0"/><path d="M21,29l-10,0c-0.087,-0.004 -0.109,-0.002 -0.195,-0.019c-0.289,-0.058 -0.548,-0.25 -0.687,-0.51c-0.138,-0.259 -0.155,-0.58 -0.042,-0.854c0.137,-0.33 0.462,-0.576 0.826,-0.612c0.033,-0.003 0.065,-0.003 0.098,-0.005l1.153,0l0.861,-5.164c0.019,-0.092 0.044,-0.183 0.084,-0.268c0.148,-0.309 0.463,-0.531 0.808,-0.564c0.032,-0.003 0.063,-0.003 0.094,-0.004l4,0c0.031,0.001 0.062,0.003 0.094,0.004c0.093,0.014 0.185,0.031 0.272,0.065c0.291,0.115 0.52,0.371 0.601,0.675c0.008,0.03 0.013,0.061 0.019,0.092l0.861,5.164l1.153,0c0.033,0.002 0.065,0.003 0.098,0.005c0.032,0.005 0.065,0.008 0.097,0.014c0.385,0.077 0.708,0.394 0.786,0.786c0.064,0.321 -0.042,0.671 -0.274,0.902c-0.139,0.139 -0.319,0.235 -0.512,0.274c-0.086,0.017 -0.108,0.015 -0.195,0.019Z" style="fill:#bdbdbd;"/><path d="M16,21l2,0c0.031,0.001 0.062,0.003 0.094,0.004c0.093,0.014 0.185,0.031 0.272,0.065c0.291,0.115 0.52,0.371 0.601,0.675c0.008,0.03 0.013,0.061 0.019,0.092l0.861,5.164l1.153,0l0.098,0.005c0.032,0.005 0.065,0.008 0.097,0.014c0.385,0.077 0.708,0.394 0.786,0.786c0.064,0.321 -0.042,0.671 -0.274,0.902c-0.139,0.139 -0.319,0.235 -0.512,0.274c-0.086,0.017 -0.108,0.015 -0.195,0.019l-5,0l0,-8Z" style="fill:#9e9e9e;"/><path d="M28.006,3c0.616,0.003 1.228,0.307 1.6,0.808c0.253,0.34 0.392,0.761 0.394,1.186c0.008,5.337 0.008,10.675 0,16.012c-0.003,0.612 -0.3,1.213 -0.788,1.585c-0.344,0.262 -0.771,0.407 -1.206,0.409c-8.004,0.012 -16.008,0.012 -24.012,0c-0.624,-0.003 -1.241,-0.312 -1.614,-0.827c-0.244,-0.337 -0.378,-0.748 -0.38,-1.167c-0.009,-5.337 -0.009,-10.675 0,-16.012c0.002,-0.506 0.204,-1.008 0.552,-1.374c0.37,-0.388 0.899,-0.617 1.442,-0.62c8.004,-0.012 16.008,-0.012 24.012,0Z" style="fill:#e0e0e0;"/><path d="M16,2.991c4.002,0 8.004,0.003 12.006,0.009c0.616,0.003 1.228,0.307 1.6,0.808c0.253,0.34 0.392,0.761 0.394,1.186c0.008,5.337 0.008,10.675 0,16.012c-0.003,0.612 -0.3,1.213 -0.788,1.585c-0.344,0.262 -0.771,0.407 -1.206,0.409c-4.002,0.006 -8.004,0.009 -12.006,0.009l0,-20.018Z" style="fill:#bdbdbd;"/><rect height="14" style="fill:#29b6f6;" width="12" x="4" y="5"/><rect height="14" style="fill:#03a9f4;" width="12" x="16" y="5"/></svg> \ No newline at end of file
diff --git a/src/main/resources/assets/oneconfig/textures/smallUpArrow.png b/src/main/resources/assets/oneconfig/textures/smallUpArrow.png
new file mode 100644
index 0000000..f6723ad
--- /dev/null
+++ b/src/main/resources/assets/oneconfig/textures/smallUpArrow.png
Binary files differ