Merge branch 'spinners' into master
This commit is contained in:
commit
376cb558cb
|
@ -56,6 +56,7 @@ import com.sun.jna.platform.win32.Win32Exception;
|
||||||
import com.sun.jna.platform.win32.WinReg;
|
import com.sun.jna.platform.win32.WinReg;
|
||||||
import yugecin.opsudance.*;
|
import yugecin.opsudance.*;
|
||||||
import yugecin.opsudance.movers.factories.AutoMoverFactory;
|
import yugecin.opsudance.movers.factories.AutoMoverFactory;
|
||||||
|
import yugecin.opsudance.spinners.Spinner;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles all user options.
|
* Handles all user options.
|
||||||
|
@ -632,6 +633,25 @@ public class Options {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
DANCE_SPINNER_DELAY ("Spinner delay", "SpinnerDelay", "Fiddle with this if spinner goes too fast. Some spinners don't use delays.", Spinner.DELAY, 0, 20) {
|
||||||
|
@Override
|
||||||
|
public String getValueString() {
|
||||||
|
return String.format("%d frames", val);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drag(GameContainer container, int d) {
|
||||||
|
super.drag(container, d);
|
||||||
|
Spinner.DELAY = val;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void read(String s) {
|
||||||
|
super.read(s);
|
||||||
|
Spinner.DELAY = val;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
DANCE_LAZY_SLIDERS ("Lazy sliders", "LazySliders", "Don't do short sliders", Dancer.LAZY_SLIDERS) {
|
DANCE_LAZY_SLIDERS ("Lazy sliders", "LazySliders", "Don't do short sliders", Dancer.LAZY_SLIDERS) {
|
||||||
@Override
|
@Override
|
||||||
public void click(GameContainer container) {
|
public void click(GameContainer container) {
|
||||||
|
|
|
@ -109,6 +109,7 @@ public class OptionsMenu extends BasicGameState {
|
||||||
GameOption.DANCE_MOVER,
|
GameOption.DANCE_MOVER,
|
||||||
GameOption.DANCE_MOVER_DIRECTION,
|
GameOption.DANCE_MOVER_DIRECTION,
|
||||||
GameOption.DANCE_SPINNER,
|
GameOption.DANCE_SPINNER,
|
||||||
|
GameOption.DANCE_SPINNER_DELAY,
|
||||||
GameOption.DANCE_LAZY_SLIDERS,
|
GameOption.DANCE_LAZY_SLIDERS,
|
||||||
GameOption.DANCE_CIRCLE_STREAMS,
|
GameOption.DANCE_CIRCLE_STREAMS,
|
||||||
GameOption.DANCE_ONLY_CIRCLE_STACKS,
|
GameOption.DANCE_ONLY_CIRCLE_STACKS,
|
||||||
|
|
|
@ -22,6 +22,7 @@ public abstract class Spinner {
|
||||||
private double[][] points;
|
private double[][] points;
|
||||||
private int length;
|
private int length;
|
||||||
private int index;
|
private int index;
|
||||||
|
private int delay;
|
||||||
public static int DELAY = 3;
|
public static int DELAY = 3;
|
||||||
|
|
||||||
public abstract void init();
|
public abstract void init();
|
||||||
|
@ -32,7 +33,10 @@ public abstract class Spinner {
|
||||||
}
|
}
|
||||||
|
|
||||||
public double[] getPoint() {
|
public double[] getPoint() {
|
||||||
index = ++index % length;
|
if (delay++ < DELAY) {
|
||||||
|
index = ++index % length;
|
||||||
|
delay = 0;
|
||||||
|
}
|
||||||
return points[index];
|
return points[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user