clean up options

This commit is contained in:
yugecin 2016-12-11 13:25:04 +01:00
parent 5cf0f5bd1f
commit f0c51084d1
16 changed files with 169 additions and 475 deletions

View File

@ -1199,7 +1199,7 @@ public class GameData {
public void sendInitialSliderResult(int time, float x, float y, Color color, Color mirrorcolor) {
hitResultList.add(new HitObjectResult(time, HIT_SLIDER_INITIAL, x, y, color, null, null, true, false));
if (!Dancer.mirror || !GameMod.AUTO.isActive()) {
if (!Options.isMirror() || !GameMod.AUTO.isActive()) {
return;
}
float[] m = Utils.mirrorPoint(x, y);

View File

@ -608,7 +608,6 @@ public class Options {
REPLAY_SEEKING ("Replay Seeking", "ReplaySeeking", "Enable a seeking bar on the left side of the screen during replays.", false),
DISABLE_UPDATER ("Disable Automatic Updates", "DisableUpdater", "Disable automatic checking for updates upon starting opsu!.", false),
ENABLE_WATCH_SERVICE ("Enable Watch Service", "WatchService", "Watch the beatmap directory for changes. Requires a restart.", false),
DANCE_MOVER ("Mover algorithm", "Mover", "Algorithm that decides how to move from note to note" ) {
@Override
public Object[] getListItems() {
@ -636,100 +635,32 @@ public class Options {
Dancer.instance.setMoverFactoryIndex(i);
}
},
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;
}
DANCE_QUAD_BEZ_SLIDER_AGGRESSIVENESS_FACTOR ("Slider exit aggressiveness factor", "CubBezSliderExitAgr", "AKA initial D factor for sliderexits", 4, 1, 6) {
@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;
}
DANCE_QUAD_BEZ_CUBIC_AGGRESSIVENESS_FACTOR ("Slider entry aggressiveness factor", "CubBezSliderEntryAgr", "AKA initial D factor for sliderentries", 4, 1, 6) {
@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() {
@ -756,7 +687,6 @@ public class Options {
Dancer.moverDirection = MoverDirection.values()[Integer.parseInt(s)];
}
},
DANCE_SLIDER_MOVER_TYPE ("Slider mover", "SliderMover", "How to move in sliders") {
@Override
public String getValueString() {
@ -784,7 +714,6 @@ public class Options {
Dancer.sliderMoverController = Dancer.sliderMovers[val = Integer.parseInt(s)];
}
},
DANCE_SPINNER ("Spinner", "Spinner", "Spinner style") {
@Override
public Object[] getListItems() {
@ -811,96 +740,17 @@ public class Options {
Dancer.instance.setSpinnerIndex(Integer.parseInt(s));
}
},
DANCE_SPINNER_DELAY ("Spinner delay", "SpinnerDelay", "Fiddle with this if spinner goes too fast.", Spinner.DELAY, 0, 200) {
DANCE_SPINNER_DELAY ("Spinner delay", "SpinnerDelay", "Fiddle with this if spinner goes too fast.", 3, 0, 20) {
@Override
public String getValueString() {
return String.format("%dms", val / 10);
}
@Override
public void drag(GameContainer container, int d) {
super.drag(container, d);
Spinner.DELAY = val / 10;
}
@Override
public void read(String s) {
super.read(s);
Spinner.DELAY = val / 10;
return String.format("%dms", val);
}
},
DANCE_LAZY_SLIDERS ("Lazy sliders", "LazySliders", "Don't do short sliders", Dancer.LAZY_SLIDERS) {
@Override
public void click(GameContainer container) {
bool = !bool;
Dancer.LAZY_SLIDERS = bool;
}
@Override
public void read(String s) {
super.read(s);
Dancer.LAZY_SLIDERS = bool;
}
},
DANCE_ONLY_CIRCLE_STACKS ("Only circle stacks", "CircleStacks", "Only do circle movement on stacks", AutoMoverFactory.ONLY_CIRCLE_STACKS) {
@Override
public void click(GameContainer container) {
bool = !bool;
AutoMoverFactory.ONLY_CIRCLE_STACKS = bool;
}
@Override
public void read(String s) {
super.read(s);
AutoMoverFactory.ONLY_CIRCLE_STACKS = bool;
}
},
DANCE_CIRCLE_STREAMS ("Circle streams", "CircleStreams", "Make circles while streaming", AutoMoverFactory.CIRCLE_STREAM == 58) {
@Override
public void click(GameContainer container) {
bool = !bool;
AutoMoverFactory.CIRCLE_STREAM = bool ? 58 : 85;
}
@Override
public void read(String s) {
super.read(s);
AutoMoverFactory.CIRCLE_STREAM = bool ? 58 : 85;
}
},
DANCE_MIRROR ("Mirror collage", "MirrorCollage", "Hypnotizing stuff. Toggle this ingame by pressing the M key.", Dancer.mirror) {
@Override
public void click(GameContainer container) {
bool = !bool;
Dancer.mirror = bool;
}
@Override
public void read(String s) {
super.read(s);
Dancer.mirror = bool;
}
},
DANCE_DRAW_APPROACH ("Draw approach circles", "DrawApproach", "Can get a bit busy when using mirror collage", Dancer.drawApproach) {
@Override
public void click(GameContainer container) {
bool = !bool;
Dancer.drawApproach = bool;
}
@Override
public void read(String s) {
super.read(s);
Dancer.drawApproach = bool;
}
},
DANCE_LAZY_SLIDERS ("Lazy sliders", "LazySliders", "Don't do short sliders", false),
DANCE_ONLY_CIRCLE_STACKS ("Only circle stacks", "CircleStacks", "Only do circle movement on stacks", false),
DANCE_CIRCLE_STREAMS ("Circle streams", "CircleStreams", "Make circles while streaming", false),
DANCE_MIRROR ("Mirror collage", "MirrorCollage", "Hypnotizing stuff. Toggle this ingame by pressing the M key.", false),
DANCE_DRAW_APPROACH ("Draw approach circles", "DrawApproach", "Can get a bit busy when using mirror collage", true),
DANCE_OBJECT_COLOR_OVERRIDE ("Object color override", "ObjColorOverride", "Override object colors") {
@Override
public String getValueString() {
@ -927,7 +777,6 @@ public class Options {
Dancer.colorOverride = ObjectColorOverrides.values()[Integer.parseInt(s)];
}
},
DANCE_OBJECT_COLOR_OVERRIDE_MIRRORED ("Collage object color override", "ObjColorMirroredOverride", "Override collage object colors") {
@Override
public String getValueString() {
@ -954,26 +803,12 @@ public class Options {
Dancer.colorMirrorOverride = ObjectColorOverrides.values()[Integer.parseInt(s)];
}
},
DANCE_RGB_OBJECT_INC ("RGB objects increment", "RGBInc", "Amount of hue to shift, used for rainbow object override", Dancer.rgbhueinc, -1800, 1800) {
DANCE_RGB_OBJECT_INC ("RGB objects increment", "RGBInc", "Amount of hue to shift, used for rainbow object override", 70, -1800, 1800) {
@Override
public String getValueString() {
return String.format("%.1f°", val / 10f);
}
@Override
public void drag(GameContainer container, int d) {
super.drag(container, d);
Dancer.rgbhueinc = val;
}
@Override
public void read(String s) {
super.read(s);
Dancer.rgbhueinc = val;
}
},
DANCE_CURSOR_COLOR_OVERRIDE ("Cursor color override", "CursorColorOverride", "Override cursor color") {
@Override
public String getValueString() {
@ -1000,7 +835,6 @@ public class Options {
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() {
@ -1027,41 +861,14 @@ public class Options {
Dancer.cursorColorMirrorOverride = CursorColorOverrides.values()[Integer.parseInt(s)];
}
},
DANCE_CURSOR_ONLY_COLOR_TRAIL ("Only color cursor trail", "OnlyColorTrail", "Don't color the cursor, only the trail", Dancer.onlycolortrail) {
@Override
public void click(GameContainer container) {
bool = !bool;
Dancer.onlycolortrail = bool;
}
@Override
public void read(String s) {
super.read(s);
Dancer.onlycolortrail = bool;
}
},
DANCE_RGB_CURSOR_INC ("RGB cursor increment", "RGBCursorInc", "Amount of hue to shift, used for rainbow cursor override", Dancer.rgbhueinc, -2000, 2000) {
DANCE_CURSOR_ONLY_COLOR_TRAIL ("Only color cursor trail", "OnlyColorTrail", "Don't color the cursor, only the trail", false),
DANCE_RGB_CURSOR_INC ("RGB cursor increment", "RGBCursorInc", "Amount of hue to shift, used for rainbow cursor override", 100, -2000, 2000) {
@Override
public String getValueString() {
return String.format("%.2f°", val / 1000f);
}
@Override
public void drag(GameContainer container, int d) {
super.drag(container, d);
Dancer.rgbcursorhueinc = val;
}
@Override
public void read(String s) {
super.read(s);
Dancer.rgbcursorhueinc = val;
}
},
DANCE_CURSOR_TRAIL_OVERRIDE ("Cursor trail length override", "CursorTrailOverride", "Override cursor trail length", Dancer.cursortraillength, 20, 400) {
DANCE_CURSOR_TRAIL_OVERRIDE ("Cursor trail length override", "CursorTrailOverride", "Override cursor trail length", 20, 20, 400) {
@Override
public String getValueString() {
if (val == 20) {
@ -1069,141 +876,20 @@ public class Options {
}
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) {
@Override
public void click(GameContainer container) {
bool = !bool;
Dancer.hideobjects = bool;
}
@Override
public void read(String s) {
super.read(s);
Dancer.hideobjects = bool;
}
},
DANCE_REMOVE_BG ("Use black background instead of image", "RemoveBG", "Hello darkness my old friend", Dancer.removebg) {
@Override
public void click(GameContainer container) {
bool = !bool;
Dancer.removebg = bool;
}
@Override
public void read(String s) {
super.read(s);
Dancer.removebg = bool;
}
},
DANCE_CIRLCE_IN_SLOW_SLIDERS ("Do circles in slow sliders", "CircleInSlider", "Circle around sliderball in lazy & slow sliders", Pippi.circleSlowSliders) {
@Override
public void click(GameContainer container) {
bool = !bool;
Pippi.circleSlowSliders = bool;
}
@Override
public void read(String s) {
super.read(s);
Pippi.circleSlowSliders = bool;
}
},
DANCE_CIRLCE_IN_LAZY_SLIDERS ("Do circles in lazy sliders", "CircleInLazySlider", "Circle in hitcircle in lazy sliders", Pippi.circleLazySliders) {
@Override
public void click(GameContainer container) {
bool = !bool;
Pippi.circleLazySliders = bool;
}
@Override
public void read(String s) {
super.read(s);
Pippi.circleLazySliders = bool;
}
},
DANCE_HIDE_UI ("Hide all UI", "HideUI", ".", Dancer.hideui) {
@Override
public void click(GameContainer container) {
bool = !bool;
Dancer.hideui = bool;
}
@Override
public void read(String s) {
super.read(s);
Dancer.hideui = bool;
}
},
DANCE_ENABLE_SB ("Enable storyboard editor", "EnableStoryBoard", "Dance storyboard", false) {
@Override
public void click(GameContainer container) {
super.click(container);
SBOverlay.isActive = bool;
}
@Override
public void read(String s) {
super.read(s);
SBOverlay.isActive = bool;
}
},
DANCE_HIDE_WATERMARK ("Hide watermark", "HideWaterMark", "Hide the githublink in the top left corner of the playfield", false) {
@Override
public String getValueString() {
return Dancer.hidewatermark ? "Yes" : "No";
}
@Override
public void click(GameContainer container) {
Dancer.hidewatermark = false;
}
@Override
public boolean showRWM() {
return !Dancer.hidewatermark;
}
},
PIPPI_ENABLE ("Pippi", "Pippi", "Move in circles like dancing pippi (osu! april fools joke 2016)", Pippi.enabled) {
@Override
public void click(GameContainer container) {
bool = !bool;
Pippi.enabled = bool;
}
@Override
public void read(String s) {
super.read(s);
Pippi.enabled = bool;
}
},
PIPPI_RADIUS_PERCENT ("Pippi radius", "PippiRad", "Radius of pippi, percentage of circle radius", 200, 0, 200) {
DANCE_HIDE_OBJECTS ("Don't draw objects", "HideObj", "If you only want to see cursors :)", false),
DANCE_REMOVE_BG ("Use black background instead of image", "RemoveBG", "Hello darkness my old friend", true),
DANCE_CIRLCE_IN_SLOW_SLIDERS ("Do circles in slow sliders", "CircleInSlider", "Circle around sliderball in lazy & slow sliders", false),
DANCE_CIRLCE_IN_LAZY_SLIDERS ("Do circles in lazy sliders", "CircleInLazySlider", "Circle in hitcircle in lazy sliders", false),
DANCE_HIDE_UI ("Hide all UI", "HideUI", ".", true),
DANCE_ENABLE_SB ("Enable storyboard editor", "EnableStoryBoard", "Dance storyboard", false),
DANCE_HIDE_WATERMARK ("Hide watermark", "HideWaterMark", "Hide the githublink in the top left corner of the playfield", false),
PIPPI_ENABLE ("Pippi", "Pippi", "Move in circles like dancing pippi (osu! april fools joke 2016)", false),
PIPPI_RADIUS_PERCENT ("Pippi radius", "PippiRad", "Radius of pippi, percentage of circle radius", 100, 0, 100) {
@Override
public String getValueString() {
return (val / 2) + "%";
}
@Override
public void drag(GameContainer container, int d) {
super.drag(container, d);
@ -1216,72 +902,20 @@ public class Options {
Pippi.setRadiusPercent(val / 2);
}
},
PIPPI_ANGLE_INC_MUL("Pippi angle increment multiplier", "PippiAngIncMul", "How fast pippi's angle increments", Pippi.angleInc, -200, 200) {
PIPPI_ANGLE_INC_MUL("Pippi angle increment multiplier", "PippiAngIncMul", "How fast pippi's angle increments", 10, -200, 200) {
@Override
public String getValueString() {
return String.format("x%.1f", val / 10f);
}
@Override
public void drag(GameContainer container, int d) {
super.drag(container, d);
Pippi.angleInc = val;
}
@Override
public void read(String s) {
super.read(s);
Pippi.angleInc = val;
}
},
PIPPI_ANGLE_INC_MUL_SLIDER ("Pippi angle increment multiplier slider", "PippiAngIncMulSlider", "Same as above, but in sliders", Pippi.angleSliderInc, -200, 200) {
PIPPI_ANGLE_INC_MUL_SLIDER ("Pippi angle increment multiplier slider", "PippiAngIncMulSlider", "Same as above, but in sliders", 50, -200, 200) {
@Override
public String getValueString() {
return String.format("x%.1f", val / 10f);
}
@Override
public void drag(GameContainer container, int d) {
super.drag(container, d);
Pippi.angleSliderInc = val;
}
@Override
public void read(String s) {
super.read(s);
Pippi.angleSliderInc = val;
}
},
PIPPI_SLIDER_FOLLOW_EXPAND ("Followcircle expand", "PippiFollowExpand", "Increase radius in followcircles", Pippi.followcircleExpand) {
@Override
public void click(GameContainer container) {
bool = !bool;
Pippi.followcircleExpand = bool;
}
@Override
public void read(String s) {
super.read(s);
Pippi.followcircleExpand = bool;
}
},
PIPPI_PREVENT_WOBBLY_STREAMS ("Prevent wobbly streams", "PippiPreventWobblyStreams", "Force linear mover while doing streams to prevent wobbly pippi", Pippi.preventWobblyStreams) {
@Override
public void click(GameContainer container) {
bool = !bool;
Pippi.preventWobblyStreams = bool;
}
@Override
public void read(String s) {
super.read(s);
Pippi.preventWobblyStreams = bool;
}
};
PIPPI_SLIDER_FOLLOW_EXPAND ("Followcircle expand", "PippiFollowExpand", "Increase radius in followcircles", false),
PIPPI_PREVENT_WOBBLY_STREAMS ("Prevent wobbly streams", "PippiPreventWobblyStreams", "Force linear mover while doing streams to prevent wobbly pippi", true);
/** Option name. */
@ -1384,8 +1018,6 @@ public class Options {
*/
public String getDescription() { return description; }
public boolean showRWM() { return false; } // this is probably a shitty way to implement this :)
/**
* Returns the boolean value for the option, if applicable.
* @return the boolean value
@ -1697,6 +1329,88 @@ public class Options {
}
}
public static int getQuadBezAggressiveness() {
return GameOption.DANCE_QUAD_BEZ_AGGRESSIVENESS.getIntegerValue();
}
public static int getQuadBezSliderAggressiveness() {
return GameOption.DANCE_QUAD_BEZ_SLIDER_AGGRESSIVENESS_FACTOR.getIntegerValue();
}
public static boolean isQuadBezCubicEnabled() {
return GameOption.DANCE_QUAD_BEZ_USE_CUBIC_ON_SLIDERS.getBooleanValue();
}
public static int getQuadBezSliderEntryAggressiveness() {
return GameOption.DANCE_QUAD_BEZ_CUBIC_AGGRESSIVENESS_FACTOR.getIntegerValue();
}
public static int getSpinnerDelay() {
return GameOption.DANCE_SPINNER_DELAY.getIntegerValue();
}
public static boolean isLazySliders() {
return GameOption.DANCE_LAZY_SLIDERS.getBooleanValue();
}
public static boolean isOnlyCircleStacks() {
return GameOption.DANCE_ONLY_CIRCLE_STACKS.getBooleanValue();
}
public static boolean isCircleStreams() {
return GameOption.DANCE_CIRCLE_STREAMS.getBooleanValue();
}
public static boolean isMirror() {
return GameOption.DANCE_MIRROR.getBooleanValue();
}
public static void setMirror(boolean mirror) {
GameOption.DANCE_MIRROR.setValue(mirror);
}
public static boolean isDrawApproach() {
return GameOption.DANCE_DRAW_APPROACH.getBooleanValue();
}
public static int getRGBObjInc() {
return GameOption.DANCE_RGB_OBJECT_INC.getIntegerValue();
}
public static boolean isCursorOnlyColorTrail() {
return GameOption.DANCE_CURSOR_ONLY_COLOR_TRAIL.getBooleanValue();
}
public static int getRGBCursorInc() {
return GameOption.DANCE_RGB_CURSOR_INC.getIntegerValue();
}
public static int getCursorTrailOverride() {
return GameOption.DANCE_CURSOR_TRAIL_OVERRIDE.getIntegerValue();
}
public static boolean isHideObjects() {
return GameOption.DANCE_HIDE_OBJECTS.getBooleanValue();
}
public static boolean isRemoveBG() {
return GameOption.DANCE_REMOVE_BG.getBooleanValue();
}
public static boolean isCircleInSlowSliders() {
return GameOption.DANCE_CIRLCE_IN_SLOW_SLIDERS.getBooleanValue();
}
public static boolean isCircleInLazySliders() {
return GameOption.DANCE_CIRLCE_IN_LAZY_SLIDERS.getBooleanValue();
}
public static boolean isHideUI() {
return GameOption.DANCE_HIDE_UI.getBooleanValue();
}
public static boolean isEnableSB() {
return GameOption.DANCE_ENABLE_SB.getBooleanValue();
}
public static boolean isHideWM() {
return GameOption.DANCE_HIDE_WATERMARK.getBooleanValue();
}
public static boolean isPippiEnabled() {
return GameOption.PIPPI_ENABLE.getBooleanValue();
}
public static int getPippiAngIncMultiplier() {
return GameOption.PIPPI_ANGLE_INC_MUL.getIntegerValue();
}
public static int getPippiAngIncMultiplierSlider() {
return GameOption.PIPPI_ANGLE_INC_MUL_SLIDER.getIntegerValue();
}
public static boolean isPippiFollowcircleExpand() {
return GameOption.PIPPI_SLIDER_FOLLOW_EXPAND.getBooleanValue();
}
public static boolean isPippiPreventWobblyStreams() {
return GameOption.PIPPI_PREVENT_WOBBLY_STREAMS.getBooleanValue();
}
/**
* Returns whether or not fullscreen mode is enabled.
* @return true if enabled

View File

@ -130,7 +130,7 @@ public class Circle extends GameObject {
float oldAlpha = Colors.WHITE_FADE.a;
Colors.WHITE_FADE.a = color.a = alpha;
if (timeDiff >= 0 && !GameMod.HIDDEN.isActive() && Dancer.drawApproach)
if (timeDiff >= 0 && !GameMod.HIDDEN.isActive() && Options.isDrawApproach())
GameImage.APPROACHCIRCLE.getImage().getScaledCopy(approachScale).drawCentered(x, y, color);
GameImage.HITCIRCLE.getImage().drawCentered(x, y, color);
boolean overlayAboveNumber = Options.getSkin().isHitCircleOverlayAboveNumber();
@ -196,7 +196,7 @@ public class Circle extends GameObject {
if (trackPosition > time + hitResultOffset[GameData.HIT_50]) {
if (isAutoMod) {// "auto" mod: catch any missed notes due to lag
data.hitResult(time, GameData.HIT_300, x, y, color, comboEnd, hitObject, HitObjectType.CIRCLE, true, 0, null, false);
if (Dancer.mirror && GameMod.AUTO.isActive()) {
if (Options.isMirror() && GameMod.AUTO.isActive()) {
float[] m = Utils.mirrorPoint(x, y);
data.hitResult(time, GameData.HIT_300, m[0], m[1], mirrorColor, comboEnd, hitObject, HitObjectType.CIRCLE, true, 0, null, false, false);
}
@ -211,7 +211,7 @@ public class Circle extends GameObject {
else if (isAutoMod) {
if (Math.abs(trackPosition - time) < hitResultOffset[GameData.HIT_300]) {
data.hitResult(time, GameData.HIT_300, x, y, color, comboEnd, hitObject, HitObjectType.CIRCLE, true, 0, null, false);
if (Dancer.mirror && GameMod.AUTO.isActive()) {
if (Options.isMirror() && GameMod.AUTO.isActive()) {
float[] m = Utils.mirrorPoint(x, y);
data.hitResult(time, GameData.HIT_300, m[0], m[1], mirrorColor, comboEnd, hitObject, HitObjectType.CIRCLE, true, 0, null, false, false);
}

View File

@ -311,7 +311,7 @@ public class Slider extends GameObject {
if (mirror) {
g.rotate(x, y, -180f);
}
if (!GameMod.HIDDEN.isActive() && Dancer.drawApproach) {
if (!GameMod.HIDDEN.isActive() && Options.isDrawApproach()) {
GameImage.APPROACHCIRCLE.getImage().getScaledCopy(approachScale).drawCentered(x, y, color);
}
g.popTransform();
@ -516,7 +516,7 @@ public class Slider extends GameObject {
data.hitResult(hitObject.getTime() + (int) sliderTimeTotal, result,
cx, cy, color, comboEnd, hitObject, type, sliderHeldToEnd,
currentRepeats + 1, curve, sliderHeldToEnd);
if (Dancer.mirror && GameMod.AUTO.isActive()) {
if (Options.isMirror() && GameMod.AUTO.isActive()) {
float[] m = Utils.mirrorPoint(cx, cy);
data.hitResult(hitObject.getTime() + (int) sliderTimeTotal, result,
m[0], m[1], mirrorColor, comboEnd, hitObject, type, sliderHeldToEnd,

View File

@ -394,7 +394,7 @@ public class Game extends BasicGameState {
}
// background
if (!Dancer.removebg && GameMod.AUTO.isActive()) {
if (!Options.isRemoveBG() && GameMod.AUTO.isActive()) {
float dimLevel = Options.getBackgroundDim();
if (trackPosition < firstObjectTime) {
if (timeDiff < approachTime)
@ -508,7 +508,7 @@ public class Game extends BasicGameState {
Colors.BLACK_ALPHA.a = a;
}
if (!Dancer.hideui || !GameMod.AUTO.isActive()) {
if (!Options.isHideUI() || !GameMod.AUTO.isActive()) {
data.drawGameElements(g, true, objectIndex == 0);
}
@ -546,7 +546,7 @@ public class Game extends BasicGameState {
// non-break
else {
if (!GameMod.AUTO.isActive() || !Dancer.hideui) {
if (!GameMod.AUTO.isActive() || !Options.isHideUI()) {
// game elements
data.drawGameElements(g, false, objectIndex == 0);
@ -670,11 +670,11 @@ public class Game extends BasicGameState {
}
}
if (!Dancer.hideui && GameMod.AUTO.isActive())
if (!Options.isHideUI() && GameMod.AUTO.isActive())
GameImage.UNRANKED.getImage().drawCentered(width / 2, height * 0.077f);
// draw replay speed button
if (isReplay || (!Dancer.hideui && GameMod.AUTO.isActive()))
if (isReplay || (!Options.isHideUI()&& GameMod.AUTO.isActive()))
playbackSpeed.getButton().draw();
// draw music position bar (for replay seeking)
@ -709,7 +709,7 @@ public class Game extends BasicGameState {
UI.draw(g, replayX, replayY, replayKeyPressed);
else if (GameMod.AUTO.isActive()) {
UI.draw(g, (int) autoMousePosition.x, (int) autoMousePosition.y, autoMousePressed);
if (Dancer.mirror && GameMod.AUTO.isActive()) {
if (Options.isMirror() && GameMod.AUTO.isActive()) {
double dx = autoMousePosition.x - Options.width / 2d;
double dy = autoMousePosition.y - Options.height / 2d;
double d = Math.sqrt(dx * dx + dy * dy);
@ -724,7 +724,7 @@ public class Game extends BasicGameState {
sbOverlay.render(container, g);
if (!Dancer.hidewatermark) {
if (!Options.isHideWM()) {
Fonts.SMALL.drawString(0.3f, 0.3f, "opsu!dance " + Updater.get().getCurrentVersion() + " by robin_be | https://github.com/yugecin/opsu-dance");
}
}
@ -851,7 +851,7 @@ public class Game extends BasicGameState {
}
// update in-game scoreboard
if (!Dancer.hideui && previousScores != null && trackPosition > firstObjectTime) {
if (!Options.isHideUI() && previousScores != null && trackPosition > firstObjectTime) {
// show scoreboard if selected, and always in break
if (scoreboardVisible || breakTime > 0) {
currentScoreboardAlpha += 1f / SCOREBOARD_FADE_IN_TIME * delta;
@ -1033,7 +1033,7 @@ public class Game extends BasicGameState {
objectIndex++; // done, so increment object index
sbOverlay.updateIndex(objectIndex);
if (objectIndex >= mirrorTo) {
Dancer.mirror = false;
Options.setMirror(false);
}
} else
break;
@ -1148,30 +1148,30 @@ public class Game extends BasicGameState {
Utils.takeScreenShot();
break;
case Input.KEY_TAB:
if (!Dancer.hideui) {
if (!Options.isHideUI()) {
scoreboardVisible = !scoreboardVisible;
}
break;
case Input.KEY_M:
if (Dancer.mirror) {
if (Options.isMirror()) {
mirrorTo = objectIndex;
Dancer.mirror = false;
Options.setMirror(false);
} else {
mirrorCursor.resetLocations();
mirrorFrom = objectIndex;
mirrorTo = gameObjects.length;
Dancer.mirror = true;
Options.setMirror(true);
}
break;
case Input.KEY_P:
if (Dancer.mirror) {
if (Options.isMirror()) {
mirrorTo = objectIndex;
Dancer.mirror = false;
Options.setMirror(false);
} else {
mirrorCursor.resetLocations();
mirrorFrom = objectIndex;
mirrorTo = mirrorFrom + 1;
Dancer.mirror = true;
Options.setMirror(true);
}
break;
case Input.KEY_MINUS:
@ -1623,7 +1623,7 @@ public class Game extends BasicGameState {
stack.add(index);
// draw follow points
if (!Options.isFollowPointEnabled() || loseState)
if (!Options.isFollowPointEnabled() || loseState || !Options.isHideObjects())
continue;
if (beatmap.objects[index].isSpinner()) {
lastObjectIndex = -1;
@ -1688,9 +1688,9 @@ public class Game extends BasicGameState {
// normal case
if (!loseState) {
if (!Dancer.hideobjects) {
if (!Options.isHideObjects()) {
gameObj.draw(g, trackPosition, false);
if (Dancer.mirror && GameMod.AUTO.isActive() && idx < mirrorTo && idx >= mirrorFrom) {
if (Options.isMirror() && GameMod.AUTO.isActive() && idx < mirrorTo && idx >= mirrorFrom) {
g.pushTransform();
g.rotate(Options.width / 2f, Options.height / 2f, 180f);
gameObj.draw(g, trackPosition, true);
@ -1730,7 +1730,7 @@ public class Game extends BasicGameState {
}
// draw result objects
if (!Dancer.hideobjects) {
if (!Options.isHideObjects()) {
data.drawHitResults(trackPosition);
}
}

View File

@ -200,9 +200,9 @@ public class Cursor {
// draw the other components
if (newStyle && skin.isCursorRotated())
cursor.setRotation(cursorAngle);
cursor.drawCentered(mouseX, mouseY, Dancer.onlycolortrail ? Color.white : filter);
cursor.drawCentered(mouseX, mouseY, Options.isCursorOnlyColorTrail() ? Color.white : filter);
if (hasMiddle)
cursorMiddle.drawCentered(mouseX, mouseY, Dancer.onlycolortrail ? Color.white : filter);
cursorMiddle.drawCentered(mouseX, mouseY, Options.isCursorOnlyColorTrail() ? Color.white : filter);
}
/**
@ -231,8 +231,9 @@ public class Cursor {
removeCount = trail.size() - max;
}
if (Dancer.cursortraillength > 20) {
removeCount = trail.size() - Dancer.cursortraillength;
int cursortraillength = Options.getCursorTrailOverride();
if (cursortraillength > 20) {
removeCount = trail.size() - cursortraillength;
}
// remove points from the lists

View File

@ -17,6 +17,7 @@
*/
package yugecin.opsudance;
import itdelatrisu.opsu.Options;
import itdelatrisu.opsu.ui.Cursor;
import org.newdawn.slick.Color;
@ -110,12 +111,12 @@ public enum CursorColorOverrides {
}
private static Color nextRainbowColor() {
hue += Dancer.rgbcursorhueinc / 1000f;
hue += Options.getRGBCursorInc() / 1000f;
return new Color(java.awt.Color.getHSBColor(hue / 360f, 1.0f, 1.0f).getRGB());
}
private static Color nextMirrorRainbowColor() {
hue += Dancer.rgbcursorhueinc / 1000f;
hue += Options.getRGBCursorInc() / 1000f;
return new Color(java.awt.Color.getHSBColor((hue + 180f) / 360f, 1.0f, 1.0f).getRGB());
}

View File

@ -20,7 +20,6 @@ package yugecin.opsudance;
import awlex.ospu.movers.factories.CenterSpiralMoverFactory;
import awlex.ospu.movers.factories.SpiralMoverFactory;
import awlex.ospu.polymover.factory.ArcFactory;
import awlex.ospu.polymover.factory.LinearFactory;
import awlex.ospu.polymover.factory.PolyMoverFactory;
import awlex.ospu.spinners.SpiralSpinner;
import itdelatrisu.opsu.Options;
@ -85,21 +84,11 @@ public class Dancer {
public static Dancer instance = new Dancer();
public static boolean multipoint = false;
public static boolean mirror = false; // this should really get its own place somewhere...
public static boolean drawApproach = true; // this should really get its own place somewhere...
public static boolean removebg = true; // this should really get its own place somewhere...
public static boolean hideui = true; // this should really get its own place somewhere...
public static ObjectColorOverrides colorOverride = ObjectColorOverrides.NONE;
public static ObjectColorOverrides colorMirrorOverride = ObjectColorOverrides.NONE;
public static int rgbhueinc = 70; // this should really get its own place somewhere...
public static CursorColorOverrides cursorColorOverride = CursorColorOverrides.NONE;
public static CursorColorOverrides cursorColorMirrorOverride = CursorColorOverrides.NONE;
public static int rgbcursorhueinc = 100; // this should really get its own place somewhere...
public static MoverDirection moverDirection = MoverDirection.RANDOM;
public static boolean hideobjects = false;
public static int cursortraillength = 20;
public static boolean hidewatermark = false;
public static boolean onlycolortrail = false;
private int dir;
public static final GameObject d = new DummyObject();
@ -120,8 +109,6 @@ public class Dancer {
private boolean isCurrentLazySlider;
public static boolean LAZY_SLIDERS;
public Dancer() {
moverFactory = moverFactories[0];
spinner = spinners[0];
@ -205,7 +192,7 @@ public class Dancer {
}
isCurrentLazySlider = false;
// detect lazy sliders, should work pretty good
if (c.isSlider() && LAZY_SLIDERS && Utils.distance(c.start.x, c.start.y, c.end.x, c.end.y) <= Circle.diameter * 0.8f) {
if (c.isSlider() && Options.isLazySliders() && Utils.distance(c.start.x, c.start.y, c.end.x, c.end.y) <= Circle.diameter * 0.8f) {
Slider s = (Slider) c;
Vec2f mid = s.getCurve().pointAt(1f);
if (s.getRepeats() == 1 || Utils.distance(c.start.x, c.start.y, mid.x, mid.y) <= Circle.diameter * 0.8f) {

View File

@ -17,6 +17,7 @@
*/
package yugecin.opsudance;
import itdelatrisu.opsu.Options;
import org.newdawn.slick.Color;
public enum ObjectColorOverrides {
@ -94,7 +95,7 @@ public enum ObjectColorOverrides {
}
private static Color nextRainbowColor() {
hue += Dancer.rgbhueinc / 10f;
hue += Options.getRGBObjInc() / 10f;
return new Color(java.awt.Color.getHSBColor(hue / 360f, 1.0f, 1.0f).getRGB());
}

View File

@ -17,6 +17,7 @@
*/
package yugecin.opsudance;
import itdelatrisu.opsu.Options;
import itdelatrisu.opsu.objects.Circle;
import itdelatrisu.opsu.objects.GameObject;
import itdelatrisu.opsu.objects.Slider;
@ -27,14 +28,7 @@ public class Pippi {
private static int currentdelta;
private static final int targetdelta = 4;
public static boolean enabled = false;
private static int radiusPercent;
public static int angleInc = 10;
public static int angleSliderInc = 50;
public static boolean preventWobblyStreams = true;
public static boolean followcircleExpand = true;
public static boolean circleSlowSliders = false;
public static boolean circleLazySliders = false;
private static double pippirad;
private static double pippiminrad;
@ -54,19 +48,19 @@ public class Pippi {
}
public static void dance(int time, GameObject c, boolean isCurrentLazySlider) {
boolean slowSlider = circleSlowSliders && c.isSlider() && (((((Slider) c).pixelLength < 200 || c.getEndTime() - c.getTime() > 400)) || isCurrentLazySlider);
boolean slowSlider = Options.isCircleInSlowSliders() && c.isSlider() && (((((Slider) c).pixelLength < 200 || c.getEndTime() - c.getTime() > 400)) || isCurrentLazySlider);
if (!slowSlider) {
slowSlider = circleLazySliders && isCurrentLazySlider;
slowSlider = Options.isCircleInLazySliders() && isCurrentLazySlider;
}
if ((!enabled || c.isSpinner()) && !slowSlider) {
if ((!Options.isPippiEnabled() || c.isSpinner()) && !slowSlider) {
return;
}
if (currentdelta >= targetdelta && c != previous) {
currentdelta = 0;
if (c.isSlider() && c.getTime() < time) {
angle += angleSliderInc / 1800d * Math.PI;
angle += Options.getPippiAngIncMultiplierSlider() / 1800d * Math.PI;
if (!slowSlider) {
if (followcircleExpand) {
if (Options.isPippiFollowcircleExpand()) {
if (c.getEndTime() - time < 40 && pippirad > pippimaxrad) {
pippirad -= 5d;
} else if (time - c.getTime() > 10 && c.getEndTime() - c.getTime() > 600 && pippirad < pippimaxrad) {
@ -75,10 +69,10 @@ public class Pippi {
}
}
} else if (!c.isSpinner()) {
if (followcircleExpand && pippirad != pippiminrad) {
if (Options.isPippiFollowcircleExpand() && pippirad != pippiminrad) {
pippirad = pippiminrad;
}
angle += angleInc / 1800d * Math.PI;
angle += Options.getPippiAngIncMultiplier() / 1800d * Math.PI;
}
// don't inc on long movements
if (c.getTime() - time > 400) {
@ -97,7 +91,7 @@ public class Pippi {
}
public static boolean shouldPreventWobblyStream(double distance) {
return enabled && distance < Circle.diameter * 0.93f && preventWobblyStreams;
return Options.isPippiEnabled() && distance < Circle.diameter * 0.93f && Options.isPippiPreventWobblyStreams();
}
}

View File

@ -17,6 +17,7 @@
*/
package yugecin.opsudance.movers;
import itdelatrisu.opsu.Options;
import itdelatrisu.opsu.Utils;
import itdelatrisu.opsu.objects.GameObject;
import itdelatrisu.opsu.objects.Slider;
@ -26,8 +27,6 @@ import java.awt.*;
public class CubicBezierMover extends Mover {
public static int aggressivenessfactor = 4;
private static Point p2 = new Point(0, 0);
private static Point p1 = new Point(0, 0);
@ -42,7 +41,7 @@ public class CubicBezierMover extends Mover {
double ang = s.getCurve().getStartAngle() * Math.PI / 180d + Math.PI;
Vec2f nextpos = s.getPointAt(s.getTime() + 10);
double dist = Utils.distance(end.start.x, end.start.y, nextpos.x, nextpos.y);
double speed = dist * QuadraticBezierMover.aggressiveness * aggressivenessfactor / 10;
double speed = dist * Options.getQuadBezAggressiveness() * Options.getQuadBezSliderEntryAggressiveness() / 10;
p2.x = (int) (end.start.x + Math.cos(ang) * speed);
p2.y = (int) (end.start.y + Math.sin(ang) * speed);
}

View File

@ -17,6 +17,7 @@
*/
package yugecin.opsudance.movers;
import itdelatrisu.opsu.Options;
import itdelatrisu.opsu.Utils;
import itdelatrisu.opsu.objects.GameObject;
@ -24,8 +25,6 @@ import java.awt.*;
public class QuadraticBezierMover extends Mover {
public static int sliderExitAggressivenessfactor = 4;
public static int aggressiveness = 50;
public static Point p;
private static double prevspeed;
@ -35,7 +34,7 @@ public class QuadraticBezierMover extends Mover {
}
public static void setPrevspeed(double distance, int timedelta) {
prevspeed = distance * aggressiveness * sliderExitAggressivenessfactor / timedelta;
prevspeed = distance * Options.getQuadBezAggressiveness() * Options.getQuadBezSliderAggressiveness() / timedelta;
}
public static double getPrevspeed() {
@ -54,7 +53,7 @@ public class QuadraticBezierMover extends Mover {
double dist = Utils.distance(startX, startY, endX, endY);
p.x = (int) (startX + Math.cos(startAngle) * prevspeed);
p.y = (int) (startY + Math.sin(startAngle) * prevspeed);
prevspeed = (dist / totalTime) * aggressiveness;
prevspeed = (dist / totalTime) * Options.getQuadBezSliderAggressiveness();
}
@Override

View File

@ -27,8 +27,6 @@ import yugecin.opsudance.movers.*;
public class AutoMoverFactory implements MoverFactory {
public static boolean ONLY_CIRCLE_STACKS = false;
public static int CIRCLE_STREAM = 58;
private int starttime;
private int endtime;
protected Mover m;
@ -44,7 +42,8 @@ public class AutoMoverFactory implements MoverFactory {
}
// stacked: circles if not too quick
if (distance < Circle.diameter && ((dt > CIRCLE_STREAM && !ONLY_CIRCLE_STACKS) || distance < HitObject.getStackOffset() * 5.2f)) { // TODO get the correct multiplier for stackoffsets
int circle_stream = Options.isCircleStreams() ? 58: 85;
if (distance < Circle.diameter && ((dt > circle_stream && !Options.isOnlyCircleStacks()) || distance < HitObject.getStackOffset() * 5.2f)) { // TODO get the correct multiplier for stackoffsets
return new CircleMover(start, end, dir);
}

View File

@ -17,6 +17,7 @@
*/
package yugecin.opsudance.movers.factories;
import itdelatrisu.opsu.Options;
import itdelatrisu.opsu.objects.GameObject;
import yugecin.opsudance.movers.CubicBezierMover;
import yugecin.opsudance.movers.Mover;
@ -24,11 +25,9 @@ import yugecin.opsudance.movers.QuadraticBezierMover;
public class QuadraticBezierMoverFactory implements MoverFactory {
public static boolean cubicForSliderEntries = true;
@Override
public Mover create(GameObject start, GameObject end, int dir) {
if (cubicForSliderEntries && end.isSlider()) {
if (Options.isQuadBezCubicEnabled() && end.isSlider()) {
return new CubicBezierMover(start, end, dir);
}
return new QuadraticBezierMover(start, end, dir);

View File

@ -17,13 +17,14 @@
*/
package yugecin.opsudance.spinners;
import itdelatrisu.opsu.Options;
public abstract class Spinner {
private double[][] points;
private int length;
private int index;
private static int delay;
public static int DELAY = 3;
public static double PROGRESS;
public abstract void init();
@ -41,7 +42,7 @@ public abstract class Spinner {
}
public boolean waitForDelay() {
if (delay >= DELAY) {
if (delay >= Options.getSpinnerDelay()) {
delay = 0;
return true;
}

View File

@ -94,7 +94,6 @@ public class SBOverlay implements OptionsOverlay.Parent {
};
private final static List<GameOption> optionList = new ArrayList<>();
public static boolean isActive = false;
private boolean hide;
private boolean menu;
@ -129,7 +128,7 @@ public class SBOverlay implements OptionsOverlay.Parent {
}
public void render(GameContainer container, Graphics g) {
if (!isActive || hide) {
if (!Options.isEnableSB() || hide) {
return;
}
int lh = Fonts.SMALL.getLineHeight();
@ -161,13 +160,13 @@ public class SBOverlay implements OptionsOverlay.Parent {
}
public void update(int delta, int mouseX, int mouseY) {
if (isActive && menu) {
if (Options.isEnableSB() && menu) {
overlay.update(delta, mouseX, mouseY);
}
}
public boolean keyPressed(int key, char c) {
if (!isActive) {
if (!Options.isEnableSB()) {
return false;
}
if (menu && overlay.keyPressed(key, c)) {