use switch case for active mods

This commit is contained in:
Bella 2020-03-31 13:43:17 -04:00
parent bc7400a7f1
commit 19dda9d15c
No known key found for this signature in database
GPG Key ID: 815562EA23BFE344
1 changed files with 15 additions and 8 deletions

View File

@ -63,14 +63,21 @@ public class KamiActiveModulesUI extends AbstractComponentUI<me.zeroeightsix.kam
Module module = mods.get(i);
int rgb;
if (activeMods.mode.getValue().equals(ActiveModules.Mode.RAINBOW)) {
rgb = Color.HSBtoRGB(hue[0], toF(activeMods.saturationR.getValue()), toF(activeMods.brightnessR.getValue()));
} else if (activeMods.mode.getValue().equals(ActiveModules.Mode.CATEGORY)) {
rgb = ActiveModules.getCategoryColour(module);
} else if (activeMods.mode.getValue().equals(ActiveModules.Mode.CUSTOM)) {
rgb = Color.HSBtoRGB(toF(activeMods.hueC.getValue()), toF(activeMods.saturationC.getValue()), toF(activeMods.brightnessC.getValue()));
} else {
rgb = activeMods.getInfoColour(i);
switch (activeMods.mode.getValue()) {
case RAINBOW:
rgb = Color.HSBtoRGB(hue[0], toF(activeMods.saturationR.getValue()), toF(activeMods.brightnessR.getValue()));
break;
case CATEGORY:
rgb = ActiveModules.getCategoryColour(module);
break;
case CUSTOM:
rgb = Color.HSBtoRGB(toF(activeMods.hueC.getValue()), toF(activeMods.saturationC.getValue()), toF(activeMods.brightnessC.getValue()));
break;
case INFO_OVERLAY:
rgb = activeMods.getInfoColour(i);
break;
default:
rgb = 0;
}
String hudInfo = module.getHudInfo();