Better Hit Color

This commit is contained in:
kirillsaint 2024-01-16 16:00:29 +06:00
parent fa8199d82d
commit 9e45afdb35
2 changed files with 6 additions and 6 deletions

View File

@ -197,6 +197,7 @@ public class GuiColorPicker extends SilentScreen {
protected void keyTyped(char typedChar, int keyCode) throws IOException { protected void keyTyped(char typedChar, int keyCode) throws IOException {
if (keyCode == Keyboard.KEY_ESCAPE) { if (keyCode == Keyboard.KEY_ESCAPE) {
ClickGUI.close = true; ClickGUI.close = true;
Client.getInstance().configManager.save();
} }
} }
} }

View File

@ -1,13 +1,13 @@
package net.silentclient.client.mods.render; package net.silentclient.client.mods.render;
import java.awt.Color;
import net.silentclient.client.Client; import net.silentclient.client.Client;
import net.silentclient.client.event.EventTarget; import net.silentclient.client.event.EventTarget;
import net.silentclient.client.event.impl.EventHitOverlay; import net.silentclient.client.event.impl.EventHitOverlay;
import net.silentclient.client.mods.Mod; import net.silentclient.client.mods.Mod;
import net.silentclient.client.mods.ModCategory; import net.silentclient.client.mods.ModCategory;
import java.awt.*;
public class HitColorMod extends Mod { public class HitColorMod extends Mod {
public HitColorMod() { public HitColorMod() {
super("Hit Color", ModCategory.MODS, "silentclient/icons/mods/hitcolor.png"); super("Hit Color", ModCategory.MODS, "silentclient/icons/mods/hitcolor.png");
@ -15,17 +15,16 @@ public class HitColorMod extends Mod {
@Override @Override
public void setup() { public void setup() {
this.addSliderSetting("Alpha", this, 0.8, 0, 1, false); this.addColorSetting("Color", this, new Color(255, 0, 0), 76);
} }
@EventTarget @EventTarget
public void onHitOverlay(EventHitOverlay event) { public void onHitOverlay(EventHitOverlay event) {
Color color = new Color(1, 0, 0, 0.3F); Color color = Client.getInstance().getSettingsManager().getSettingByName(this, "Color").getValColor();
float alpha = (float) Client.getInstance().getSettingsManager().getSettingByName(this, "Alpha").getValDouble();
event.setRed(color.getRed() / 255F); event.setRed(color.getRed() / 255F);
event.setGreen(color.getGreen() / 255F); event.setGreen(color.getGreen() / 255F);
event.setBlue(color.getBlue() / 255F); event.setBlue(color.getBlue() / 255F);
event.setAlpha(alpha); event.setAlpha(color.getAlpha() / 255F);
} }
} }