Hotfix Nr. 2
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package de.fullrisk.citrusDev.UI;
|
||||
|
||||
import de.fullrisk.citrusDev.Config;
|
||||
|
||||
public class Module_Hitbox {
|
||||
private static boolean enabled = Config.get().hitboxEnabled;
|
||||
private static int hue = Config.get().hitboxHue; // 0-360
|
||||
public static volatile int color = hueToArgb(hue);
|
||||
|
||||
public static boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public static void setEnabled(boolean value) {
|
||||
enabled = value;
|
||||
Config.get().hitboxEnabled = value;
|
||||
Config.get().save();
|
||||
}
|
||||
|
||||
public static int getHue() {
|
||||
return hue;
|
||||
}
|
||||
|
||||
public static void setHue(int value) {
|
||||
hue = value;
|
||||
color = hueToArgb(hue);
|
||||
Config.get().hitboxHue = value;
|
||||
Config.get().save();
|
||||
}
|
||||
|
||||
private static int hueToArgb(int hueDegrees) {
|
||||
float h = (hueDegrees % 360) / 360.0F;
|
||||
int rgb = java.awt.Color.HSBtoRGB(h, 1.0F, 1.0F);
|
||||
return 0xFF000000 | (rgb & 0x00FFFFFF); // force opaque
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user