diff --git a/src/main/java/org/saturnclient/ui2/components/inputs/KeybindingSelector.java b/src/main/java/org/saturnclient/ui2/components/inputs/KeybindingSelector.java index c4f07ad..d65ebfd 100644 --- a/src/main/java/org/saturnclient/ui2/components/inputs/KeybindingSelector.java +++ b/src/main/java/org/saturnclient/ui2/components/inputs/KeybindingSelector.java @@ -2,15 +2,13 @@ package org.saturnclient.ui2.components.inputs; import org.lwjgl.glfw.GLFW; import org.saturnclient.saturnclient.config.Property; -import org.saturnclient.saturnclient.config.ThemeManager; +import org.saturnclient.saturnclient.config.Theme; import org.saturnclient.ui2.Element; import org.saturnclient.ui2.ElementContext; import org.saturnclient.ui2.RenderScope; import org.saturnclient.ui2.resources.Fonts; public class KeybindingSelector extends Element { - private static ThemeManager theme = new ThemeManager("Input"); - private static Property font = theme.property("font", Property.font(1)); Property prop; public KeybindingSelector(Property prop) { @@ -25,7 +23,7 @@ public class KeybindingSelector extends Element { renderScope.drawRoundedRectangle(0, 0, width, height, 10, 0xFF000000); renderScope.drawText(0.6f, prop.value == -1 ? "" : GLFW.glfwGetKeyName(prop.value, GLFW.glfwGetKeyScancode(prop.value)).toUpperCase(), - 4, 4, font.value, textColor); + 4, 4, Theme.FONT.value, textColor); } @Override diff --git a/src/main/java/org/saturnclient/ui2/components/inputs/Select.java b/src/main/java/org/saturnclient/ui2/components/inputs/Select.java index c4d207c..31aeedf 100644 --- a/src/main/java/org/saturnclient/ui2/components/inputs/Select.java +++ b/src/main/java/org/saturnclient/ui2/components/inputs/Select.java @@ -1,7 +1,7 @@ package org.saturnclient.ui2.components.inputs; import org.saturnclient.saturnclient.config.Property; -import org.saturnclient.saturnclient.config.ThemeManager; +import org.saturnclient.saturnclient.config.Theme; import org.saturnclient.ui2.Element; import org.saturnclient.ui2.ElementContext; import org.saturnclient.ui2.RenderScope; @@ -10,11 +10,6 @@ import org.saturnclient.ui2.resources.Fonts; import net.minecraft.client.render.RenderLayer; public class Select extends Element { - private static ThemeManager theme = new ThemeManager("Toggle"); - private static Property fgColor = theme.property("fg-color", Property.color(0xAAAAAA)); - private static Property arrowColor = theme.property("arrow-color", Property.color(0xff8B5CF6)); - private static Property font = theme.property("font", Property.font(1)); - private Property prop; public Select(Property prop) { @@ -27,15 +22,14 @@ public class Select extends Element { public void render(RenderScope renderScope, ElementContext ctx) { renderScope.setRenderLayer(RenderLayer::getGuiTextured); - renderScope.drawText(0.8f, "<", 0, 0, font.value, arrowColor.value); + renderScope.drawText(0.8f, "<", 0, 0, Theme.FONT.value, Theme.FOREGROUND.value); String text = prop.getSelection(); - renderScope.drawText(0.6f, text, (int) (width - ((float) Fonts.getWidth(text, font.value) * 0.6f)) / 2, 1, font.value, fgColor.value); + renderScope.drawText(0.6f, text, (int) (width - ((float) Fonts.getWidth(text, Theme.FONT.value) * 0.6f)) / 2, 1, + Theme.FONT.value, Theme.FOREGROUND.value); - renderScope.drawText(0.8f, ">", width - 10, 0, font.value, arrowColor.value); - - theme.setState(null); + renderScope.drawText(0.8f, ">", width - 10, 0, Theme.FONT.value, Theme.FOREGROUND.value); } @Override