grey to gray and settingstoint to rgbtoint

This commit is contained in:
Bella 2020-03-20 22:37:48 -04:00
parent 948a2cd73c
commit ff8323be4d
No known key found for this signature in database
GPG Key ID: 815562EA23BFE344
5 changed files with 15 additions and 13 deletions

View File

@ -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<T extends CheckButton> 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);

View File

@ -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<ColourUtils.ColourCode> firstColour = register(Settings.e("First Colour", ColourUtils.ColourCode.GREY));
private Setting<ColourUtils.ColourCode> firstColour = register(Settings.e("First Colour", ColourUtils.ColourCode.GRAY));
private Setting<ColourUtils.ColourCode> secondColour = register(Settings.e("Second Colour", ColourUtils.ColourCode.WHITE));
private Setting<TimeUtil.TimeType> timeTypeSetting = register(Settings.e("Time Format", TimeUtil.TimeType.HHMM));
private Setting<TimeUtil.TimeUnit> timeUnitSetting = register(Settings.e("Time Unit", TimeUtil.TimeUnit.H12));

View File

@ -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);

View File

@ -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()
}

View File

@ -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();