add cursor color overrides
This commit is contained in:
@@ -54,10 +54,7 @@ import org.newdawn.slick.util.ResourceLoader;
|
||||
import com.sun.jna.platform.win32.Advapi32Util;
|
||||
import com.sun.jna.platform.win32.Win32Exception;
|
||||
import com.sun.jna.platform.win32.WinReg;
|
||||
import yugecin.opsudance.Dancer;
|
||||
import yugecin.opsudance.MoverDirection;
|
||||
import yugecin.opsudance.ObjectColorOverrides;
|
||||
import yugecin.opsudance.Pippi;
|
||||
import yugecin.opsudance.*;
|
||||
import yugecin.opsudance.movers.factories.AutoMoverFactory;
|
||||
|
||||
/**
|
||||
@@ -759,7 +756,61 @@ public class Options {
|
||||
}
|
||||
},
|
||||
|
||||
DANCE_RGB_INC ("RGB objects increment", "RGBInc", "Amount of hue to shift, used for rainbow object color override", Dancer.rgbhueinc, -1800, 1800) {
|
||||
DANCE_CURSOR_COLOR_OVERRIDE ("Cursor color override", "CursorColorOverride", "Override cursor color") {
|
||||
@Override
|
||||
public String getValueString() {
|
||||
return Dancer.cursorColorOverride.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] getListItems() {
|
||||
return CursorColorOverrides.values();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clickListItem(int index) {
|
||||
Dancer.cursorColorOverride = CursorColorOverrides.values()[index];
|
||||
}
|
||||
|
||||
@Override
|
||||
public String write() {
|
||||
return "" + Dancer.cursorColorOverride.nr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(String s) {
|
||||
Dancer.cursorColorOverride = CursorColorOverrides.values()[Integer.parseInt(s)];
|
||||
}
|
||||
},
|
||||
|
||||
DANCE_CURSOR_MIRROR_COLOR_OVERRIDE ("Cursor mirror color override", "CursorMirrorColorOverride", "Override mirror cursor color") {
|
||||
@Override
|
||||
public String getValueString() {
|
||||
return Dancer.cursorColorMirrorOverride.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] getListItems() {
|
||||
return CursorColorOverrides.values();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clickListItem(int index) {
|
||||
Dancer.cursorColorMirrorOverride = CursorColorOverrides.values()[index];
|
||||
}
|
||||
|
||||
@Override
|
||||
public String write() {
|
||||
return "" + Dancer.cursorColorMirrorOverride.nr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(String s) {
|
||||
Dancer.cursorColorMirrorOverride = CursorColorOverrides.values()[Integer.parseInt(s)];
|
||||
}
|
||||
},
|
||||
|
||||
DANCE_RGB_INC ("RGB objects increment", "RGBInc", "Amount of hue to shift, used for rainbow color override", Dancer.rgbhueinc, -1800, 1800) {
|
||||
@Override
|
||||
public String getValueString() {
|
||||
return String.format("%.1f°", val / 10f);
|
||||
@@ -778,19 +829,6 @@ public class Options {
|
||||
}
|
||||
},
|
||||
|
||||
DANCE_CURSOR_USE_OBJECT_COLOR ("Give object color to cursor", "CursorUseObjectColor", "The color of the last object will be used on the cursor", Dancer.cursoruselastobjectcolor) {
|
||||
@Override
|
||||
public void click(GameContainer container) {
|
||||
bool = !bool;
|
||||
Dancer.cursoruselastobjectcolor = bool;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(String s) {
|
||||
super.read(s);
|
||||
Dancer.cursoruselastobjectcolor = bool;
|
||||
}
|
||||
},
|
||||
|
||||
DANCE_HIDE_OBJECTS ("Don't draw objects", "HideObj", "If you only want to see cursors :)", Dancer.hideobjects) {
|
||||
@Override
|
||||
|
||||
@@ -70,10 +70,7 @@ import org.newdawn.slick.state.transition.DelayedFadeOutTransition;
|
||||
import org.newdawn.slick.state.transition.EasedFadeOutTransition;
|
||||
import org.newdawn.slick.state.transition.EmptyTransition;
|
||||
import org.newdawn.slick.state.transition.FadeInTransition;
|
||||
import yugecin.opsudance.Dancer;
|
||||
import yugecin.opsudance.MoverDirection;
|
||||
import yugecin.opsudance.ObjectColorOverrides;
|
||||
import yugecin.opsudance.Pippi;
|
||||
import yugecin.opsudance.*;
|
||||
|
||||
/**
|
||||
* "Game" state.
|
||||
@@ -1218,7 +1215,7 @@ public class Game extends BasicGameState {
|
||||
}
|
||||
|
||||
// initialize object maps
|
||||
ObjectColorOverrides.comboColors = beatmap.getComboColors();
|
||||
CursorColorOverrides.comboColors = ObjectColorOverrides.comboColors = beatmap.getComboColors();
|
||||
ObjectColorOverrides.hue = 0f;
|
||||
for (int i = 0; i < beatmap.objects.length; i++) {
|
||||
HitObject hitObject = beatmap.objects[i];
|
||||
|
||||
@@ -118,8 +118,9 @@ public class OptionsMenu extends BasicGameState {
|
||||
GameOption.DANCE_DRAW_APPROACH,
|
||||
GameOption.DANCE_OBJECT_COLOR_OVERRIDE,
|
||||
GameOption.DANCE_OBJECT_COLOR_OVERRIDE_MIRRORED,
|
||||
GameOption.DANCE_CURSOR_COLOR_OVERRIDE,
|
||||
GameOption.DANCE_CURSOR_MIRROR_COLOR_OVERRIDE,
|
||||
GameOption.DANCE_RGB_INC,
|
||||
GameOption.DANCE_CURSOR_USE_OBJECT_COLOR,
|
||||
GameOption.DANCE_REMOVE_BG,
|
||||
GameOption.DANCE_HIDE_OBJECTS,
|
||||
GameOption.DANCE_HIDE_UI,
|
||||
|
||||
@@ -190,7 +190,12 @@ public class Cursor {
|
||||
for (int i = 0; i < removeCount && !trail.isEmpty(); i++)
|
||||
trail.remove();
|
||||
|
||||
Color filter = getColorFilter();
|
||||
Color filter;
|
||||
if (isMirrored) {
|
||||
filter = Dancer.cursorColorMirrorOverride.getMirrorColor();
|
||||
} else {
|
||||
filter = Dancer.cursorColorOverride.getColor();
|
||||
}
|
||||
|
||||
// draw a fading trail
|
||||
float alpha = 0f;
|
||||
@@ -218,16 +223,6 @@ public class Cursor {
|
||||
cursorMiddle.drawCentered(mouseX, mouseY, filter);
|
||||
}
|
||||
|
||||
private Color getColorFilter() {
|
||||
if (!Dancer.cursoruselastobjectcolor) {
|
||||
return Color.white;
|
||||
}
|
||||
if (isMirrored) {
|
||||
return lastMirroredObjColor;
|
||||
}
|
||||
return lastObjColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds all points between (x1, y1) and (x2, y2) to the cursor point lists.
|
||||
* @author http://rosettacode.org/wiki/Bitmap/Bresenham's_line_algorithm#Java
|
||||
|
||||
Reference in New Issue
Block a user