From a8b7e93a33647e91913f4067660e8649d025d6c0 Mon Sep 17 00:00:00 2001 From: Bella Date: Thu, 5 Mar 2020 20:28:54 -0500 Subject: [PATCH] make colourset names legible and change checkbutton colors --- .../kami/gui/kami/theme/kami/KamiFrameUI.java | 10 +++--- .../kami/theme/kami/RootCheckButtonUI.java | 16 +++++---- .../kami/RootColorizedCheckButtonUI.java | 14 ++++---- .../kami/util/ColourConverter.java | 15 ++++---- .../me/zeroeightsix/kami/util/ColourSet.java | 36 +++++++------------ 5 files changed, 44 insertions(+), 47 deletions(-) diff --git a/src/main/java/me/zeroeightsix/kami/gui/kami/theme/kami/KamiFrameUI.java b/src/main/java/me/zeroeightsix/kami/gui/kami/theme/kami/KamiFrameUI.java index 3feb58e1..fa93a498 100644 --- a/src/main/java/me/zeroeightsix/kami/gui/kami/theme/kami/KamiFrameUI.java +++ b/src/main/java/me/zeroeightsix/kami/gui/kami/theme/kami/KamiFrameUI.java @@ -49,8 +49,8 @@ public class KamiFrameUI extends AbstractComponentUI { glColor4f(.17f, .17f, .18f, .9f); RenderHelper.drawFilledRectangle(0, 0, component.getWidth(), component.getHeight()); // Main window - glColor3f(toF(componentWindowOutline.getRed()), toF(componentWindowOutline.getGreen()), toF(componentWindowOutline.getBlue())); - glLineWidth(componentWindowOutlineWidth); + glColor3f(toF(windowOutline.getRed()), toF(windowOutline.getGreen()), toF(windowOutline.getBlue())); + glLineWidth(windowOutlineWidth); RenderHelper.drawRectangle(0, 0, component.getWidth(), component.getHeight()); // Border / Outline GL11.glColor3f(1, 1, 1); @@ -106,9 +106,9 @@ public class KamiFrameUI extends AbstractComponentUI { if (component.isPinnable()) { if (component.isPinned()) - glColor3f(toF(componentPinnedColour.getRed()), toF(componentPinnedColour.getGreen()), toF(componentPinnedColour.getBlue())); + glColor3f(toF(pinnedWindow.getRed()), toF(pinnedWindow.getGreen()), toF(pinnedWindow.getBlue())); else - glColor3f(toF(componentUnpinnedColour), toF(componentUnpinnedColour), toF(componentUnpinnedColour)); + glColor3f(toF(unpinnedWindow), toF(unpinnedWindow), toF(unpinnedWindow)); RenderHelper.drawCircle(7, 4, 2f); glLineWidth(3f); glBegin(GL_LINES); @@ -120,7 +120,7 @@ public class KamiFrameUI extends AbstractComponentUI { } if (component.equals(xLineComponent)) { - glColor3f(toF(componentLineColour), toF(componentLineColour), toF(componentLineColour)); + glColor3f(toF(lineWindow), toF(lineWindow), toF(lineWindow)); glLineWidth(1f); glBegin(GL_LINES); { diff --git a/src/main/java/me/zeroeightsix/kami/gui/kami/theme/kami/RootCheckButtonUI.java b/src/main/java/me/zeroeightsix/kami/gui/kami/theme/kami/RootCheckButtonUI.java index c2c45d96..3e79e175 100644 --- a/src/main/java/me/zeroeightsix/kami/gui/kami/theme/kami/RootCheckButtonUI.java +++ b/src/main/java/me/zeroeightsix/kami/gui/kami/theme/kami/RootCheckButtonUI.java @@ -6,6 +6,7 @@ import me.zeroeightsix.kami.gui.rgui.component.use.CheckButton; import me.zeroeightsix.kami.gui.rgui.render.AbstractComponentUI; import me.zeroeightsix.kami.gui.rgui.render.font.FontRenderer; +import static me.zeroeightsix.kami.util.ColourConverter.settingsToInt; import static me.zeroeightsix.kami.util.ColourConverter.toF; import static me.zeroeightsix.kami.util.ColourSet.*; import static org.lwjgl.opengl.GL11.*; @@ -17,18 +18,21 @@ public class RootCheckButtonUI extends AbstractComponentU @Override public void renderComponent(CheckButton component, FontRenderer ff) { - glColor4f(toF(checkButtonBackgroundColour.getRed()), toF(checkButtonBackgroundColour.getGreen()), toF(checkButtonBackgroundColour.getBlue()), component.getOpacity()); + glColor4f(toF(bgColour.getRed()), toF(bgColour.getGreen()), toF(bgColour.getBlue()), component.getOpacity()); if (component.isToggled()) { // I don't know why the R in this one is separate, 086 wrote it that way - glColor3f(checkButtonBackgroundColourOther, toF(checkButtonBackgroundColour.getGreen()), toF(checkButtonBackgroundColour.getBlue())); + glColor3f(toF(bgColourOther), toF(bgColour.getGreen()), toF(bgColour.getBlue())); } if (component.isHovered() || component.isPressed()) { - glColor4f(toF(checkButtonBackgroundColourHover.getRed()), toF(checkButtonBackgroundColourHover.getGreen()), toF(checkButtonBackgroundColourHover.getBlue()), component.getOpacity()); + glColor4f(toF(bgColourHover.getRed()), toF(bgColourHover.getGreen()), toF(bgColourHover.getBlue()), component.getOpacity()); } - String text = component.getName(); - int c = component.isPressed() ? 0xaaaaaa : component.isToggled() ? 0xff3333 : 0xdddddd; + String text = component.getName(); // on toggle, toggled, hovered enabled + int c = component.isPressed() ? + settingsToInt(buttonPressed.getRed(), buttonPressed.getGreen(), buttonPressed.getBlue()) : component.isToggled() ? + settingsToInt(buttonIdleT.getRed(), buttonIdleT.getGreen(), buttonIdleT.getBlue()) : + settingsToInt(buttonHoveredT.getRed(), buttonHoveredT.getGreen(), buttonHoveredT.getBlue()); if (component.isHovered()) - c = (c & 0x7f7f7f) << 1; + c = (c & settingsToInt(buttonHoveredN.getRed(), buttonHoveredN.getGreen(), buttonHoveredN.getBlue())) << 1; glColor3f(1, 1, 1); glEnable(GL_TEXTURE_2D); diff --git a/src/main/java/me/zeroeightsix/kami/gui/kami/theme/kami/RootColorizedCheckButtonUI.java b/src/main/java/me/zeroeightsix/kami/gui/kami/theme/kami/RootColorizedCheckButtonUI.java index 67f348af..10ed7b5a 100644 --- a/src/main/java/me/zeroeightsix/kami/gui/kami/theme/kami/RootColorizedCheckButtonUI.java +++ b/src/main/java/me/zeroeightsix/kami/gui/kami/theme/kami/RootColorizedCheckButtonUI.java @@ -20,18 +20,18 @@ public class RootColorizedCheckButtonUI extends RootCheckButtonUI