add to option menu

This commit is contained in:
yugecin 2016-09-30 21:45:19 +02:00
parent daa7bec0da
commit 043237d1a1
3 changed files with 36 additions and 2 deletions

View File

@ -55,6 +55,7 @@ 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.movers.factories.AutoMoverFactory;
@ -571,6 +572,33 @@ public class Options {
}
},
DANCE_MOVER_DIRECTION ("Mover direction", "MoverDirection", "The direction the mover goes" ) {
@Override
public String getValueString() {
return Dancer.moverDirection.toString();
}
@Override
public Object[] getListItems() {
return MoverDirection.values();
}
@Override
public void clickListItem(int index) {
Dancer.moverDirection = MoverDirection.values()[index];
}
@Override
public String write() {
return "" + Dancer.moverDirection.nr;
}
@Override
public void read(String s) {
Dancer.moverDirection = MoverDirection.values()[Integer.parseInt(s)];
}
},
DANCE_SPINNER ("Spinner", "Spinner", "Spinner style") {
@Override
public Object[] getListItems() {

View File

@ -107,6 +107,7 @@ public class OptionsMenu extends BasicGameState {
}),
DANCE ("Dance", new GameOption[] {
GameOption.DANCE_MOVER,
GameOption.DANCE_MOVER_DIRECTION,
GameOption.DANCE_SPINNER,
GameOption.DANCE_LAZY_SLIDERS,
GameOption.DANCE_CIRCLE_STREAMS,

View File

@ -30,7 +30,7 @@ public enum MoverDirection {
RIGHT ("Right", 1) {
@Override
public int getDirection(int currentDirection) {
return 0;
return -1;
}
},
ALTERNATE ("Alternate", 2) {
@ -50,7 +50,7 @@ public enum MoverDirection {
};
public String displayName;
private int nr;
public int nr;
private static Random rand;
@ -65,4 +65,9 @@ public enum MoverDirection {
public abstract int getDirection(int currentDirection);
@Override
public String toString() {
return displayName;
}
}