cursor trail length override

This commit is contained in:
yugecin 2016-10-01 12:14:39 +02:00
parent c7538ef348
commit a7e1a2e32f
4 changed files with 28 additions and 0 deletions

View File

@ -848,6 +848,28 @@ public class Options {
} }
}, },
DANCE_CURSOR_TRAIL_OVERRIDE ("Cursor trail length override", "CursorTrailOverride", "Override cursor trail length", Dancer.cursortraillength, 20, 400) {
@Override
public String getValueString() {
if (val == 20) {
return "Disabled";
}
return "" + val;
}
@Override
public void drag(GameContainer container, int d) {
super.drag(container, d);
Dancer.cursortraillength = val;
}
@Override
public void read(String s) {
super.read(s);
Dancer.cursortraillength = 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

@ -122,6 +122,7 @@ public class OptionsMenu extends BasicGameState {
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_CURSOR_INC, GameOption.DANCE_RGB_CURSOR_INC,
GameOption.DANCE_CURSOR_TRAIL_OVERRIDE,
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

@ -186,6 +186,10 @@ public class Cursor {
removeCount = trail.size() - max; removeCount = trail.size() - max;
} }
if (Dancer.cursortraillength > 20) {
removeCount = trail.size() - Dancer.cursortraillength;
}
// remove points from the lists // remove points from the lists
for (int i = 0; i < removeCount && !trail.isEmpty(); i++) for (int i = 0; i < removeCount && !trail.isEmpty(); i++)
trail.remove(); trail.remove();

View File

@ -68,6 +68,7 @@ public class Dancer {
public static int rgbcursorhueinc = 100; // this should really get its own place somewhere... public static int rgbcursorhueinc = 100; // 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;
public static int cursortraillength = 20;
private int dir; private int dir;
private GameObject d = new DummyObject(); private GameObject d = new DummyObject();