clean up options
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user