From ff8323be4d8946d408eb3562fd05d1d1b2cec80a Mon Sep 17 00:00:00 2001 From: Bella Date: Fri, 20 Mar 2020 22:37:48 -0400 Subject: [PATCH] grey to gray and settingstoint to rgbtoint --- .../kami/gui/kami/theme/kami/RootCheckButtonUI.java | 10 +++++----- .../kami/module/modules/chat/ChatTimestamp.java | 2 +- .../kami/module/modules/gui/InventoryViewer.java | 6 ++++-- .../me/zeroeightsix/kami/util/ColourConverter.java | 4 ++-- .../java/me/zeroeightsix/kami/util/ColourUtils.java | 6 +++--- 5 files changed, 15 insertions(+), 13 deletions(-) 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 3e79e175..b567ecf4 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,7 +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.rgbToInt; import static me.zeroeightsix.kami.util.ColourConverter.toF; import static me.zeroeightsix.kami.util.ColourSet.*; import static org.lwjgl.opengl.GL11.*; @@ -28,11 +28,11 @@ public class RootCheckButtonUI extends AbstractComponentU 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()); + rgbToInt(buttonPressed.getRed(), buttonPressed.getGreen(), buttonPressed.getBlue()) : component.isToggled() ? + rgbToInt(buttonIdleT.getRed(), buttonIdleT.getGreen(), buttonIdleT.getBlue()) : + rgbToInt(buttonHoveredT.getRed(), buttonHoveredT.getGreen(), buttonHoveredT.getBlue()); if (component.isHovered()) - c = (c & settingsToInt(buttonHoveredN.getRed(), buttonHoveredN.getGreen(), buttonHoveredN.getBlue())) << 1; + c = (c & rgbToInt(buttonHoveredN.getRed(), buttonHoveredN.getGreen(), buttonHoveredN.getBlue())) << 1; glColor3f(1, 1, 1); glEnable(GL_TEXTURE_2D); diff --git a/src/main/java/me/zeroeightsix/kami/module/modules/chat/ChatTimestamp.java b/src/main/java/me/zeroeightsix/kami/module/modules/chat/ChatTimestamp.java index b1a519eb..da3dad37 100644 --- a/src/main/java/me/zeroeightsix/kami/module/modules/chat/ChatTimestamp.java +++ b/src/main/java/me/zeroeightsix/kami/module/modules/chat/ChatTimestamp.java @@ -18,7 +18,7 @@ import net.minecraft.util.text.TextFormatting; */ @Module.Info(name = "ChatTimestamp", category = Module.Category.CHAT, description = "Shows the time a message was sent beside the message", showOnArray = Module.ShowOnArray.OFF) public class ChatTimestamp extends Module { - private Setting firstColour = register(Settings.e("First Colour", ColourUtils.ColourCode.GREY)); + private Setting firstColour = register(Settings.e("First Colour", ColourUtils.ColourCode.GRAY)); private Setting secondColour = register(Settings.e("Second Colour", ColourUtils.ColourCode.WHITE)); private Setting timeTypeSetting = register(Settings.e("Time Format", TimeUtil.TimeType.HHMM)); private Setting timeUnitSetting = register(Settings.e("Time Unit", TimeUtil.TimeUnit.H12)); diff --git a/src/main/java/me/zeroeightsix/kami/module/modules/gui/InventoryViewer.java b/src/main/java/me/zeroeightsix/kami/module/modules/gui/InventoryViewer.java index b4e661b3..0cf20528 100644 --- a/src/main/java/me/zeroeightsix/kami/module/modules/gui/InventoryViewer.java +++ b/src/main/java/me/zeroeightsix/kami/module/modules/gui/InventoryViewer.java @@ -7,6 +7,7 @@ import me.zeroeightsix.kami.gui.rgui.util.ContainerHelper; import me.zeroeightsix.kami.module.Module; import me.zeroeightsix.kami.setting.Setting; import me.zeroeightsix.kami.setting.Settings; +import me.zeroeightsix.kami.util.ColourConverter; import net.minecraft.client.gui.Gui; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.RenderHelper; @@ -17,7 +18,8 @@ import org.lwjgl.opengl.GL11; import java.util.List; -import static me.zeroeightsix.kami.util.ColourConverter.settingsToInt; +import static me.zeroeightsix.kami.command.Command.sendDisableMessage; +import static me.zeroeightsix.kami.util.ColourConverter.rgbToInt; /** * Updated by S-B99 on 21/02/20 @@ -109,7 +111,7 @@ public class InventoryViewer extends Module { GlStateManager.disableDepth(); // } if (coloredBackground.getValue()) { // 1 == 2 px in game - Gui.drawRect(x, y, x + 162, y + 54, settingsToInt(r.getValue(), g.getValue(), b.getValue(), a.getValue())); + Gui.drawRect(x, y, x + 162, y + 54, ColourConverter.rgbToInt(r.getValue(), g.getValue(), b.getValue(), a.getValue())); } ResourceLocation box = getBox(); mc.renderEngine.bindTexture(box); diff --git a/src/main/java/me/zeroeightsix/kami/util/ColourConverter.java b/src/main/java/me/zeroeightsix/kami/util/ColourConverter.java index f5c147e0..5096b36d 100644 --- a/src/main/java/me/zeroeightsix/kami/util/ColourConverter.java +++ b/src/main/java/me/zeroeightsix/kami/util/ColourConverter.java @@ -9,9 +9,9 @@ public class ColourConverter { public static float toF(double d) { return (float) (d / 255f); } - public static int settingsToInt(int r, int g, int b, int a) { return (r << 16) | (g << 8) | (b) | (a << 24); } + public static int rgbToInt(int r, int g, int b, int a) { return (r << 16) | (g << 8) | (b) | (a << 24); } - public static int settingsToInt(int r, int g, int b) { return (r << 16) | (g << 8) | (b); } + public static int rgbToInt(int r, int g, int b) { return (r << 16) | (g << 8) | (b); } // settingsToInt(r.getValue(), g.getValue(), b.getValue(), aBlock.getValue() } diff --git a/src/main/java/me/zeroeightsix/kami/util/ColourUtils.java b/src/main/java/me/zeroeightsix/kami/util/ColourUtils.java index 538c0ea1..e2ebd90c 100644 --- a/src/main/java/me/zeroeightsix/kami/util/ColourUtils.java +++ b/src/main/java/me/zeroeightsix/kami/util/ColourUtils.java @@ -327,7 +327,7 @@ public class ColourUtils { * Tool for getting Minecraft Textformatting Colors */ public enum ColourCode { - BLACK, DARK_BLUE, DARK_GREEN, DARK_AQUA, DARK_RED, DARK_PURPLE, GOLD, GREY, DARK_GREY, BLUE, GREEN, AQUA, RED, LIGHT_PURPLE, YELLOW, WHITE + BLACK, DARK_BLUE, DARK_GREEN, DARK_AQUA, DARK_RED, DARK_PURPLE, GOLD, GRAY, DARK_GRAY, BLUE, GREEN, AQUA, RED, LIGHT_PURPLE, YELLOW, WHITE } public static String getStringColour(ColourCode c) { switch (c) { @@ -338,8 +338,8 @@ public class ColourUtils { case DARK_RED: return TextFormatting.DARK_RED.toString(); case DARK_PURPLE: return TextFormatting.DARK_PURPLE.toString(); case GOLD: return TextFormatting.GOLD.toString(); - case GREY: return TextFormatting.GRAY.toString(); - case DARK_GREY: return TextFormatting.DARK_GRAY.toString(); + case GRAY: return TextFormatting.GRAY.toString(); + case DARK_GRAY: return TextFormatting.DARK_GRAY.toString(); case BLUE: return TextFormatting.BLUE.toString(); case GREEN: return TextFormatting.GREEN.toString(); case AQUA: return TextFormatting.AQUA.toString();