Merge branch 'master' into knorkemergingsliders
This commit is contained in:
@@ -56,7 +56,11 @@ import com.sun.jna.platform.win32.Advapi32Util;
|
||||
import com.sun.jna.platform.win32.Win32Exception;
|
||||
import com.sun.jna.platform.win32.WinReg;
|
||||
import yugecin.opsudance.*;
|
||||
import yugecin.opsudance.movers.CubicBezierMover;
|
||||
import yugecin.opsudance.movers.QuadraticBezierMover;
|
||||
import yugecin.opsudance.movers.factories.AutoMoverFactory;
|
||||
import yugecin.opsudance.movers.factories.QuadraticBezierMoverFactory;
|
||||
import yugecin.opsudance.movers.slidermovers.DefaultSliderMoverController;
|
||||
import yugecin.opsudance.spinners.Spinner;
|
||||
import yugecin.opsudance.ui.SBOverlay;
|
||||
|
||||
@@ -623,6 +627,99 @@ public class Options {
|
||||
}
|
||||
},
|
||||
|
||||
DANCE_QUAD_BEZ_AGGRESSIVENESS ("Quadratic Bezier aggressiveness", "QuadBezAgr", "AKA initial D factor", 50, 0, 200) {
|
||||
@Override
|
||||
public String getValueString() {
|
||||
return val + "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drag(GameContainer container, int d) {
|
||||
super.drag(container, d);
|
||||
QuadraticBezierMover.aggressiveness = val;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showCondition() {
|
||||
return Dancer.moverFactories[Dancer.instance.getMoverFactoryIndex()] instanceof QuadraticBezierMoverFactory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(String s) {
|
||||
super.read(s);
|
||||
QuadraticBezierMover.aggressiveness = val;
|
||||
}
|
||||
},
|
||||
|
||||
DANCE_QUAD_BEZ_SLIDER_AGGRESSIVENESS_FACTOR ("Slider exit aggressiveness factor", "CubBezSliderExitAgr", "AKA initial D factor for sliderexits", 40, 10, 60) {
|
||||
@Override
|
||||
public String getValueString() {
|
||||
return val / 10 + "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drag(GameContainer container, int d) {
|
||||
super.drag(container, d);
|
||||
QuadraticBezierMover.sliderExitAggressivenessfactor = val / 10;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showCondition() {
|
||||
return DANCE_QUAD_BEZ_AGGRESSIVENESS.showCondition()
|
||||
&& Dancer.sliderMoverController instanceof DefaultSliderMoverController;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(String s) {
|
||||
super.read(s);
|
||||
QuadraticBezierMover.sliderExitAggressivenessfactor = val / 10;
|
||||
}
|
||||
},
|
||||
|
||||
DANCE_QUAD_BEZ_USE_CUBIC_ON_SLIDERS ("Use cubic bezier before sliders", "QuadBezCubicSliders", "Slider entry looks better using this", true) {
|
||||
@Override
|
||||
public void click(GameContainer container) {
|
||||
super.click(container);
|
||||
QuadraticBezierMoverFactory.cubicForSliderEntries = bool;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showCondition() {
|
||||
return DANCE_QUAD_BEZ_SLIDER_AGGRESSIVENESS_FACTOR.showCondition();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(String s) {
|
||||
super.read(s);
|
||||
QuadraticBezierMoverFactory.cubicForSliderEntries = bool;
|
||||
}
|
||||
},
|
||||
|
||||
DANCE_QUAD_BEZ_CUBIC_AGGRESSIVENESS_FACTOR ("Slider entry aggressiveness factor", "CubBezSliderEntryAgr", "AKA initial D factor for sliderentries", 40, 10, 60) {
|
||||
@Override
|
||||
public String getValueString() {
|
||||
return val / 10 + "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drag(GameContainer container, int d) {
|
||||
super.drag(container, d);
|
||||
CubicBezierMover.aggressivenessfactor = val / 10;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showCondition() {
|
||||
return DANCE_QUAD_BEZ_USE_CUBIC_ON_SLIDERS.showCondition()
|
||||
&& DANCE_QUAD_BEZ_USE_CUBIC_ON_SLIDERS.getBooleanValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(String s) {
|
||||
super.read(s);
|
||||
CubicBezierMover.aggressivenessfactor = val / 10;
|
||||
}
|
||||
},
|
||||
|
||||
DANCE_MOVER_DIRECTION ("Mover direction", "MoverDirection", "The direction the mover goes" ) {
|
||||
@Override
|
||||
public String getValueString() {
|
||||
@@ -1252,6 +1349,13 @@ public class Options {
|
||||
this.type = OptionType.NUMERIC;
|
||||
}
|
||||
|
||||
/**
|
||||
* should the option be shown
|
||||
* @return true if the option should be shown
|
||||
*/
|
||||
public boolean showCondition() {
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* Returns the option name.
|
||||
* @return the name string
|
||||
|
||||
@@ -113,6 +113,10 @@ public class OptionsMenu extends BasicGameState {
|
||||
}),
|
||||
DANCE ("Dance", new GameOption[] {
|
||||
GameOption.DANCE_MOVER,
|
||||
GameOption.DANCE_QUAD_BEZ_AGGRESSIVENESS,
|
||||
GameOption.DANCE_QUAD_BEZ_SLIDER_AGGRESSIVENESS_FACTOR,
|
||||
GameOption.DANCE_QUAD_BEZ_USE_CUBIC_ON_SLIDERS,
|
||||
GameOption.DANCE_QUAD_BEZ_CUBIC_AGGRESSIVENESS_FACTOR,
|
||||
GameOption.DANCE_MOVER_DIRECTION,
|
||||
GameOption.DANCE_SLIDER_MOVER_TYPE,
|
||||
GameOption.DANCE_SPINNER,
|
||||
@@ -277,9 +281,12 @@ public class OptionsMenu extends BasicGameState {
|
||||
if (selectedOption != null) {
|
||||
hoverOption = selectedOption;
|
||||
}
|
||||
for (int i = 0; i < currentTab.options.length; i++) {
|
||||
for (int i = 0, j = 0; i < currentTab.options.length; i++) {
|
||||
GameOption option = currentTab.options[i];
|
||||
drawOption(option, i, hoverOption == option);
|
||||
if (!option.showCondition()) {
|
||||
continue;
|
||||
}
|
||||
drawOption(option, j++, hoverOption == option);
|
||||
}
|
||||
|
||||
// option tabs
|
||||
@@ -602,6 +609,14 @@ public class OptionsMenu extends BasicGameState {
|
||||
if (index >= currentTab.options.length)
|
||||
return null;
|
||||
|
||||
return currentTab.options[index];
|
||||
for (GameOption option : currentTab.options) {
|
||||
if (option.showCondition()) {
|
||||
index--;
|
||||
}
|
||||
if (index < 0) {
|
||||
return option;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user