From 9e45afdb35f8aa709298630c8b9b6dc6c47f76a6 Mon Sep 17 00:00:00 2001 From: kirillsaint Date: Tue, 16 Jan 2024 16:00:29 +0600 Subject: [PATCH] Better Hit Color --- .../client/gui/lite/clickgui/GuiColorPicker.java | 1 + .../silentclient/client/mods/render/HitColorMod.java | 11 +++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/net/silentclient/client/gui/lite/clickgui/GuiColorPicker.java b/src/main/java/net/silentclient/client/gui/lite/clickgui/GuiColorPicker.java index c685fda..80c4aa0 100644 --- a/src/main/java/net/silentclient/client/gui/lite/clickgui/GuiColorPicker.java +++ b/src/main/java/net/silentclient/client/gui/lite/clickgui/GuiColorPicker.java @@ -197,6 +197,7 @@ public class GuiColorPicker extends SilentScreen { protected void keyTyped(char typedChar, int keyCode) throws IOException { if (keyCode == Keyboard.KEY_ESCAPE) { ClickGUI.close = true; + Client.getInstance().configManager.save(); } } } diff --git a/src/main/java/net/silentclient/client/mods/render/HitColorMod.java b/src/main/java/net/silentclient/client/mods/render/HitColorMod.java index 073c1c9..2cef2d7 100644 --- a/src/main/java/net/silentclient/client/mods/render/HitColorMod.java +++ b/src/main/java/net/silentclient/client/mods/render/HitColorMod.java @@ -1,13 +1,13 @@ package net.silentclient.client.mods.render; -import java.awt.Color; - import net.silentclient.client.Client; import net.silentclient.client.event.EventTarget; import net.silentclient.client.event.impl.EventHitOverlay; import net.silentclient.client.mods.Mod; import net.silentclient.client.mods.ModCategory; +import java.awt.*; + public class HitColorMod extends Mod { public HitColorMod() { super("Hit Color", ModCategory.MODS, "silentclient/icons/mods/hitcolor.png"); @@ -15,17 +15,16 @@ public class HitColorMod extends Mod { @Override public void setup() { - this.addSliderSetting("Alpha", this, 0.8, 0, 1, false); + this.addColorSetting("Color", this, new Color(255, 0, 0), 76); } @EventTarget public void onHitOverlay(EventHitOverlay event) { - Color color = new Color(1, 0, 0, 0.3F); - float alpha = (float) Client.getInstance().getSettingsManager().getSettingByName(this, "Alpha").getValDouble(); + Color color = Client.getInstance().getSettingsManager().getSettingByName(this, "Color").getValColor(); event.setRed(color.getRed() / 255F); event.setGreen(color.getGreen() / 255F); event.setBlue(color.getBlue() / 255F); - event.setAlpha(alpha); + event.setAlpha(color.getAlpha() / 255F); } }