add separate rgb inc option for cursor

This commit is contained in:
yugecin 2016-10-01 11:59:03 +02:00
parent 652bb4f2d0
commit 1a44b38636
4 changed files with 28 additions and 7 deletions

View File

@ -756,6 +756,25 @@ public class Options {
} }
}, },
DANCE_RGB_OBJECT_INC ("RGB objects increment", "RGBInc", "Amount of hue to shift, used for rainbow object override", Dancer.rgbhueinc, -1800, 1800) {
@Override
public String getValueString() {
return String.format("%.1f°", val / 10f);
}
@Override
public void drag(GameContainer container, int d) {
super.drag(container, d);
Dancer.rgbhueinc = val;
}
@Override
public void read(String s) {
super.read(s);
Dancer.rgbhueinc = val;
}
},
DANCE_CURSOR_COLOR_OVERRIDE ("Cursor color override", "CursorColorOverride", "Override cursor color") { DANCE_CURSOR_COLOR_OVERRIDE ("Cursor color override", "CursorColorOverride", "Override cursor color") {
@Override @Override
public String getValueString() { public String getValueString() {
@ -810,26 +829,25 @@ public class Options {
} }
}, },
DANCE_RGB_INC ("RGB objects increment", "RGBInc", "Amount of hue to shift, used for rainbow color override", Dancer.rgbhueinc, -1800, 1800) { DANCE_RGB_CURSOR_INC ("RGB cursor increment", "RGBCursorInc", "Amount of hue to shift, used for rainbow cursor override", Dancer.rgbhueinc, -1800, 1800) {
@Override @Override
public String getValueString() { public String getValueString() {
return String.format("%.1f°", val / 10f); return String.format("%.1f°", val / 100f);
} }
@Override @Override
public void drag(GameContainer container, int d) { public void drag(GameContainer container, int d) {
super.drag(container, d); super.drag(container, d);
Dancer.rgbhueinc = val; Dancer.rgbcursorhueinc = val;
} }
@Override @Override
public void read(String s) { public void read(String s) {
super.read(s); super.read(s);
Dancer.rgbhueinc = val; Dancer.rgbcursorhueinc = val;
} }
}, },
DANCE_HIDE_OBJECTS ("Don't draw objects", "HideObj", "If you only want to see cursors :)", Dancer.hideobjects) { DANCE_HIDE_OBJECTS ("Don't draw objects", "HideObj", "If you only want to see cursors :)", Dancer.hideobjects) {
@Override @Override
public void click(GameContainer container) { public void click(GameContainer container) {

View File

@ -118,9 +118,10 @@ public class OptionsMenu extends BasicGameState {
GameOption.DANCE_DRAW_APPROACH, GameOption.DANCE_DRAW_APPROACH,
GameOption.DANCE_OBJECT_COLOR_OVERRIDE, GameOption.DANCE_OBJECT_COLOR_OVERRIDE,
GameOption.DANCE_OBJECT_COLOR_OVERRIDE_MIRRORED, GameOption.DANCE_OBJECT_COLOR_OVERRIDE_MIRRORED,
GameOption.DANCE_RGB_OBJECT_INC,
GameOption.DANCE_CURSOR_COLOR_OVERRIDE, GameOption.DANCE_CURSOR_COLOR_OVERRIDE,
GameOption.DANCE_CURSOR_MIRROR_COLOR_OVERRIDE, GameOption.DANCE_CURSOR_MIRROR_COLOR_OVERRIDE,
GameOption.DANCE_RGB_INC, GameOption.DANCE_RGB_CURSOR_INC,
GameOption.DANCE_REMOVE_BG, GameOption.DANCE_REMOVE_BG,
GameOption.DANCE_HIDE_OBJECTS, GameOption.DANCE_HIDE_OBJECTS,
GameOption.DANCE_HIDE_UI, GameOption.DANCE_HIDE_UI,

View File

@ -97,11 +97,12 @@ public enum CursorColorOverrides {
} }
private static Color nextRainbowColor() { private static Color nextRainbowColor() {
hue += Dancer.rgbhueinc / 10f; hue += Dancer.rgbcursorhueinc / 100f;
return new Color(java.awt.Color.getHSBColor(hue / 360f, 1.0f, 1.0f).getRGB()); return new Color(java.awt.Color.getHSBColor(hue / 360f, 1.0f, 1.0f).getRGB());
} }
private static Color nextMirrorRainbowColor() { private static Color nextMirrorRainbowColor() {
hue += Dancer.rgbcursorhueinc / 100f;
return new Color(java.awt.Color.getHSBColor((hue + 180f) / 360f, 1.0f, 1.0f).getRGB()); return new Color(java.awt.Color.getHSBColor((hue + 180f) / 360f, 1.0f, 1.0f).getRGB());
} }

View File

@ -65,6 +65,7 @@ public class Dancer {
public static int rgbhueinc = 70; // this should really get its own place somewhere... public static int rgbhueinc = 70; // this should really get its own place somewhere...
public static CursorColorOverrides cursorColorOverride = CursorColorOverrides.NONE; public static CursorColorOverrides cursorColorOverride = CursorColorOverrides.NONE;
public static CursorColorOverrides cursorColorMirrorOverride = CursorColorOverrides.NONE; public static CursorColorOverrides cursorColorMirrorOverride = CursorColorOverrides.NONE;
public static int rgbcursorhueinc = 10; // this should really get its own place somewhere...
public static MoverDirection moverDirection = MoverDirection.RANDOM; public static MoverDirection moverDirection = MoverDirection.RANDOM;
public static boolean hideobjects = false; public static boolean hideobjects = false;