simplify access to display width and height and halves
This commit is contained in:
parent
27bbc874da
commit
d412a2e39e
|
@ -9,7 +9,7 @@ import itdelatrisu.opsu.objects.curves.Vec2f;
|
||||||
import org.newdawn.slick.Color;
|
import org.newdawn.slick.Color;
|
||||||
import org.newdawn.slick.Graphics;
|
import org.newdawn.slick.Graphics;
|
||||||
|
|
||||||
import static yugecin.opsudance.core.InstanceContainer.displayContainer;
|
import static yugecin.opsudance.core.InstanceContainer.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is just a dummy {@link GameObject} to place in the middle of 2 GameObjects.
|
* This class is just a dummy {@link GameObject} to place in the middle of 2 GameObjects.
|
||||||
|
@ -23,8 +23,8 @@ public class FakeGameObject extends GameObject {
|
||||||
public FakeGameObject() {
|
public FakeGameObject() {
|
||||||
this.start = new Vec2f();
|
this.start = new Vec2f();
|
||||||
this.end = new Vec2f();
|
this.end = new Vec2f();
|
||||||
this.start.x = this.end.x = displayContainer.width / 2;
|
this.start.x = this.end.x = width2;
|
||||||
this.start.y = this.end.y = displayContainer.height / 2;
|
this.start.y = this.end.y = height2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public FakeGameObject(GameObject start, GameObject end) {
|
public FakeGameObject(GameObject start, GameObject end) {
|
||||||
|
|
|
@ -131,6 +131,6 @@ public class CombinedSpiralMover extends Mover {
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean checkBounds(double[] pos) {
|
private boolean checkBounds(double[] pos) {
|
||||||
return 0 < pos[0] && pos[0] < displayContainer.width && 0 < pos[1] && pos[1] < displayContainer.height;
|
return 0 < pos[0] && pos[0] < width && 0 < pos[1] && pos[1] < height;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ import yugecin.opsudance.movers.Mover;
|
||||||
import awlex.ospu.movers.SpiralToMover;
|
import awlex.ospu.movers.SpiralToMover;
|
||||||
import yugecin.opsudance.movers.factories.MoverFactory;
|
import yugecin.opsudance.movers.factories.MoverFactory;
|
||||||
|
|
||||||
import static yugecin.opsudance.core.InstanceContainer.displayContainer;
|
import static yugecin.opsudance.core.InstanceContainer.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by Alex Wieser on 09.10.2016.
|
* Created by Alex Wieser on 09.10.2016.
|
||||||
|
@ -88,7 +88,7 @@ public class SpiralMoverFactory implements MoverFactory {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private boolean checkBounds(double[] pos) {
|
private boolean checkBounds(double[] pos) {
|
||||||
return 0 < pos[0] && pos[0] < displayContainer.width && 0 < pos[1] && pos[1] < displayContainer.height;
|
return 0 < pos[0] && pos[0] < width && 0 < pos[1] && pos[1] < height;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -43,18 +43,16 @@ public class SpiralSpinner extends Spinner {
|
||||||
double ang;
|
double ang;
|
||||||
double rad;
|
double rad;
|
||||||
for (int i = 0; i < SIZE / 2; i++) {
|
for (int i = 0; i < SIZE / 2; i++) {
|
||||||
MAX_RAD = (int) (displayContainer.height * .35);
|
MAX_RAD = (int) (height * .35);
|
||||||
ang = (DENSITY * (Math.PI / SIZE) * i);
|
ang = (DENSITY * (Math.PI / SIZE) * i);
|
||||||
rad = (MAX_RAD / (SIZE / 2)) * i;
|
rad = (MAX_RAD / (SIZE / 2)) * i;
|
||||||
int offsetX = displayContainer.width / 2;
|
|
||||||
int offsetY = displayContainer.height / 2;
|
|
||||||
points[SIZE / 2 - 1 - i] = new double[]{
|
points[SIZE / 2 - 1 - i] = new double[]{
|
||||||
offsetX + rad * Math.cos(ang),
|
width2 + rad * Math.cos(ang),
|
||||||
offsetY + rad * Math.sin(ang)
|
height2 + rad * Math.sin(ang)
|
||||||
};
|
};
|
||||||
points[SIZE / 2 + i] = new double[]{
|
points[SIZE / 2 + i] = new double[]{
|
||||||
offsetX + rad * (Math.cos(ang) * Math.cos(Math.PI) - Math.sin(ang) * Math.sin(Math.PI)),
|
width2 + rad * (Math.cos(ang) * Math.cos(Math.PI) - Math.sin(ang) * Math.sin(Math.PI)),
|
||||||
offsetY + rad * -Math.sin(ang)
|
height2 + rad * -Math.sin(ang)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -84,12 +82,12 @@ public class SpiralSpinner extends Spinner {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void rotatePointAroundCenter(double[] point, double beta) {
|
private void rotatePointAroundCenter(double[] point, double beta) {
|
||||||
double angle = Math.atan2(point[1] - displayContainer.height / 2, point[0] - displayContainer.width / 2);
|
double angle = Math.atan2(point[1] - height2, point[0] - width2);
|
||||||
double rad = Utils.distance(point[0], point[1], displayContainer.width / 2, displayContainer.height / 2);
|
double rad = Utils.distance(point[0], point[1], width2, height2);
|
||||||
|
|
||||||
//rotationMatrix
|
//rotationMatrix
|
||||||
point[0] = displayContainer.width / 2 + rad * (Math.cos(angle) * Math.cos(beta) - Math.sin(angle) * Math.sin(beta));
|
point[0] = width2 + rad * (Math.cos(angle) * Math.cos(beta) - Math.sin(angle) * Math.sin(beta));
|
||||||
point[1] = displayContainer.height / 2 + rad * (Math.cos(angle) * Math.sin(beta) + Math.sin(angle) * Math.cos(beta));
|
point[1] = height2 + rad * (Math.cos(angle) * Math.sin(beta) + Math.sin(angle) * Math.cos(beta));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -603,8 +603,6 @@ public class GameData {
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public void drawGameElements(Graphics g, boolean breakPeriod, boolean firstObject, float alpha) {
|
public void drawGameElements(Graphics g, boolean breakPeriod, boolean firstObject, float alpha) {
|
||||||
int width = displayContainer.width;
|
|
||||||
int height = displayContainer.height;
|
|
||||||
boolean relaxAutoPilot = (GameMod.RELAX.isActive() || GameMod.AUTOPILOT.isActive());
|
boolean relaxAutoPilot = (GameMod.RELAX.isActive() || GameMod.AUTOPILOT.isActive());
|
||||||
int margin = (int) (width * 0.008f);
|
int margin = (int) (width * 0.008f);
|
||||||
float uiScale = GameImage.getUIscale();
|
float uiScale = GameImage.getUIscale();
|
||||||
|
@ -796,9 +794,6 @@ public class GameData {
|
||||||
* @param beatmap the beatmap
|
* @param beatmap the beatmap
|
||||||
*/
|
*/
|
||||||
public void drawRankingElements(Graphics g, Beatmap beatmap) {
|
public void drawRankingElements(Graphics g, Beatmap beatmap) {
|
||||||
int width = displayContainer.width;
|
|
||||||
int height = displayContainer.height;
|
|
||||||
|
|
||||||
// TODO Version 2 skins
|
// TODO Version 2 skins
|
||||||
float rankingHeight = 75;
|
float rankingHeight = 75;
|
||||||
float scoreTextScale = 1.0f;
|
float scoreTextScale = 1.0f;
|
||||||
|
@ -911,7 +906,7 @@ public class GameData {
|
||||||
if (hitResult.hitResultType == HitObjectType.SPINNER && hitResult.result != HIT_MISS) {
|
if (hitResult.hitResultType == HitObjectType.SPINNER && hitResult.result != HIT_MISS) {
|
||||||
Image spinnerOsu = GameImage.SPINNER_OSU.getImage();
|
Image spinnerOsu = GameImage.SPINNER_OSU.getImage();
|
||||||
spinnerOsu.setAlpha(hitResult.alpha);
|
spinnerOsu.setAlpha(hitResult.alpha);
|
||||||
spinnerOsu.drawCentered(displayContainer.width / 2, displayContainer.height / 4);
|
spinnerOsu.drawCentered(width2, height / 4);
|
||||||
spinnerOsu.setAlpha(1f);
|
spinnerOsu.setAlpha(1f);
|
||||||
} else if (OPTION_SHOW_HIT_LIGHTING.state && !hitResult.hideResult && hitResult.result != HIT_MISS &&
|
} else if (OPTION_SHOW_HIT_LIGHTING.state && !hitResult.hideResult && hitResult.result != HIT_MISS &&
|
||||||
// hit lighting
|
// hit lighting
|
||||||
|
@ -1185,7 +1180,7 @@ public class GameData {
|
||||||
// combo burst
|
// combo burst
|
||||||
if (comboBurstIndex > -1 && OPTION_SHOW_COMBO_BURSTS.state) {
|
if (comboBurstIndex > -1 && OPTION_SHOW_COMBO_BURSTS.state) {
|
||||||
int leftX = 0;
|
int leftX = 0;
|
||||||
int rightX = displayContainer.width - comboBurstImages[comboBurstIndex].getWidth();
|
int rightX = width - comboBurstImages[comboBurstIndex].getWidth();
|
||||||
if (comboBurstX < leftX) {
|
if (comboBurstX < leftX) {
|
||||||
comboBurstX += (delta / 2f) * GameImage.getUIscale();
|
comboBurstX += (delta / 2f) * GameImage.getUIscale();
|
||||||
if (comboBurstX > leftX)
|
if (comboBurstX > leftX)
|
||||||
|
@ -1246,7 +1241,7 @@ public class GameData {
|
||||||
}
|
}
|
||||||
comboBurstAlpha = 0.8f;
|
comboBurstAlpha = 0.8f;
|
||||||
if ((comboBurstIndex % 2) == 0) {
|
if ((comboBurstIndex % 2) == 0) {
|
||||||
comboBurstX = displayContainer.width;
|
comboBurstX = width;
|
||||||
} else {
|
} else {
|
||||||
comboBurstX = comboBurstImages[0].getWidth() * -1;
|
comboBurstX = comboBurstImages[0].getWidth() * -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -464,8 +464,8 @@ public class Utils {
|
||||||
*/
|
*/
|
||||||
public static int getRegion(double x, double y) {
|
public static int getRegion(double x, double y) {
|
||||||
int q = 0;
|
int q = 0;
|
||||||
if (y < displayContainer.height / 2d) q = 2;
|
if (y < height2) q = 2;
|
||||||
if (x < displayContainer.width / 2d) q |= 1;
|
if (x < width2) q |= 1;
|
||||||
return q;
|
return q;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -483,24 +483,24 @@ public class Utils {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public static float[] mirrorPoint(float x, float y) {
|
public static float[] mirrorPoint(float x, float y) {
|
||||||
double dx = x - displayContainer.width / 2d;
|
double dx = x - width2;
|
||||||
double dy = y - displayContainer.height / 2d;
|
double dy = y - height2;
|
||||||
double ang = Math.atan2(dy, dx);
|
double ang = Math.atan2(dy, dx);
|
||||||
double d = -Math.sqrt(dx * dx + dy * dy);
|
double d = -Math.sqrt(dx * dx + dy * dy);
|
||||||
return new float[]{
|
return new float[]{
|
||||||
(float) (displayContainer.width / 2d + Math.cos(ang) * d),
|
(float) (width2 + Math.cos(ang) * d),
|
||||||
(float) (displayContainer.height / 2d + Math.sin(ang) * d)
|
(float) (height2 + Math.sin(ang) * d)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static float[] mirrorPoint(float x, float y, float degrees) {
|
public static float[] mirrorPoint(float x, float y, float degrees) {
|
||||||
double dx = x - displayContainer.width / 2d;
|
double dx = x - width2;
|
||||||
double dy = y - displayContainer.height / 2d;
|
double dy = y - height2;
|
||||||
double ang = Math.atan2(dy, dx) + (degrees * Math.PI / 180d);
|
double ang = Math.atan2(dy, dx) + (degrees * Math.PI / 180d);
|
||||||
double d = Math.sqrt(dx * dx + dy * dy);
|
double d = Math.sqrt(dx * dx + dy * dy);
|
||||||
return new float[]{
|
return new float[]{
|
||||||
(float) (displayContainer.width / 2d + Math.cos(ang) * d),
|
(float) (width2 + Math.cos(ang) * d),
|
||||||
(float) (displayContainer.height / 2d + Math.sin(ang) * d)
|
(float) (height2 + Math.sin(ang) * d)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -384,7 +384,7 @@ public class Slider extends GameObject {
|
||||||
float oldAlphaBlack = Colors.BLACK_ALPHA.a;
|
float oldAlphaBlack = Colors.BLACK_ALPHA.a;
|
||||||
Colors.BLACK_ALPHA.a = 0.75f;
|
Colors.BLACK_ALPHA.a = 0.75f;
|
||||||
g.setColor(Colors.BLACK_ALPHA);
|
g.setColor(Colors.BLACK_ALPHA);
|
||||||
g.fillRect(0, 0, displayContainer.width, displayContainer.height);
|
g.fillRect(0, 0, width, height);
|
||||||
Colors.BLACK_ALPHA.a = oldAlphaBlack;
|
Colors.BLACK_ALPHA.a = oldAlphaBlack;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,15 +33,14 @@ import itdelatrisu.opsu.ui.Colors;
|
||||||
import org.newdawn.slick.Color;
|
import org.newdawn.slick.Color;
|
||||||
import org.newdawn.slick.Graphics;
|
import org.newdawn.slick.Graphics;
|
||||||
import org.newdawn.slick.Image;
|
import org.newdawn.slick.Image;
|
||||||
import yugecin.opsudance.core.DisplayContainer;
|
|
||||||
import yugecin.opsudance.skinning.SkinService;
|
import yugecin.opsudance.skinning.SkinService;
|
||||||
|
|
||||||
|
import static yugecin.opsudance.core.InstanceContainer.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Data type representing a spinner object.
|
* Data type representing a spinner object.
|
||||||
*/
|
*/
|
||||||
public class Spinner extends GameObject {
|
public class Spinner extends GameObject {
|
||||||
/** Container dimensions. */
|
|
||||||
private static int width, height;
|
|
||||||
|
|
||||||
/** The map's overall difficulty value. */
|
/** The map's overall difficulty value. */
|
||||||
private static float overallDifficulty = 5f;
|
private static float overallDifficulty = 5f;
|
||||||
|
@ -111,9 +110,7 @@ public class Spinner extends GameObject {
|
||||||
* Initializes the Spinner data type with images and dimensions.
|
* Initializes the Spinner data type with images and dimensions.
|
||||||
* @param difficulty the map's overall difficulty value
|
* @param difficulty the map's overall difficulty value
|
||||||
*/
|
*/
|
||||||
public static void init(DisplayContainer displayContainer, float difficulty) {
|
public static void init(float difficulty) {
|
||||||
width = displayContainer.width;
|
|
||||||
height = displayContainer.height;
|
|
||||||
overallDifficulty = difficulty;
|
overallDifficulty = difficulty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,7 +197,7 @@ public class Spinner extends GameObject {
|
||||||
// rpm
|
// rpm
|
||||||
Image rpmImg = GameImage.SPINNER_RPM.getImage();
|
Image rpmImg = GameImage.SPINNER_RPM.getImage();
|
||||||
rpmImg.setAlpha(alpha);
|
rpmImg.setAlpha(alpha);
|
||||||
rpmImg.drawCentered(width / 2f, height - rpmImg.getHeight() / 2f);
|
rpmImg.drawCentered(width2, height - rpmImg.getHeight() / 2f);
|
||||||
if (timeDiff < 0)
|
if (timeDiff < 0)
|
||||||
data.drawSymbolString(Integer.toString(drawnRPM), (width + rpmImg.getWidth() * 0.95f) / 2f,
|
data.drawSymbolString(Integer.toString(drawnRPM), (width + rpmImg.getWidth() * 0.95f) / 2f,
|
||||||
height - data.getScoreSymbolImage('0').getHeight() * 1.025f, 1f, 1f, true);
|
height - data.getScoreSymbolImage('0').getHeight() * 1.025f, 1f, 1f, true);
|
||||||
|
@ -218,21 +215,21 @@ public class Spinner extends GameObject {
|
||||||
// main spinner elements
|
// main spinner elements
|
||||||
GameImage.SPINNER_CIRCLE.getImage().setAlpha(alpha);
|
GameImage.SPINNER_CIRCLE.getImage().setAlpha(alpha);
|
||||||
GameImage.SPINNER_CIRCLE.getImage().setRotation(drawRotation * 360f);
|
GameImage.SPINNER_CIRCLE.getImage().setRotation(drawRotation * 360f);
|
||||||
GameImage.SPINNER_CIRCLE.getImage().drawCentered(width / 2, height / 2);
|
GameImage.SPINNER_CIRCLE.getImage().drawCentered(width2, height2);
|
||||||
if (!GameMod.HIDDEN.isActive()) {
|
if (!GameMod.HIDDEN.isActive()) {
|
||||||
float approachScale = 1 - Utils.clamp(((float) timeDiff / (hitObject.getTime() - hitObject.getEndTime())), 0f, 1f);
|
float approachScale = 1 - Utils.clamp(((float) timeDiff / (hitObject.getTime() - hitObject.getEndTime())), 0f, 1f);
|
||||||
Image approachCircleScaled = GameImage.SPINNER_APPROACHCIRCLE.getImage().getScaledCopy(approachScale);
|
Image approachCircleScaled = GameImage.SPINNER_APPROACHCIRCLE.getImage().getScaledCopy(approachScale);
|
||||||
approachCircleScaled.setAlpha(alpha);
|
approachCircleScaled.setAlpha(alpha);
|
||||||
approachCircleScaled.drawCentered(width / 2, height / 2);
|
approachCircleScaled.drawCentered(width2, height2);
|
||||||
}
|
}
|
||||||
GameImage.SPINNER_SPIN.getImage().setAlpha(alpha);
|
GameImage.SPINNER_SPIN.getImage().setAlpha(alpha);
|
||||||
GameImage.SPINNER_SPIN.getImage().drawCentered(width / 2, height * 3 / 4);
|
GameImage.SPINNER_SPIN.getImage().drawCentered(width2, height * 3 / 4);
|
||||||
|
|
||||||
if (spinnerComplete) {
|
if (spinnerComplete) {
|
||||||
GameImage.SPINNER_CLEAR.getImage().drawCentered(width / 2, height / 4);
|
GameImage.SPINNER_CLEAR.getImage().drawCentered(width2, height / 4);
|
||||||
int extraRotations = (int) (rotations - rotationsNeeded);
|
int extraRotations = (int) (rotations - rotationsNeeded);
|
||||||
if (extraRotations > 0)
|
if (extraRotations > 0)
|
||||||
data.drawSymbolNumber(extraRotations * 1000, width / 2, height * 2 / 3, 1f, 1f);
|
data.drawSymbolNumber(extraRotations * 1000, width2, height * 2 / 3, 1f, 1f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -254,14 +251,14 @@ public class Spinner extends GameObject {
|
||||||
else
|
else
|
||||||
result = GameData.HIT_MISS;
|
result = GameData.HIT_MISS;
|
||||||
|
|
||||||
data.sendHitResult(hitObject.getEndTime(), result, width / 2, height / 2,
|
data.sendHitResult(hitObject.getEndTime(), result, width2, height2,
|
||||||
Color.transparent, true, hitObject, HitObjectType.SPINNER, true, 0, null, false);
|
Color.transparent, true, hitObject, HitObjectType.SPINNER, true, 0, null, false);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean mousePressed(int x, int y, int trackPosition) {
|
public boolean mousePressed(int x, int y, int trackPosition) {
|
||||||
lastAngle = (float) Math.atan2(x - (height / 2), y - (width / 2));
|
lastAngle = (float) Math.atan2(x - height2, y - width2);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -290,7 +287,7 @@ public class Spinner extends GameObject {
|
||||||
angleDiff = delta * SPUN_OUT_MULTIPLIER;
|
angleDiff = delta * SPUN_OUT_MULTIPLIER;
|
||||||
isSpinning = true;
|
isSpinning = true;
|
||||||
} else {
|
} else {
|
||||||
float angle = (float) Math.atan2(mouseY - (height / 2), mouseX - (width / 2));
|
float angle = (float) Math.atan2(mouseY - height2, mouseX - width2);
|
||||||
|
|
||||||
// set initial angle to current mouse position to skip first click
|
// set initial angle to current mouse position to skip first click
|
||||||
if (!isSpinning && (keyPressed || GameMod.RELAX.isActive())) {
|
if (!isSpinning && (keyPressed || GameMod.RELAX.isActive())) {
|
||||||
|
|
|
@ -98,13 +98,13 @@ public abstract class Curve {
|
||||||
* @param circleDiameter the circle diameter
|
* @param circleDiameter the circle diameter
|
||||||
* @param borderColor the curve border color
|
* @param borderColor the curve border color
|
||||||
*/
|
*/
|
||||||
public static void init(int width, int height, float circleDiameter, Color borderColor) {
|
public static void init(float circleDiameter, Color borderColor) {
|
||||||
Curve.borderColor = borderColor;
|
Curve.borderColor = borderColor;
|
||||||
|
|
||||||
ContextCapabilities capabilities = GLContext.getCapabilities();
|
ContextCapabilities capabilities = GLContext.getCapabilities();
|
||||||
mmsliderSupported = capabilities.OpenGL30;
|
mmsliderSupported = capabilities.OpenGL30;
|
||||||
if (mmsliderSupported) {
|
if (mmsliderSupported) {
|
||||||
CurveRenderState.init(width, height, circleDiameter);
|
CurveRenderState.init(circleDiameter);
|
||||||
} else if (SkinService.skin.getSliderStyle() != Skin.STYLE_PEPPYSLIDER) {
|
} else if (SkinService.skin.getSliderStyle() != Skin.STYLE_PEPPYSLIDER) {
|
||||||
Log.warn("New slider style requires OpenGL 3.0.");
|
Log.warn("New slider style requires OpenGL 3.0.");
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,8 +48,6 @@ import static yugecin.opsudance.options.Options.*;
|
||||||
* @author Bigpet {@literal <dravorek (at) gmail.com>}
|
* @author Bigpet {@literal <dravorek (at) gmail.com>}
|
||||||
*/
|
*/
|
||||||
public class CurveRenderState {
|
public class CurveRenderState {
|
||||||
/** The width and height of the display container this curve gets drawn into. */
|
|
||||||
protected static int containerWidth, containerHeight;
|
|
||||||
|
|
||||||
/** Thickness of the curve. */
|
/** Thickness of the curve. */
|
||||||
protected static int scale;
|
protected static int scale;
|
||||||
|
@ -83,10 +81,7 @@ public class CurveRenderState {
|
||||||
* @param height the container height
|
* @param height the container height
|
||||||
* @param circleDiameter the circle diameter
|
* @param circleDiameter the circle diameter
|
||||||
*/
|
*/
|
||||||
public static void init(int width, int height, float circleDiameter) {
|
public static void init(float circleDiameter) {
|
||||||
containerWidth = width;
|
|
||||||
containerHeight = height;
|
|
||||||
|
|
||||||
// equivalent to what happens in Slider.init()
|
// equivalent to what happens in Slider.init()
|
||||||
scale = (int) (circleDiameter * HitObject.getXMultiplier()); // convert from Osupixels (640x480)
|
scale = (int) (circleDiameter * HitObject.getXMultiplier()); // convert from Osupixels (640x480)
|
||||||
//scale = scale * 118 / 128; //for curves exactly as big as the sliderball
|
//scale = scale * 118 / 128; //for curves exactly as big as the sliderball
|
||||||
|
@ -410,8 +405,6 @@ public class CurveRenderState {
|
||||||
x1 = m[0];
|
x1 = m[0];
|
||||||
y1 = m[1];
|
y1 = m[1];
|
||||||
}
|
}
|
||||||
float divx = containerWidth / 2.0f;
|
|
||||||
float divy = containerHeight / 2.0f;
|
|
||||||
float offx = -1.0f;
|
float offx = -1.0f;
|
||||||
float offy = 1.0f;
|
float offy = 1.0f;
|
||||||
float radius = scale / 2;
|
float radius = scale / 2;
|
||||||
|
@ -419,8 +412,8 @@ public class CurveRenderState {
|
||||||
for (int i = 0; i < NewCurveStyleState.unitCone.length / 6; ++i) {
|
for (int i = 0; i < NewCurveStyleState.unitCone.length / 6; ++i) {
|
||||||
buff.put(NewCurveStyleState.unitCone[i * 6 + 0]);
|
buff.put(NewCurveStyleState.unitCone[i * 6 + 0]);
|
||||||
buff.put(NewCurveStyleState.unitCone[i * 6 + 1]);
|
buff.put(NewCurveStyleState.unitCone[i * 6 + 1]);
|
||||||
buff.put(offx + (x1 + radius * NewCurveStyleState.unitCone[i * 6 + 2]) / divx);
|
buff.put(offx + (x1 + radius * NewCurveStyleState.unitCone[i * 6 + 2]) / width2);
|
||||||
buff.put(offy - (y1 + radius * NewCurveStyleState.unitCone[i * 6 + 3]) / divy);
|
buff.put(offy - (y1 + radius * NewCurveStyleState.unitCone[i * 6 + 3]) / height2);
|
||||||
buff.put(NewCurveStyleState.unitCone[i * 6 + 4]);
|
buff.put(NewCurveStyleState.unitCone[i * 6 + 4]);
|
||||||
buff.put(NewCurveStyleState.unitCone[i * 6 + 5]);
|
buff.put(NewCurveStyleState.unitCone[i * 6 + 5]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -181,7 +181,7 @@ public class ButtonMenu extends BaseOpsuState {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected float getBaseY() {
|
protected float getBaseY() {
|
||||||
return displayContainer.height * 2f / 3;
|
return height * 2f / 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -203,10 +203,9 @@ public class ButtonMenu extends BaseOpsuState {
|
||||||
float mult = GameMod.getScoreMultiplier();
|
float mult = GameMod.getScoreMultiplier();
|
||||||
String multString = String.format("Score Multiplier: %.2fx", mult);
|
String multString = String.format("Score Multiplier: %.2fx", mult);
|
||||||
Color multColor = (mult == 1f) ? Color.white : (mult > 1f) ? Color.green : Color.red;
|
Color multColor = (mult == 1f) ? Color.white : (mult > 1f) ? Color.green : Color.red;
|
||||||
float multY = Fonts.LARGE.getLineHeight() * 2 + displayContainer.height * 0.06f;
|
float multY = Fonts.LARGE.getLineHeight() * 2 + height * 0.06f;
|
||||||
Fonts.LARGE.drawString(
|
final float multX = width2 - Fonts.LARGE.getWidth(multString) / 2f;
|
||||||
(displayContainer.width - Fonts.LARGE.getWidth(multString)) / 2f,
|
Fonts.LARGE.drawString(multX, multY, multString, multColor);
|
||||||
multY, multString, multColor);
|
|
||||||
|
|
||||||
// category text
|
// category text
|
||||||
for (GameMod.Category category : GameMod.Category.values()) {
|
for (GameMod.Category category : GameMod.Category.values()) {
|
||||||
|
@ -296,13 +295,12 @@ public class ButtonMenu extends BaseOpsuState {
|
||||||
* Initializes the menu state.
|
* Initializes the menu state.
|
||||||
*/
|
*/
|
||||||
public void revalidate(Image button, Image buttonL, Image buttonR) {
|
public void revalidate(Image button, Image buttonL, Image buttonR) {
|
||||||
float center = displayContainer.width / 2;
|
|
||||||
float baseY = getBaseY();
|
float baseY = getBaseY();
|
||||||
float offsetY = button.getHeight() * 1.25f;
|
float offsetY = button.getHeight() * 1.25f;
|
||||||
|
|
||||||
menuButtons = new MenuButton[buttons.length];
|
menuButtons = new MenuButton[buttons.length];
|
||||||
for (int i = 0; i < buttons.length; i++) {
|
for (int i = 0; i < buttons.length; i++) {
|
||||||
MenuButton b = new MenuButton(button, buttonL, buttonR, center, baseY + (i * offsetY));
|
MenuButton b = new MenuButton(button, buttonL, buttonR, width2, baseY + (i * offsetY));
|
||||||
b.setText(String.format("%d. %s", i + 1, buttons[i].getText()), Fonts.XLARGE, Color.white);
|
b.setText(String.format("%d. %s", i + 1, buttons[i].getText()), Fonts.XLARGE, Color.white);
|
||||||
b.setHoverFade();
|
b.setHoverFade();
|
||||||
menuButtons[i] = b;
|
menuButtons[i] = b;
|
||||||
|
@ -313,7 +311,7 @@ public class ButtonMenu extends BaseOpsuState {
|
||||||
* Returns the base Y coordinate for the buttons.
|
* Returns the base Y coordinate for the buttons.
|
||||||
*/
|
*/
|
||||||
protected float getBaseY() {
|
protected float getBaseY() {
|
||||||
float baseY = displayContainer.height * 0.2f;
|
float baseY = height * 0.2f;
|
||||||
baseY += ((getTitle().length - 1) * Fonts.LARGE.getLineHeight());
|
baseY += ((getTitle().length - 1) * Fonts.LARGE.getLineHeight());
|
||||||
return baseY;
|
return baseY;
|
||||||
}
|
}
|
||||||
|
@ -325,7 +323,7 @@ public class ButtonMenu extends BaseOpsuState {
|
||||||
public void render(Graphics g) {
|
public void render(Graphics g) {
|
||||||
// draw title
|
// draw title
|
||||||
if (actualTitle != null) {
|
if (actualTitle != null) {
|
||||||
float marginX = displayContainer.width * 0.015f, marginY = displayContainer.height * 0.01f;
|
float marginX = width * 0.015f, marginY = height * 0.01f;
|
||||||
int lineHeight = Fonts.LARGE.getLineHeight();
|
int lineHeight = Fonts.LARGE.getLineHeight();
|
||||||
for (int i = 0, size = actualTitle.size(); i < size; i++)
|
for (int i = 0, size = actualTitle.size(); i < size; i++)
|
||||||
Fonts.LARGE.drawString(marginX, marginY + (i * lineHeight), actualTitle.get(i), Color.white);
|
Fonts.LARGE.drawString(marginX, marginY + (i * lineHeight), actualTitle.get(i), Color.white);
|
||||||
|
@ -342,15 +340,16 @@ public class ButtonMenu extends BaseOpsuState {
|
||||||
* Updates the menu state.
|
* Updates the menu state.
|
||||||
*/
|
*/
|
||||||
public void preRenderUpdate() {
|
public void preRenderUpdate() {
|
||||||
float center = displayContainer.width / 2f;
|
|
||||||
boolean centerOffsetUpdated = centerOffset.update(displayContainer.renderDelta);
|
boolean centerOffsetUpdated = centerOffset.update(displayContainer.renderDelta);
|
||||||
float centerOffsetX = centerOffset.getValue();
|
float centerOffsetX = centerOffset.getValue();
|
||||||
|
final float[] offsets = { centerOffsetX, - centerOffsetX };
|
||||||
for (int i = 0; i < buttons.length; i++) {
|
for (int i = 0; i < buttons.length; i++) {
|
||||||
menuButtons[i].hoverUpdate(displayContainer.renderDelta, displayContainer.mouseX, displayContainer.mouseY);
|
menuButtons[i].hoverUpdate(displayContainer.renderDelta, displayContainer.mouseX, displayContainer.mouseY);
|
||||||
|
|
||||||
// move button to center
|
// move button to center
|
||||||
if (centerOffsetUpdated)
|
if (centerOffsetUpdated) {
|
||||||
menuButtons[i].setX((i % 2 == 0) ? center + centerOffsetX : center - centerOffsetX);
|
menuButtons[i].setX(width2 + offsets[i & 1]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -394,18 +393,17 @@ public class ButtonMenu extends BaseOpsuState {
|
||||||
* Processes a state enter request.
|
* Processes a state enter request.
|
||||||
*/
|
*/
|
||||||
public void enter() {
|
public void enter() {
|
||||||
float center = displayContainer.width / 2f;
|
float centerOffsetX = width * OFFSET_WIDTH_RATIO;
|
||||||
float centerOffsetX = displayContainer.width * OFFSET_WIDTH_RATIO;
|
|
||||||
centerOffset = new AnimatedValue(700, centerOffsetX, 0, AnimationEquation.OUT_BOUNCE);
|
centerOffset = new AnimatedValue(700, centerOffsetX, 0, AnimationEquation.OUT_BOUNCE);
|
||||||
for (int i = 0; i < buttons.length; i++) {
|
for (int i = 0; i < buttons.length; i++) {
|
||||||
menuButtons[i].setX(center + ((i % 2 == 0) ? centerOffsetX : centerOffsetX * -1));
|
menuButtons[i].setX(width2 + ((i % 2 == 0) ? centerOffsetX : centerOffsetX * -1));
|
||||||
menuButtons[i].resetHover();
|
menuButtons[i].resetHover();
|
||||||
}
|
}
|
||||||
|
|
||||||
// create title string list
|
// create title string list
|
||||||
actualTitle = new ArrayList<>();
|
actualTitle = new ArrayList<>();
|
||||||
String[] title = getTitle();
|
String[] title = getTitle();
|
||||||
int maxLineWidth = (int) (displayContainer.width * 0.96f);
|
int maxLineWidth = (int) (width * 0.96f);
|
||||||
for (String aTitle : title) {
|
for (String aTitle : title) {
|
||||||
// wrap text if too long
|
// wrap text if too long
|
||||||
if (Fonts.LARGE.getWidth(aTitle) > maxLineWidth) {
|
if (Fonts.LARGE.getWidth(aTitle) > maxLineWidth) {
|
||||||
|
@ -601,7 +599,7 @@ public class ButtonMenu extends BaseOpsuState {
|
||||||
|
|
||||||
// initialize buttons
|
// initialize buttons
|
||||||
Image button = GameImage.MENU_BUTTON_MID.getImage();
|
Image button = GameImage.MENU_BUTTON_MID.getImage();
|
||||||
button = button.getScaledCopy(displayContainer.width / 2, button.getHeight());
|
button = button.getScaledCopy(width2, button.getHeight());
|
||||||
Image buttonL = GameImage.MENU_BUTTON_LEFT.getImage();
|
Image buttonL = GameImage.MENU_BUTTON_LEFT.getImage();
|
||||||
Image buttonR = GameImage.MENU_BUTTON_RIGHT.getImage();
|
Image buttonR = GameImage.MENU_BUTTON_RIGHT.getImage();
|
||||||
for (MenuState ms : MenuState.values()) {
|
for (MenuState ms : MenuState.values()) {
|
||||||
|
|
|
@ -293,8 +293,6 @@ public class DownloadsMenu extends ComplexOpsuState {
|
||||||
|
|
||||||
components.clear();
|
components.clear();
|
||||||
|
|
||||||
int width = displayContainer.width;
|
|
||||||
int height = displayContainer.height;
|
|
||||||
int baseX = (int) (width * 0.024f);
|
int baseX = (int) (width * 0.024f);
|
||||||
int searchY = (int) (height * 0.04f + Fonts.LARGE.getLineHeight());
|
int searchY = (int) (height * 0.04f + Fonts.LARGE.getLineHeight());
|
||||||
int searchWidth = (int) (width * 0.3f);
|
int searchWidth = (int) (width * 0.3f);
|
||||||
|
@ -409,7 +407,7 @@ public class DownloadsMenu extends ComplexOpsuState {
|
||||||
GameImage.SEARCH_BG.getImage().draw();
|
GameImage.SEARCH_BG.getImage().draw();
|
||||||
|
|
||||||
// title
|
// title
|
||||||
Fonts.LARGE.drawString(displayContainer.width * 0.024f, displayContainer.height * 0.03f, "Download Beatmaps!", Color.white);
|
Fonts.LARGE.drawString(width * 0.024f, height * 0.03f, "Download Beatmaps!", Color.white);
|
||||||
|
|
||||||
// search
|
// search
|
||||||
g.setColor(Color.white);
|
g.setColor(Color.white);
|
||||||
|
@ -446,9 +444,9 @@ public class DownloadsMenu extends ComplexOpsuState {
|
||||||
|
|
||||||
// pages
|
// pages
|
||||||
if (nodes.length > 0) {
|
if (nodes.length > 0) {
|
||||||
float baseX = displayContainer.width * 0.024f;
|
float baseX = width * 0.024f;
|
||||||
float buttonY = displayContainer.height * 0.2f;
|
float buttonY = height * 0.2f;
|
||||||
float buttonWidth = displayContainer.width * 0.7f;
|
float buttonWidth = width * 0.7f;
|
||||||
Fonts.BOLD.drawString(
|
Fonts.BOLD.drawString(
|
||||||
baseX + (buttonWidth - Fonts.BOLD.getWidth("Page 1")) / 2f,
|
baseX + (buttonWidth - Fonts.BOLD.getWidth("Page 1")) / 2f,
|
||||||
buttonY - Fonts.BOLD.getLineHeight() * 1.3f,
|
buttonY - Fonts.BOLD.getLineHeight() * 1.3f,
|
||||||
|
@ -462,11 +460,10 @@ public class DownloadsMenu extends ComplexOpsuState {
|
||||||
}
|
}
|
||||||
|
|
||||||
// downloads
|
// downloads
|
||||||
float downloadsX = displayContainer.width * 0.75f, downloadsY = search.y;
|
float downloadsX = width * 0.75f, downloadsY = search.y;
|
||||||
g.setColor(Colors.BLACK_BG_NORMAL);
|
g.setColor(Colors.BLACK_BG_NORMAL);
|
||||||
g.fillRect(downloadsX, downloadsY,
|
g.fillRect(downloadsX, downloadsY, width * 0.25f, height - downloadsY * 2f);
|
||||||
displayContainer.width * 0.25f, displayContainer.height - downloadsY * 2f);
|
Fonts.LARGE.drawString(downloadsX + width * 0.015f, downloadsY + height * 0.015f, "Downloads", Color.white);
|
||||||
Fonts.LARGE.drawString(downloadsX + displayContainer.width * 0.015f, downloadsY + displayContainer.height * 0.015f, "Downloads", Color.white);
|
|
||||||
int downloadsSize = DownloadList.get().size();
|
int downloadsSize = DownloadList.get().size();
|
||||||
if (downloadsSize > 0) {
|
if (downloadsSize > 0) {
|
||||||
int maxDownloadsShown = DownloadNode.maxDownloadsShown();
|
int maxDownloadsShown = DownloadNode.maxDownloadsShown();
|
||||||
|
@ -505,15 +502,13 @@ public class DownloadsMenu extends ComplexOpsuState {
|
||||||
if (importThread != null) {
|
if (importThread != null) {
|
||||||
// darken the screen
|
// darken the screen
|
||||||
g.setColor(Colors.BLACK_ALPHA);
|
g.setColor(Colors.BLACK_ALPHA);
|
||||||
g.fillRect(0, 0, displayContainer.width, displayContainer.height);
|
g.fillRect(0, 0, width, height);
|
||||||
|
|
||||||
UI.drawLoadingProgress(g);
|
UI.drawLoadingProgress(g);
|
||||||
|
} else {
|
||||||
|
backButton.draw(g);
|
||||||
}
|
}
|
||||||
|
|
||||||
// back button
|
|
||||||
else
|
|
||||||
UI.getBackButton().draw(g);
|
|
||||||
|
|
||||||
UI.draw(g);
|
UI.draw(g);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -544,7 +539,7 @@ public class DownloadsMenu extends ComplexOpsuState {
|
||||||
}
|
}
|
||||||
int mouseX = displayContainer.mouseX;
|
int mouseX = displayContainer.mouseX;
|
||||||
int mouseY = displayContainer.mouseY;
|
int mouseY = displayContainer.mouseY;
|
||||||
UI.getBackButton().hoverUpdate(delta, mouseX, mouseY);
|
backButton.hoverUpdate(delta, mouseX, mouseY);
|
||||||
prevPage.hoverUpdate(delta, mouseX, mouseY);
|
prevPage.hoverUpdate(delta, mouseX, mouseY);
|
||||||
nextPage.hoverUpdate(delta, mouseX, mouseY);
|
nextPage.hoverUpdate(delta, mouseX, mouseY);
|
||||||
clearButton.hoverUpdate(delta, mouseX, mouseY);
|
clearButton.hoverUpdate(delta, mouseX, mouseY);
|
||||||
|
@ -614,7 +609,7 @@ public class DownloadsMenu extends ComplexOpsuState {
|
||||||
}
|
}
|
||||||
|
|
||||||
// back
|
// back
|
||||||
if (UI.getBackButton().contains(x, y)) {
|
if (backButton.contains(x, y)) {
|
||||||
SoundController.playSound(SoundEffect.MENUBACK);
|
SoundController.playSound(SoundEffect.MENUBACK);
|
||||||
displayContainer.switchState(mainmenuState);
|
displayContainer.switchState(mainmenuState);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -24,6 +24,7 @@ import itdelatrisu.opsu.audio.MusicController;
|
||||||
import itdelatrisu.opsu.audio.SoundController;
|
import itdelatrisu.opsu.audio.SoundController;
|
||||||
import itdelatrisu.opsu.audio.SoundEffect;
|
import itdelatrisu.opsu.audio.SoundEffect;
|
||||||
import itdelatrisu.opsu.beatmap.Beatmap;
|
import itdelatrisu.opsu.beatmap.Beatmap;
|
||||||
|
import itdelatrisu.opsu.beatmap.BeatmapParser;
|
||||||
import itdelatrisu.opsu.beatmap.HitObject;
|
import itdelatrisu.opsu.beatmap.HitObject;
|
||||||
import itdelatrisu.opsu.beatmap.TimingPoint;
|
import itdelatrisu.opsu.beatmap.TimingPoint;
|
||||||
import itdelatrisu.opsu.db.BeatmapDB;
|
import itdelatrisu.opsu.db.BeatmapDB;
|
||||||
|
@ -317,7 +318,7 @@ public class Game extends ComplexOpsuState {
|
||||||
mirrorCursor = new Cursor(true);
|
mirrorCursor = new Cursor(true);
|
||||||
this.moveStoryboardOverlay = new MoveStoryboard(displayContainer);
|
this.moveStoryboardOverlay = new MoveStoryboard(displayContainer);
|
||||||
this.optionsOverlay = new OptionsOverlay(displayContainer, OptionGroups.storyboardOptions);
|
this.optionsOverlay = new OptionsOverlay(displayContainer, OptionGroups.storyboardOptions);
|
||||||
this.storyboardOverlay = new StoryboardOverlay(displayContainer, moveStoryboardOverlay, optionsOverlay, this);
|
this.storyboardOverlay = new StoryboardOverlay(moveStoryboardOverlay, optionsOverlay, this);
|
||||||
storyboardOverlay.show();
|
storyboardOverlay.show();
|
||||||
moveStoryboardOverlay.show();
|
moveStoryboardOverlay.show();
|
||||||
optionsOverlay.setListener(storyboardOverlay);
|
optionsOverlay.setListener(storyboardOverlay);
|
||||||
|
@ -329,7 +330,7 @@ public class Game extends ComplexOpsuState {
|
||||||
|
|
||||||
// create offscreen graphics
|
// create offscreen graphics
|
||||||
try {
|
try {
|
||||||
offscreen = new Image(displayContainer.width, displayContainer.height);
|
offscreen = new Image(width, height);
|
||||||
gOffscreen = offscreen.getGraphics();
|
gOffscreen = offscreen.getGraphics();
|
||||||
gOffscreen.setBackground(Color.black);
|
gOffscreen.setBackground(Color.black);
|
||||||
} catch (SlickException e) {
|
} catch (SlickException e) {
|
||||||
|
@ -341,14 +342,14 @@ public class Game extends ComplexOpsuState {
|
||||||
}
|
}
|
||||||
|
|
||||||
// initialize music position bar location
|
// initialize music position bar location
|
||||||
musicBarX = displayContainer.width * 0.01f;
|
musicBarX = width * 0.01f;
|
||||||
musicBarY = displayContainer.height * 0.05f;
|
musicBarY = height * 0.05f;
|
||||||
musicBarWidth = Math.max(displayContainer.width * 0.005f, 7);
|
musicBarWidth = Math.max(width * 0.005f, 7);
|
||||||
musicBarHeight = displayContainer.height * 0.9f;
|
musicBarHeight = height * 0.9f;
|
||||||
|
|
||||||
// initialize scoreboard star stream
|
// initialize scoreboard star stream
|
||||||
scoreboardStarStream = new StarStream(0, displayContainer.height * 2f / 3f, displayContainer.width / 4, 0, 0);
|
scoreboardStarStream = new StarStream(0, height * 2f / 3f, width / 4, 0, 0);
|
||||||
scoreboardStarStream.setPositionSpread(displayContainer.height / 20f);
|
scoreboardStarStream.setPositionSpread(height / 20f);
|
||||||
scoreboardStarStream.setDirectionSpread(10f);
|
scoreboardStarStream.setDirectionSpread(10f);
|
||||||
scoreboardStarStream.setDurationSpread(700, 100);
|
scoreboardStarStream.setDurationSpread(700, 100);
|
||||||
|
|
||||||
|
@ -382,9 +383,6 @@ public class Game extends ComplexOpsuState {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(Graphics g) {
|
public void render(Graphics g) {
|
||||||
int width = displayContainer.width;
|
|
||||||
int height = displayContainer.height;
|
|
||||||
|
|
||||||
int trackPosition = MusicController.getPosition();
|
int trackPosition = MusicController.getPosition();
|
||||||
if (isLeadIn()) {
|
if (isLeadIn()) {
|
||||||
trackPosition -= leadInTime - currentMapMusicOffset - OPTION_MUSIC_OFFSET.val;
|
trackPosition -= leadInTime - currentMapMusicOffset - OPTION_MUSIC_OFFSET.val;
|
||||||
|
@ -637,7 +635,7 @@ public class Game extends ComplexOpsuState {
|
||||||
float animation = AnimationEquation.IN_OUT_QUAD.calc(
|
float animation = AnimationEquation.IN_OUT_QUAD.calc(
|
||||||
Utils.clamp((trackPosition - lastRankUpdateTime) / SCOREBOARD_ANIMATION_TIME, 0f, 1f)
|
Utils.clamp((trackPosition - lastRankUpdateTime) / SCOREBOARD_ANIMATION_TIME, 0f, 1f)
|
||||||
);
|
);
|
||||||
int scoreboardPosition = 2 * displayContainer.height / 3;
|
int scoreboardPosition = 2 * height / 3;
|
||||||
|
|
||||||
// draw star stream behind the scores
|
// draw star stream behind the scores
|
||||||
scoreboardStarStream.draw();
|
scoreboardStarStream.draw();
|
||||||
|
@ -907,11 +905,11 @@ public class Game extends ComplexOpsuState {
|
||||||
} else if (GameMod.AUTO.isActive()) {
|
} else if (GameMod.AUTO.isActive()) {
|
||||||
displayContainer.cursor.setCursorPosition(displayContainer.delta, (int) autoMousePosition.x, (int) autoMousePosition.y);
|
displayContainer.cursor.setCursorPosition(displayContainer.delta, (int) autoMousePosition.x, (int) autoMousePosition.y);
|
||||||
if (OPTION_DANCE_MIRROR.state && GameMod.AUTO.isActive()) {
|
if (OPTION_DANCE_MIRROR.state && GameMod.AUTO.isActive()) {
|
||||||
double dx = autoMousePosition.x - displayContainer.width / 2d;
|
double dx = autoMousePosition.x - width2;
|
||||||
double dy = autoMousePosition.y - displayContainer.height / 2d;
|
double dy = autoMousePosition.y - height2;
|
||||||
double d = Math.sqrt(dx * dx + dy * dy);
|
double d = Math.sqrt(dx * dx + dy * dy);
|
||||||
double a = Math.atan2(dy, dx) + Math.PI;
|
double a = Math.atan2(dy, dx) + Math.PI;
|
||||||
mirrorCursor.setCursorPosition(displayContainer.delta, (int) (Math.cos(a) * d + displayContainer.width / 2), (int) (Math.sin(a) * d + displayContainer.height / 2));
|
mirrorCursor.setCursorPosition(displayContainer.delta, (int) (Math.cos(a) * d + width2), (int) (Math.sin(a) * d + height2));
|
||||||
}
|
}
|
||||||
} else if (GameMod.AUTOPILOT.isActive()) {
|
} else if (GameMod.AUTOPILOT.isActive()) {
|
||||||
displayContainer.cursor.setCursorPosition(displayContainer.delta, (int) autoMousePosition.x, (int) autoMousePosition.y);
|
displayContainer.cursor.setCursorPosition(displayContainer.delta, (int) autoMousePosition.x, (int) autoMousePosition.y);
|
||||||
|
@ -1477,10 +1475,9 @@ public class Game extends ComplexOpsuState {
|
||||||
epiImgTime = OPTION_EPILEPSY_WARNING.val * 100;
|
epiImgTime = OPTION_EPILEPSY_WARNING.val * 100;
|
||||||
if (epiImgTime > 0) {
|
if (epiImgTime > 0) {
|
||||||
epiImg = GameImage.EPILEPSY_WARNING.getImage();
|
epiImg = GameImage.EPILEPSY_WARNING.getImage();
|
||||||
float desWidth = displayContainer.width / 2;
|
epiImg = epiImg.getScaledCopy(width2 / epiImg.getWidth());
|
||||||
epiImg = epiImg.getScaledCopy(desWidth / epiImg.getWidth());
|
epiImgX = width2 - epiImg.getWidth() / 2;
|
||||||
epiImgX = (displayContainer.width - epiImg.getWidth()) / 2;
|
epiImgY = height2 - epiImg.getHeight() / 2;
|
||||||
epiImgY = (displayContainer.height - epiImg.getHeight()) / 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// load mods
|
// load mods
|
||||||
|
@ -1582,8 +1579,8 @@ public class Game extends ComplexOpsuState {
|
||||||
// load replay frames
|
// load replay frames
|
||||||
if (isReplay) {
|
if (isReplay) {
|
||||||
// load initial data
|
// load initial data
|
||||||
replayX = displayContainer.width / 2;
|
replayX = width2;
|
||||||
replayY = displayContainer.height / 2;
|
replayY = height2;
|
||||||
replayKeyPressed = false;
|
replayKeyPressed = false;
|
||||||
replaySkipTime = -1;
|
replaySkipTime = -1;
|
||||||
for (replayIndex = 0; replayIndex < replay.frames.length; replayIndex++) {
|
for (replayIndex = 0; replayIndex < replay.frames.length; replayIndex++) {
|
||||||
|
@ -1775,7 +1772,7 @@ public class Game extends ComplexOpsuState {
|
||||||
}
|
}
|
||||||
if (lastObjectIndex != -1 && !beatmap.objects[index].isNewCombo()) {
|
if (lastObjectIndex != -1 && !beatmap.objects[index].isNewCombo()) {
|
||||||
// calculate points
|
// calculate points
|
||||||
final int followPointInterval = displayContainer.height / 14;
|
final int followPointInterval = height / 14;
|
||||||
int lastObjectEndTime = gameObjects[lastObjectIndex].getEndTime() + 1;
|
int lastObjectEndTime = gameObjects[lastObjectIndex].getEndTime() + 1;
|
||||||
int objectStartTime = beatmap.objects[index].getTime();
|
int objectStartTime = beatmap.objects[index].getTime();
|
||||||
Vec2f startPoint = gameObjects[lastObjectIndex].getPointAt(lastObjectEndTime);
|
Vec2f startPoint = gameObjects[lastObjectIndex].getPointAt(lastObjectEndTime);
|
||||||
|
@ -1836,7 +1833,7 @@ public class Game extends ComplexOpsuState {
|
||||||
gameObj.draw(g, trackPosition, false);
|
gameObj.draw(g, trackPosition, false);
|
||||||
if (OPTION_DANCE_MIRROR.state && GameMod.AUTO.isActive() && idx < mirrorTo && idx >= mirrorFrom) {
|
if (OPTION_DANCE_MIRROR.state && GameMod.AUTO.isActive() && idx < mirrorTo && idx >= mirrorFrom) {
|
||||||
g.pushTransform();
|
g.pushTransform();
|
||||||
g.rotate(displayContainer.width / 2f, displayContainer.height / 2f, 180f);
|
g.rotate(width2, height2, 180f);
|
||||||
gameObj.draw(g, trackPosition, true);
|
gameObj.draw(g, trackPosition, true);
|
||||||
g.popTransform();
|
g.popTransform();
|
||||||
}
|
}
|
||||||
|
@ -1864,7 +1861,7 @@ public class Game extends ComplexOpsuState {
|
||||||
g.pushTransform();
|
g.pushTransform();
|
||||||
|
|
||||||
// translate and rotate the object
|
// translate and rotate the object
|
||||||
g.translate(0, dt * dt * displayContainer.height);
|
g.translate(0, dt * dt * height);
|
||||||
Vec2f rotationCenter = gameObj.getPointAt((beatmap.objects[idx].getTime() + beatmap.objects[idx].getEndTime()) / 2);
|
Vec2f rotationCenter = gameObj.getPointAt((beatmap.objects[idx].getTime() + beatmap.objects[idx].getEndTime()) / 2);
|
||||||
g.rotate(rotationCenter.x, rotationCenter.y, rotSpeed * dt);
|
g.rotate(rotationCenter.x, rotationCenter.y, rotSpeed * dt);
|
||||||
gameObj.draw(g, trackPosition, false);
|
gameObj.draw(g, trackPosition, false);
|
||||||
|
@ -1887,7 +1884,7 @@ public class Game extends ComplexOpsuState {
|
||||||
if (beatmap.breaks == null) {
|
if (beatmap.breaks == null) {
|
||||||
BeatmapDB.load(beatmap, BeatmapDB.LOAD_ARRAY);
|
BeatmapDB.load(beatmap, BeatmapDB.LOAD_ARRAY);
|
||||||
}
|
}
|
||||||
beatmapParser.parseHitObjects(beatmap);
|
BeatmapParser.parseHitObjects(beatmap);
|
||||||
HitSound.setDefaultSampleSet(beatmap.sampleSet);
|
HitSound.setDefaultSampleSet(beatmap.sampleSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1918,7 +1915,7 @@ public class Game extends ComplexOpsuState {
|
||||||
lastReplayTime = 0;
|
lastReplayTime = 0;
|
||||||
autoMousePosition = new Vec2f();
|
autoMousePosition = new Vec2f();
|
||||||
autoMousePressed = false;
|
autoMousePressed = false;
|
||||||
flashlightRadius = displayContainer.height * 2 / 3;
|
flashlightRadius = height * 2 / 3;
|
||||||
if (scoreboardStarStream != null) {
|
if (scoreboardStarStream != null) {
|
||||||
scoreboardStarStream.clear();
|
scoreboardStarStream.clear();
|
||||||
}
|
}
|
||||||
|
@ -1970,10 +1967,10 @@ public class Game extends ComplexOpsuState {
|
||||||
// skip button
|
// skip button
|
||||||
if (GameImage.SKIP.getImages() != null) {
|
if (GameImage.SKIP.getImages() != null) {
|
||||||
Animation skip = GameImage.SKIP.getAnimation(120);
|
Animation skip = GameImage.SKIP.getAnimation(120);
|
||||||
skipButton = new MenuButton(skip, displayContainer.width - skip.getWidth() / 2f, displayContainer.height - (skip.getHeight() / 2f));
|
skipButton = new MenuButton(skip, width - skip.getWidth() / 2f, height - (skip.getHeight() / 2f));
|
||||||
} else {
|
} else {
|
||||||
Image skip = GameImage.SKIP.getImage();
|
Image skip = GameImage.SKIP.getImage();
|
||||||
skipButton = new MenuButton(skip, displayContainer.width - skip.getWidth() / 2f, displayContainer.height - (skip.getHeight() / 2f));
|
skipButton = new MenuButton(skip, width - skip.getWidth() / 2f, height - (skip.getHeight() / 2f));
|
||||||
}
|
}
|
||||||
skipButton.setHoverAnimationDuration(350);
|
skipButton.setHoverAnimationDuration(350);
|
||||||
skipButton.setHoverAnimationEquation(AnimationEquation.IN_OUT_BACK);
|
skipButton.setHoverAnimationEquation(AnimationEquation.IN_OUT_BACK);
|
||||||
|
@ -2018,12 +2015,12 @@ public class Game extends ComplexOpsuState {
|
||||||
// initialize objects
|
// initialize objects
|
||||||
gameObjectRenderer.initForGame(data, diameter);
|
gameObjectRenderer.initForGame(data, diameter);
|
||||||
Slider.init(gameObjectRenderer.circleDiameter, beatmap);
|
Slider.init(gameObjectRenderer.circleDiameter, beatmap);
|
||||||
Spinner.init(displayContainer, overallDifficulty);
|
Spinner.init(overallDifficulty);
|
||||||
Color sliderBorderColor = SkinService.skin.getSliderBorderColor();
|
Color sliderBorderColor = SkinService.skin.getSliderBorderColor();
|
||||||
if (!OPTION_IGNORE_BEATMAP_SKINS.state && beatmap.getSliderBorderColor() != null) {
|
if (!OPTION_IGNORE_BEATMAP_SKINS.state && beatmap.getSliderBorderColor() != null) {
|
||||||
sliderBorderColor = beatmap.getSliderBorderColor();
|
sliderBorderColor = beatmap.getSliderBorderColor();
|
||||||
}
|
}
|
||||||
Curve.init(displayContainer.width, displayContainer.height, diameter, sliderBorderColor);
|
Curve.init(diameter, sliderBorderColor);
|
||||||
|
|
||||||
// approachRate (hit object approach time)
|
// approachRate (hit object approach time)
|
||||||
if (approachRate < 5)
|
if (approachRate < 5)
|
||||||
|
@ -2242,25 +2239,25 @@ public class Game extends ComplexOpsuState {
|
||||||
if (isLeadIn()) {
|
if (isLeadIn()) {
|
||||||
// lead-in: expand area
|
// lead-in: expand area
|
||||||
float progress = Math.max((float) (leadInTime - beatmap.audioLeadIn) / approachTime, 0f);
|
float progress = Math.max((float) (leadInTime - beatmap.audioLeadIn) / approachTime, 0f);
|
||||||
flashlightRadius = displayContainer.width - (int) ((displayContainer.width - (displayContainer.height * 2 / 3)) * progress);
|
flashlightRadius = width - (int) ((width - (height * 2 / 3)) * progress);
|
||||||
} else if (firstObject) {
|
} else if (firstObject) {
|
||||||
// before first object: shrink area
|
// before first object: shrink area
|
||||||
int timeDiff = beatmap.objects[0].getTime() - trackPosition;
|
int timeDiff = beatmap.objects[0].getTime() - trackPosition;
|
||||||
flashlightRadius = displayContainer.width;
|
flashlightRadius = width;
|
||||||
if (timeDiff < approachTime) {
|
if (timeDiff < approachTime) {
|
||||||
float progress = (float) timeDiff / approachTime;
|
float progress = (float) timeDiff / approachTime;
|
||||||
flashlightRadius -= (displayContainer.width - (displayContainer.height * 2 / 3)) * (1 - progress);
|
flashlightRadius -= (width - (height * 2 / 3)) * (1 - progress);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// gameplay: size based on combo
|
// gameplay: size based on combo
|
||||||
int targetRadius;
|
int targetRadius;
|
||||||
int combo = data.getComboStreak();
|
int combo = data.getComboStreak();
|
||||||
if (combo < 100)
|
if (combo < 100)
|
||||||
targetRadius = displayContainer.height * 2 / 3;
|
targetRadius = height * 2 / 3;
|
||||||
else if (combo < 200)
|
else if (combo < 200)
|
||||||
targetRadius = displayContainer.height / 2;
|
targetRadius = height2;
|
||||||
else
|
else
|
||||||
targetRadius = displayContainer.height / 3;
|
targetRadius = height / 3;
|
||||||
if (beatmap.breaks != null && breakIndex < beatmap.breaks.size() && breakTime > 0) {
|
if (beatmap.breaks != null && breakIndex < beatmap.breaks.size() && breakTime > 0) {
|
||||||
// breaks: expand at beginning, shrink at end
|
// breaks: expand at beginning, shrink at end
|
||||||
flashlightRadius = targetRadius;
|
flashlightRadius = targetRadius;
|
||||||
|
@ -2272,11 +2269,11 @@ public class Game extends ComplexOpsuState {
|
||||||
progress = (float) (trackPosition - breakTime) / approachTime;
|
progress = (float) (trackPosition - breakTime) / approachTime;
|
||||||
else if (endTime - trackPosition < approachTime)
|
else if (endTime - trackPosition < approachTime)
|
||||||
progress = (float) (endTime - trackPosition) / approachTime;
|
progress = (float) (endTime - trackPosition) / approachTime;
|
||||||
flashlightRadius += (displayContainer.width - flashlightRadius) * progress;
|
flashlightRadius += (width - flashlightRadius) * progress;
|
||||||
}
|
}
|
||||||
} else if (flashlightRadius != targetRadius) {
|
} else if (flashlightRadius != targetRadius) {
|
||||||
// radius size change
|
// radius size change
|
||||||
float radiusDiff = displayContainer.height * delta / 2000f;
|
float radiusDiff = height * delta / 2000f;
|
||||||
if (flashlightRadius > targetRadius) {
|
if (flashlightRadius > targetRadius) {
|
||||||
flashlightRadius -= radiusDiff;
|
flashlightRadius -= radiusDiff;
|
||||||
if (flashlightRadius < targetRadius)
|
if (flashlightRadius < targetRadius)
|
||||||
|
|
|
@ -32,6 +32,7 @@ import org.newdawn.slick.Graphics;
|
||||||
import org.newdawn.slick.Input;
|
import org.newdawn.slick.Input;
|
||||||
import yugecin.opsudance.core.state.BaseOpsuState;
|
import yugecin.opsudance.core.state.BaseOpsuState;
|
||||||
|
|
||||||
|
import static itdelatrisu.opsu.GameImage.*;
|
||||||
import static org.lwjgl.input.Keyboard.*;
|
import static org.lwjgl.input.Keyboard.*;
|
||||||
import static yugecin.opsudance.core.InstanceContainer.*;
|
import static yugecin.opsudance.core.InstanceContainer.*;
|
||||||
import static yugecin.opsudance.options.Options.*;
|
import static yugecin.opsudance.options.Options.*;
|
||||||
|
@ -193,9 +194,9 @@ public class GamePauseMenu extends BaseOpsuState {
|
||||||
*/
|
*/
|
||||||
public void loadImages() {
|
public void loadImages() {
|
||||||
// initialize buttons
|
// initialize buttons
|
||||||
continueButton = new MenuButton(GameImage.PAUSE_CONTINUE.getImage(), displayContainer.width / 2f, displayContainer.height * 0.25f);
|
continueButton = new MenuButton(PAUSE_CONTINUE.getImage(), width2, height * 0.25f);
|
||||||
retryButton = new MenuButton(GameImage.PAUSE_RETRY.getImage(), displayContainer.width / 2f, displayContainer.height * 0.5f);
|
retryButton = new MenuButton(PAUSE_RETRY.getImage(), width2, height2);
|
||||||
backButton = new MenuButton(GameImage.PAUSE_BACK.getImage(), displayContainer.width / 2f, displayContainer.height * 0.75f);
|
backButton = new MenuButton(PAUSE_BACK.getImage(), width2, height * 0.75f);
|
||||||
final int buttonAnimationDuration = 300;
|
final int buttonAnimationDuration = 300;
|
||||||
continueButton.setHoverAnimationDuration(buttonAnimationDuration);
|
continueButton.setHoverAnimationDuration(buttonAnimationDuration);
|
||||||
retryButton.setHoverAnimationDuration(buttonAnimationDuration);
|
retryButton.setHoverAnimationDuration(buttonAnimationDuration);
|
||||||
|
|
|
@ -66,10 +66,10 @@ public class GameRanking extends BaseOpsuState {
|
||||||
// buttons
|
// buttons
|
||||||
Image retry = GameImage.PAUSE_RETRY.getImage();
|
Image retry = GameImage.PAUSE_RETRY.getImage();
|
||||||
Image replay = GameImage.PAUSE_REPLAY.getImage();
|
Image replay = GameImage.PAUSE_REPLAY.getImage();
|
||||||
replayY = (displayContainer.height * 0.985f) - replay.getHeight() / 2f;
|
replayY = height * 0.985f - replay.getHeight() / 2f;
|
||||||
retryY = replayY - (replay.getHeight() / 2f) - (retry.getHeight() / 1.975f);
|
retryY = replayY - (replay.getHeight() / 2f) - (retry.getHeight() / 1.975f);
|
||||||
retryButton = new MenuButton(retry, displayContainer.width - (retry.getWidth() / 2f), retryY);
|
retryButton = new MenuButton(retry, width - (retry.getWidth() / 2f), retryY);
|
||||||
replayButton = new MenuButton(replay, displayContainer.width - (replay.getWidth() / 2f), replayY);
|
replayButton = new MenuButton(replay, width - (replay.getWidth() / 2f), replayY);
|
||||||
retryButton.setHoverFade();
|
retryButton.setHoverFade();
|
||||||
replayButton.setHoverFade();
|
replayButton.setHoverFade();
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ public class GameRanking extends BaseOpsuState {
|
||||||
Beatmap beatmap = MusicController.getBeatmap();
|
Beatmap beatmap = MusicController.getBeatmap();
|
||||||
|
|
||||||
// background
|
// background
|
||||||
if (!beatmap.drawBackground(displayContainer.width, displayContainer.height, 0.7f, true)) {
|
if (!beatmap.drawBackground(width, height, 0.7f, true)) {
|
||||||
GameImage.PLAYFIELD.getImage().draw(0, 0);
|
GameImage.PLAYFIELD.getImage().draw(0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ public class GameRanking extends BaseOpsuState {
|
||||||
replayButton.draw();
|
replayButton.draw();
|
||||||
if (data.isGameplay() && !GameMod.AUTO.isActive())
|
if (data.isGameplay() && !GameMod.AUTO.isActive())
|
||||||
retryButton.draw();
|
retryButton.draw();
|
||||||
UI.getBackButton().draw(g);
|
backButton.draw(g);
|
||||||
|
|
||||||
UI.draw(g);
|
UI.draw(g);
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ public class GameRanking extends BaseOpsuState {
|
||||||
} else {
|
} else {
|
||||||
MusicController.loopTrackIfEnded(true);
|
MusicController.loopTrackIfEnded(true);
|
||||||
}
|
}
|
||||||
UI.getBackButton().hoverUpdate(delta, displayContainer.mouseX, displayContainer.mouseY);
|
backButton.hoverUpdate(delta, displayContainer.mouseX, displayContainer.mouseY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -139,7 +139,7 @@ public class GameRanking extends BaseOpsuState {
|
||||||
}
|
}
|
||||||
|
|
||||||
// back to menu
|
// back to menu
|
||||||
if (UI.getBackButton().contains(x, y)) {
|
if (backButton.contains(x, y)) {
|
||||||
returnToSongMenu();
|
returnToSongMenu();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -172,9 +172,6 @@ public class MainMenu extends BaseOpsuState {
|
||||||
protected void revalidate() {
|
protected void revalidate() {
|
||||||
previous = new Stack<>();
|
previous = new Stack<>();
|
||||||
|
|
||||||
final int width = displayContainer.width;
|
|
||||||
final int height = displayContainer.height;
|
|
||||||
|
|
||||||
this.barHeight = height * 0.1125f;
|
this.barHeight = height * 0.1125f;
|
||||||
|
|
||||||
this.textMarginX = (int) (width * 0.015f);
|
this.textMarginX = (int) (width * 0.015f);
|
||||||
|
@ -213,7 +210,7 @@ public class MainMenu extends BaseOpsuState {
|
||||||
|
|
||||||
// initialize downloads button
|
// initialize downloads button
|
||||||
Image dlImg = GameImage.DOWNLOADS.getImage();
|
Image dlImg = GameImage.DOWNLOADS.getImage();
|
||||||
downloadsButton = new MenuButton(dlImg, displayContainer.width - dlImg.getWidth() / 2f, displayContainer.height / 2f);
|
downloadsButton = new MenuButton(dlImg, width - dlImg.getWidth() / 2f, height2);
|
||||||
downloadsButton.setHoverAnimationDuration(350);
|
downloadsButton.setHoverAnimationDuration(350);
|
||||||
downloadsButton.setHoverAnimationEquation(AnimationEquation.IN_OUT_BACK);
|
downloadsButton.setHoverAnimationEquation(AnimationEquation.IN_OUT_BACK);
|
||||||
downloadsButton.setHoverExpand(1.03f, Expand.LEFT);
|
downloadsButton.setHoverExpand(1.03f, Expand.LEFT);
|
||||||
|
@ -233,31 +230,31 @@ public class MainMenu extends BaseOpsuState {
|
||||||
}
|
}
|
||||||
|
|
||||||
// initialize update buttons
|
// initialize update buttons
|
||||||
float updateX = displayContainer.width / 2f, updateY = displayContainer.height * 17 / 18f;
|
final float updateY = height * 17 / 18f;
|
||||||
Image downloadImg = GameImage.DOWNLOAD.getImage();
|
final Image downloadImg = GameImage.DOWNLOAD.getImage();
|
||||||
updateButton = new MenuButton(downloadImg, updateX, updateY);
|
updateButton = new MenuButton(downloadImg, width2, updateY);
|
||||||
updateButton.setHoverAnimationDuration(400);
|
updateButton.setHoverAnimationDuration(400);
|
||||||
updateButton.setHoverAnimationEquation(AnimationEquation.IN_OUT_QUAD);
|
updateButton.setHoverAnimationEquation(AnimationEquation.IN_OUT_QUAD);
|
||||||
updateButton.setHoverExpand(1.1f);
|
updateButton.setHoverExpand(1.1f);
|
||||||
Image updateImg = GameImage.UPDATE.getImage();
|
final Image updateImg = GameImage.UPDATE.getImage();
|
||||||
restartButton = new MenuButton(updateImg, updateX, updateY);
|
restartButton = new MenuButton(updateImg, width2, updateY);
|
||||||
restartButton.setHoverAnimationDuration(2000);
|
restartButton.setHoverAnimationDuration(2000);
|
||||||
restartButton.setHoverAnimationEquation(AnimationEquation.LINEAR);
|
restartButton.setHoverAnimationEquation(AnimationEquation.LINEAR);
|
||||||
restartButton.setHoverRotate(360);
|
restartButton.setHoverRotate(360);
|
||||||
|
|
||||||
// initialize star fountain
|
// initialize star fountain
|
||||||
starFountain = new StarFountain(displayContainer.width, displayContainer.height);
|
starFountain = new StarFountain(width, height);
|
||||||
|
|
||||||
// logo & buttons
|
// logo & buttons
|
||||||
this.logo = new ImagePosition(MENU_LOGO.getImage());
|
this.logo = new ImagePosition(MENU_LOGO.getImage());
|
||||||
logoPositionOffsetX = 0.35f * MENU_LOGO.getImage().getHeight();
|
logoPositionOffsetX = 0.35f * MENU_LOGO.getImage().getHeight();
|
||||||
logoPosition = new AnimatedValue(1, 0, 1, AnimationEquation.OUT_QUAD);
|
logoPosition = new AnimatedValue(1, 0, 1, AnimationEquation.OUT_QUAD);
|
||||||
logoButtonAlpha = new AnimatedValue(200, 0f, 1f, AnimationEquation.LINEAR);
|
logoButtonAlpha = new AnimatedValue(200, 0f, 1f, AnimationEquation.LINEAR);
|
||||||
this.buttonsX = (displayContainer.width - MENU_OPTIONS.getImage().getWidth()) / 2;
|
this.buttonsX = width2 - MENU_OPTIONS.getImage().getWidth() / 2;
|
||||||
this.buttonPositions[0] = new ImagePosition(MENU_PLAY.getImage());
|
this.buttonPositions[0] = new ImagePosition(MENU_PLAY.getImage());
|
||||||
this.buttonPositions[1] = new ImagePosition(MENU_OPTIONS.getImage());
|
this.buttonPositions[1] = new ImagePosition(MENU_OPTIONS.getImage());
|
||||||
this.buttonPositions[2] = new ImagePosition(MENU_EXIT.getImage());
|
this.buttonPositions[2] = new ImagePosition(MENU_EXIT.getImage());
|
||||||
final int basey = displayContainer.height / 2 - MENU_OPTIONS.getImage().getHeight() / 2;
|
final int basey = height2 - MENU_OPTIONS.getImage().getHeight() / 2;
|
||||||
final float yoffset = MENU_LOGO.getImage().getHeight() * 0.196378f;
|
final float yoffset = MENU_LOGO.getImage().getHeight() * 0.196378f;
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
this.buttonPositions[i].width = MENU_OPTIONS.getImage().getWidth();
|
this.buttonPositions[i].width = MENU_OPTIONS.getImage().getWidth();
|
||||||
|
@ -268,9 +265,6 @@ public class MainMenu extends BaseOpsuState {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(Graphics g) {
|
public void render(Graphics g) {
|
||||||
int width = displayContainer.width;
|
|
||||||
int height = displayContainer.height;
|
|
||||||
|
|
||||||
// draw background
|
// draw background
|
||||||
Beatmap beatmap = MusicController.getBeatmap();
|
Beatmap beatmap = MusicController.getBeatmap();
|
||||||
if (OPTION_DYNAMIC_BACKGROUND.state &&
|
if (OPTION_DYNAMIC_BACKGROUND.state &&
|
||||||
|
@ -339,7 +333,7 @@ public class MainMenu extends BaseOpsuState {
|
||||||
if (this.logoState != LogoState.DEFAULT && buttonProgress > 0f) {
|
if (this.logoState != LogoState.DEFAULT && buttonProgress > 0f) {
|
||||||
final int btnwidth = MENU_OPTIONS.getImage().getWidth();
|
final int btnwidth = MENU_OPTIONS.getImage().getWidth();
|
||||||
final float btnhalfheight = MENU_OPTIONS.getImage().getHeight() / 2f;
|
final float btnhalfheight = MENU_OPTIONS.getImage().getHeight() / 2f;
|
||||||
final int basey = displayContainer.height / 2;
|
final int basey = height2;
|
||||||
final int x = (int) (this.buttonsX + btnwidth * 0.375f * buttonProgress);
|
final int x = (int) (this.buttonsX + btnwidth * 0.375f * buttonProgress);
|
||||||
final Color col = new Color(logoColor);
|
final Color col = new Color(logoColor);
|
||||||
final Image[] imgs = {
|
final Image[] imgs = {
|
||||||
|
@ -528,8 +522,8 @@ public class MainMenu extends BaseOpsuState {
|
||||||
// buttons
|
// buttons
|
||||||
this.logo.width = MENU_LOGO.getImage().getWidth();
|
this.logo.width = MENU_LOGO.getImage().getWidth();
|
||||||
this.logo.height = MENU_LOGO.getImage().getHeight();
|
this.logo.height = MENU_LOGO.getImage().getHeight();
|
||||||
this.logo.x = (displayContainer.width - this.logo.width) / 2;
|
this.logo.x = width2 - this.logo.width / 2;
|
||||||
this.logo.y = (displayContainer.height - this.logo.height) / 2;
|
this.logo.y = height2 - this.logo.height / 2;
|
||||||
if (this.logoState != LogoState.DEFAULT) {
|
if (this.logoState != LogoState.DEFAULT) {
|
||||||
this.logo.x -= (int) this.logoPosition.getValue();
|
this.logo.x -= (int) this.logoPosition.getValue();
|
||||||
}
|
}
|
||||||
|
|
|
@ -325,23 +325,23 @@ public class SongMenu extends ComplexOpsuState {
|
||||||
components.clear();
|
components.clear();
|
||||||
|
|
||||||
// header/footer coordinates
|
// header/footer coordinates
|
||||||
headerY = displayContainer.height * 0.0075f + GameImage.MENU_MUSICNOTE.getImage().getHeight() +
|
headerY = height * 0.0075f + GameImage.MENU_MUSICNOTE.getImage().getHeight() +
|
||||||
Fonts.BOLD.getLineHeight() + Fonts.DEFAULT.getLineHeight() +
|
Fonts.BOLD.getLineHeight() + Fonts.DEFAULT.getLineHeight() +
|
||||||
Fonts.SMALL.getLineHeight();
|
Fonts.SMALL.getLineHeight();
|
||||||
footerY = displayContainer.height - GameImage.SELECTION_MODS.getImage().getHeight();
|
footerY = height - GameImage.SELECTION_MODS.getImage().getHeight();
|
||||||
|
|
||||||
// footer logo coordinates
|
// footer logo coordinates
|
||||||
float footerHeight = displayContainer.height - footerY;
|
float footerHeight = height - footerY;
|
||||||
footerLogoSize = footerHeight * 3.25f;
|
footerLogoSize = footerHeight * 3.25f;
|
||||||
Image logo = GameImage.MENU_LOGO.getImage();
|
Image logo = GameImage.MENU_LOGO.getImage();
|
||||||
logo = logo.getScaledCopy(footerLogoSize / logo.getWidth());
|
logo = logo.getScaledCopy(footerLogoSize / logo.getWidth());
|
||||||
footerLogoButton = new MenuButton(logo, displayContainer.width - footerHeight * 0.8f, displayContainer.height - footerHeight * 0.65f);
|
footerLogoButton = new MenuButton(logo, width - footerHeight * 0.8f, height - footerHeight * 0.65f);
|
||||||
footerLogoButton.setHoverAnimationDuration(1);
|
footerLogoButton.setHoverAnimationDuration(1);
|
||||||
footerLogoButton.setHoverExpand(1.2f);
|
footerLogoButton.setHoverExpand(1.2f);
|
||||||
|
|
||||||
// initialize sorts
|
// initialize sorts
|
||||||
int sortWidth = (int) (displayContainer.width * 0.12f);
|
int sortWidth = (int) (width * 0.12f);
|
||||||
int posX = (int) (displayContainer.width * 0.87f);
|
int posX = (int) (width * 0.87f);
|
||||||
int posY = (int) (headerY - GameImage.MENU_TAB.getImage().getHeight() * 2.25f);
|
int posY = (int) (headerY - GameImage.MENU_TAB.getImage().getHeight() * 2.25f);
|
||||||
sortMenu = new DropdownMenu<BeatmapSortOrder>(displayContainer, BeatmapSortOrder.values(), posX, posY, sortWidth) {
|
sortMenu = new DropdownMenu<BeatmapSortOrder>(displayContainer, BeatmapSortOrder.values(), posX, posY, sortWidth) {
|
||||||
@Override
|
@Override
|
||||||
|
@ -372,25 +372,25 @@ public class SongMenu extends ComplexOpsuState {
|
||||||
|
|
||||||
// initialize group tabs
|
// initialize group tabs
|
||||||
for (BeatmapGroup group : BeatmapGroup.values())
|
for (BeatmapGroup group : BeatmapGroup.values())
|
||||||
group.init(displayContainer.width, headerY - DIVIDER_LINE_WIDTH / 2);
|
group.init(width, headerY - DIVIDER_LINE_WIDTH / 2);
|
||||||
|
|
||||||
// initialize score data buttons
|
// initialize score data buttons
|
||||||
ScoreData.init(displayContainer.width, headerY + displayContainer.height * 0.01f);
|
ScoreData.init(width, headerY + height * 0.01f);
|
||||||
|
|
||||||
// song button background & graphics context
|
// song button background & graphics context
|
||||||
Image menuBackground = GameImage.MENU_BUTTON_BG.getImage();
|
Image menuBackground = GameImage.MENU_BUTTON_BG.getImage();
|
||||||
|
|
||||||
// song button coordinates
|
// song button coordinates
|
||||||
buttonX = displayContainer.width * 0.6f;
|
buttonX = width * 0.6f;
|
||||||
//buttonY = headerY;
|
//buttonY = headerY;
|
||||||
buttonWidth = menuBackground.getWidth();
|
buttonWidth = menuBackground.getWidth();
|
||||||
buttonHeight = menuBackground.getHeight();
|
buttonHeight = menuBackground.getHeight();
|
||||||
buttonOffset = (footerY - headerY - DIVIDER_LINE_WIDTH) / MAX_SONG_BUTTONS;
|
buttonOffset = (footerY - headerY - DIVIDER_LINE_WIDTH) / MAX_SONG_BUTTONS;
|
||||||
|
|
||||||
// search
|
// search
|
||||||
int textFieldX = (int) (displayContainer.width * 0.7125f + Fonts.BOLD.getWidth("Search: "));
|
int textFieldX = (int) (width * 0.7125f + Fonts.BOLD.getWidth("Search: "));
|
||||||
int textFieldY = (int) (headerY + Fonts.BOLD.getLineHeight() / 2);
|
int textFieldY = (int) (headerY + Fonts.BOLD.getLineHeight() / 2);
|
||||||
searchTextField = new TextField(Fonts.BOLD, textFieldX, textFieldY, (int) (displayContainer.width * 0.99f) - textFieldX, Fonts.BOLD.getLineHeight()) {
|
searchTextField = new TextField(Fonts.BOLD, textFieldX, textFieldY, (int) (width * 0.99f) - textFieldX, Fonts.BOLD.getLineHeight()) {
|
||||||
@Override
|
@Override
|
||||||
public boolean isFocusable() {
|
public boolean isFocusable() {
|
||||||
return false;
|
return false;
|
||||||
|
@ -413,8 +413,8 @@ public class SongMenu extends ComplexOpsuState {
|
||||||
if (selectButtonsWidth < 20) {
|
if (selectButtonsWidth < 20) {
|
||||||
selectButtonsWidth = 100;
|
selectButtonsWidth = 100;
|
||||||
}
|
}
|
||||||
float selectX = displayContainer.width * 0.183f + selectButtonsWidth / 2f;
|
float selectX = width * 0.183f + selectButtonsWidth / 2f;
|
||||||
float selectY = displayContainer.height - selectButtonsHeight / 2f;
|
float selectY = height - selectButtonsHeight / 2f;
|
||||||
float selectOffset = selectButtonsWidth * 1.05f;
|
float selectOffset = selectButtonsWidth * 1.05f;
|
||||||
selectModsButton = new MenuButton(GameImage.SELECTION_MODS_OVERLAY.getImage(),
|
selectModsButton = new MenuButton(GameImage.SELECTION_MODS_OVERLAY.getImage(),
|
||||||
selectX, selectY);
|
selectX, selectY);
|
||||||
|
@ -450,8 +450,8 @@ public class SongMenu extends ComplexOpsuState {
|
||||||
});
|
});
|
||||||
|
|
||||||
// star stream
|
// star stream
|
||||||
starStream = new StarStream(displayContainer.width, (displayContainer.height - GameImage.STAR.getImage().getHeight()) / 2, -displayContainer.width, 0, MAX_STREAM_STARS);
|
starStream = new StarStream(width, height2 - GameImage.STAR.getImage().getHeight() / 2, -width, 0, MAX_STREAM_STARS);
|
||||||
starStream.setPositionSpread(displayContainer.height / 20f);
|
starStream.setPositionSpread(height / 20f);
|
||||||
starStream.setDirectionSpread(10f);
|
starStream.setDirectionSpread(10f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -459,8 +459,6 @@ public class SongMenu extends ComplexOpsuState {
|
||||||
public void render(Graphics g) {
|
public void render(Graphics g) {
|
||||||
g.setBackground(Color.black);
|
g.setBackground(Color.black);
|
||||||
|
|
||||||
int width = displayContainer.width;
|
|
||||||
int height = displayContainer.height;
|
|
||||||
int mouseX = displayContainer.mouseX;
|
int mouseX = displayContainer.mouseX;
|
||||||
int mouseY = displayContainer.mouseY;
|
int mouseY = displayContainer.mouseY;
|
||||||
|
|
||||||
|
@ -697,12 +695,10 @@ public class SongMenu extends ComplexOpsuState {
|
||||||
g.fillRect(0, 0, width, height);
|
g.fillRect(0, 0, width, height);
|
||||||
|
|
||||||
UI.drawLoadingProgress(g);
|
UI.drawLoadingProgress(g);
|
||||||
|
} else {
|
||||||
|
backButton.draw(g);
|
||||||
}
|
}
|
||||||
|
|
||||||
// back button
|
|
||||||
else
|
|
||||||
UI.getBackButton().draw(g);
|
|
||||||
|
|
||||||
UI.draw(g);
|
UI.draw(g);
|
||||||
|
|
||||||
super.render(g);
|
super.render(g);
|
||||||
|
@ -730,7 +726,7 @@ public class SongMenu extends ComplexOpsuState {
|
||||||
}
|
}
|
||||||
int mouseX = displayContainer.mouseX;
|
int mouseX = displayContainer.mouseX;
|
||||||
int mouseY = displayContainer.mouseY;
|
int mouseY = displayContainer.mouseY;
|
||||||
UI.getBackButton().hoverUpdate(delta, mouseX, mouseY);
|
backButton.hoverUpdate(delta, mouseX, mouseY);
|
||||||
selectModsButton.hoverUpdate(delta, mouseX, mouseY);
|
selectModsButton.hoverUpdate(delta, mouseX, mouseY);
|
||||||
selectRandomButton.hoverUpdate(delta, mouseX, mouseY);
|
selectRandomButton.hoverUpdate(delta, mouseX, mouseY);
|
||||||
selectMapOptionsButton.hoverUpdate(delta, mouseX, mouseY);
|
selectMapOptionsButton.hoverUpdate(delta, mouseX, mouseY);
|
||||||
|
@ -904,7 +900,7 @@ public class SongMenu extends ComplexOpsuState {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UI.getBackButton().contains(x, y)) {
|
if (backButton.contains(x, y)) {
|
||||||
SoundController.playSound(SoundEffect.MENUBACK);
|
SoundController.playSound(SoundEffect.MENUBACK);
|
||||||
displayContainer.switchState(mainmenuState);
|
displayContainer.switchState(mainmenuState);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -107,11 +107,13 @@ public class Splash extends BaseOpsuState {
|
||||||
@Override
|
@Override
|
||||||
public void render(Graphics g) {
|
public void render(Graphics g) {
|
||||||
g.setBackground(Color.black);
|
g.setBackground(Color.black);
|
||||||
GameImage.MENU_LOGO.getImage().drawCentered(
|
final Color col;
|
||||||
displayContainer.width / 2,
|
if (OPTION_COLOR_MAIN_MENU_LOGO.state) {
|
||||||
displayContainer.height / 2,
|
col = Cursor.lastCursorColor;
|
||||||
OPTION_COLOR_MAIN_MENU_LOGO.state ? Cursor.lastCursorColor : Color.white
|
} else {
|
||||||
);
|
col = Color.white;
|
||||||
|
}
|
||||||
|
GameImage.MENU_LOGO.getImage().drawCentered(width2, height2, col);
|
||||||
UI.drawLoadingProgress(g);
|
UI.drawLoadingProgress(g);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,6 @@ import itdelatrisu.opsu.ui.animations.AnimationEquation;
|
||||||
import org.newdawn.slick.Color;
|
import org.newdawn.slick.Color;
|
||||||
import org.newdawn.slick.Graphics;
|
import org.newdawn.slick.Graphics;
|
||||||
import org.newdawn.slick.Image;
|
import org.newdawn.slick.Image;
|
||||||
import yugecin.opsudance.core.DisplayContainer;
|
|
||||||
import yugecin.opsudance.ui.BackButton;
|
|
||||||
|
|
||||||
import static yugecin.opsudance.options.Options.*;
|
import static yugecin.opsudance.options.Options.*;
|
||||||
import static yugecin.opsudance.core.InstanceContainer.*;
|
import static yugecin.opsudance.core.InstanceContainer.*;
|
||||||
|
@ -39,9 +37,6 @@ import static yugecin.opsudance.core.InstanceContainer.*;
|
||||||
*/
|
*/
|
||||||
public class UI {
|
public class UI {
|
||||||
|
|
||||||
/** Back button. */
|
|
||||||
private static BackButton backButton;
|
|
||||||
|
|
||||||
/** Time to show volume image, in milliseconds. */
|
/** Time to show volume image, in milliseconds. */
|
||||||
private static final int VOLUME_DISPLAY_TIME = 1500;
|
private static final int VOLUME_DISPLAY_TIME = 1500;
|
||||||
|
|
||||||
|
@ -57,20 +52,9 @@ public class UI {
|
||||||
/** The alpha level of the current tooltip (if any). */
|
/** The alpha level of the current tooltip (if any). */
|
||||||
private static AnimatedValue tooltipAlpha = new AnimatedValue(200, 0f, 1f, AnimationEquation.LINEAR);
|
private static AnimatedValue tooltipAlpha = new AnimatedValue(200, 0f, 1f, AnimationEquation.LINEAR);
|
||||||
|
|
||||||
// game-related variables
|
|
||||||
private static DisplayContainer displayContainer;
|
|
||||||
|
|
||||||
// This class should not be instantiated.
|
// This class should not be instantiated.
|
||||||
private UI() {}
|
private UI() {}
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializes UI data.
|
|
||||||
*/
|
|
||||||
public static void init(DisplayContainer displayContainer) {
|
|
||||||
UI.displayContainer = displayContainer;
|
|
||||||
backButton = new BackButton(displayContainer);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates all UI components by a delta interval.
|
* Updates all UI components by a delta interval.
|
||||||
* @param delta the delta interval since the last call.
|
* @param delta the delta interval since the last call.
|
||||||
|
@ -92,15 +76,9 @@ public class UI {
|
||||||
* Resets the necessary UI components upon entering a state.
|
* Resets the necessary UI components upon entering a state.
|
||||||
*/
|
*/
|
||||||
public static void enter() {
|
public static void enter() {
|
||||||
backButton.resetHover();
|
|
||||||
resetTooltip();
|
resetTooltip();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the 'menu-back' MenuButton.
|
|
||||||
*/
|
|
||||||
public static BackButton getBackButton() { return backButton; }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draws a tab image and text centered at a location.
|
* Draws a tab image and text centered at a location.
|
||||||
* @param x the center x coordinate
|
* @param x the center x coordinate
|
||||||
|
@ -144,13 +122,13 @@ public class UI {
|
||||||
else if (ratio >= 0.9f)
|
else if (ratio >= 0.9f)
|
||||||
xOffset = img.getWidth() * (1 - ((1 - ratio) * 10f));
|
xOffset = img.getWidth() * (1 - ((1 - ratio) * 10f));
|
||||||
|
|
||||||
img.drawCentered(displayContainer.width - img.getWidth() / 2f + xOffset, displayContainer.height / 2f);
|
img.drawCentered(width - img.getWidth() / 2f + xOffset, height2);
|
||||||
float barHeight = img.getHeight() * 0.9f;
|
float barHeight = img.getHeight() * 0.9f;
|
||||||
float volume = OPTION_MASTER_VOLUME.val / 100f;
|
float volume = OPTION_MASTER_VOLUME.val / 100f;
|
||||||
g.setColor(Color.white);
|
g.setColor(Color.white);
|
||||||
g.fillRoundRect(
|
g.fillRoundRect(
|
||||||
displayContainer.width - (img.getWidth() * 0.368f) + xOffset,
|
width - (img.getWidth() * 0.368f) + xOffset,
|
||||||
(displayContainer.height / 2f) - (img.getHeight() * 0.47f) + (barHeight * (1 - volume)),
|
height2 - (img.getHeight() * 0.47f) + (barHeight * (1 - volume)),
|
||||||
img.getWidth() * 0.15f, barHeight * volume, 3
|
img.getWidth() * 0.15f, barHeight * volume, 3
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -209,8 +187,8 @@ public class UI {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// draw loading info
|
// draw loading info
|
||||||
float marginX = displayContainer.width * 0.02f, marginY = displayContainer.height * 0.02f;
|
float marginX = width * 0.02f, marginY = height * 0.02f;
|
||||||
float lineY = displayContainer.height - marginY;
|
float lineY = height - marginY;
|
||||||
int lineOffsetY = Fonts.MEDIUM.getLineHeight();
|
int lineOffsetY = Fonts.MEDIUM.getLineHeight();
|
||||||
if (OPTION_LOAD_VERBOSE.state) {
|
if (OPTION_LOAD_VERBOSE.state) {
|
||||||
// verbose: display percentages and file names
|
// verbose: display percentages and file names
|
||||||
|
@ -223,7 +201,7 @@ public class UI {
|
||||||
Fonts.MEDIUM.drawString(marginX, lineY - (lineOffsetY * 2), text, Color.white);
|
Fonts.MEDIUM.drawString(marginX, lineY - (lineOffsetY * 2), text, Color.white);
|
||||||
g.setColor(Color.white);
|
g.setColor(Color.white);
|
||||||
g.fillRoundRect(marginX, lineY - (lineOffsetY / 2f),
|
g.fillRoundRect(marginX, lineY - (lineOffsetY / 2f),
|
||||||
(displayContainer.width - (marginX * 2f)) * progress / 100f, lineOffsetY / 4f, 4
|
(width - (marginX * 2f)) * progress / 100f, lineOffsetY / 4f, 4
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -247,7 +225,7 @@ public class UI {
|
||||||
float unitBaseX, float unitBaseY, float unitWidth, float scrollAreaHeight,
|
float unitBaseX, float unitBaseY, float unitWidth, float scrollAreaHeight,
|
||||||
Color bgColor, Color scrollbarColor, boolean right
|
Color bgColor, Color scrollbarColor, boolean right
|
||||||
) {
|
) {
|
||||||
float scrollbarWidth = displayContainer.width * 0.00347f;
|
float scrollbarWidth = width * 0.00347f;
|
||||||
float scrollbarHeight = scrollAreaHeight * lengthShown / totalLength;
|
float scrollbarHeight = scrollAreaHeight * lengthShown / totalLength;
|
||||||
float offsetY = (scrollAreaHeight - scrollbarHeight) * (position / (totalLength - lengthShown));
|
float offsetY = (scrollAreaHeight - scrollbarHeight) * (position / (totalLength - lengthShown));
|
||||||
float scrollbarX = unitBaseX + unitWidth - ((right) ? scrollbarWidth : 0);
|
float scrollbarX = unitBaseX + unitWidth - ((right) ? scrollbarWidth : 0);
|
||||||
|
@ -283,7 +261,7 @@ public class UI {
|
||||||
if (tooltipAlpha.getTime() == 0 || tooltip == null)
|
if (tooltipAlpha.getTime() == 0 || tooltip == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int margin = displayContainer.width / 100, textMarginX = 2;
|
int margin = width / 100, textMarginX = 2;
|
||||||
int offset = GameImage.CURSOR_MIDDLE.getImage().getWidth() / 2;
|
int offset = GameImage.CURSOR_MIDDLE.getImage().getWidth() / 2;
|
||||||
int lineHeight = Fonts.SMALL.getLineHeight();
|
int lineHeight = Fonts.SMALL.getLineHeight();
|
||||||
int textWidth = textMarginX * 2, textHeight = lineHeight;
|
int textWidth = textMarginX * 2, textHeight = lineHeight;
|
||||||
|
@ -303,12 +281,12 @@ public class UI {
|
||||||
// get drawing coordinates
|
// get drawing coordinates
|
||||||
int x = displayContainer.mouseX + offset;
|
int x = displayContainer.mouseX + offset;
|
||||||
int y = displayContainer.mouseY + offset;
|
int y = displayContainer.mouseY + offset;
|
||||||
if (x + textWidth > displayContainer.width - margin)
|
if (x + textWidth > width - margin)
|
||||||
x = displayContainer.width - margin - textWidth;
|
x = width - margin - textWidth;
|
||||||
else if (x < margin)
|
else if (x < margin)
|
||||||
x = margin;
|
x = margin;
|
||||||
if (y + textHeight > displayContainer.height - margin)
|
if (y + textHeight > height - margin)
|
||||||
y = displayContainer.height - margin - textHeight;
|
y = height - margin - textHeight;
|
||||||
else if (y < margin)
|
else if (y < margin)
|
||||||
y = margin;
|
y = margin;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* opsu!dance - fork of opsu! with cursordance auto
|
* opsu!dance - fork of opsu! with cursordance auto
|
||||||
* Copyright (C) 2016 yugecin
|
* Copyright (C) 2016-2018 yugecin
|
||||||
*
|
*
|
||||||
* opsu!dance is free software: you can redistribute it and/or modify
|
* opsu!dance is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -35,7 +35,6 @@ import yugecin.opsudance.movers.factories.*;
|
||||||
import yugecin.opsudance.movers.slidermovers.DefaultSliderMoverController;
|
import yugecin.opsudance.movers.slidermovers.DefaultSliderMoverController;
|
||||||
import yugecin.opsudance.movers.slidermovers.InheritedSliderMoverController;
|
import yugecin.opsudance.movers.slidermovers.InheritedSliderMoverController;
|
||||||
import yugecin.opsudance.movers.slidermovers.SliderMoverController;
|
import yugecin.opsudance.movers.slidermovers.SliderMoverController;
|
||||||
import yugecin.opsudance.render.GameObjectRenderer;
|
|
||||||
import yugecin.opsudance.spinners.*;
|
import yugecin.opsudance.spinners.*;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
@ -252,8 +251,8 @@ public class Dancer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Pippi.dance(time, c, isCurrentLazySlider);
|
Pippi.dance(time, c, isCurrentLazySlider);
|
||||||
x = Utils.clamp(x, 10, displayContainer.width - 10);
|
x = Utils.clamp(x, 10, width - 10);
|
||||||
y = Utils.clamp(y, 10, displayContainer.height - 10);
|
y = Utils.clamp(y, 10, height - 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createNewMover() {
|
private void createNewMover() {
|
||||||
|
|
|
@ -44,6 +44,7 @@ import yugecin.opsudance.core.errorhandling.ErrorDumpable;
|
||||||
import yugecin.opsudance.core.state.OpsuState;
|
import yugecin.opsudance.core.state.OpsuState;
|
||||||
import yugecin.opsudance.events.ResolutionChangedListener;
|
import yugecin.opsudance.events.ResolutionChangedListener;
|
||||||
import yugecin.opsudance.events.SkinChangedListener;
|
import yugecin.opsudance.events.SkinChangedListener;
|
||||||
|
import yugecin.opsudance.ui.BackButton;
|
||||||
import yugecin.opsudance.utils.GLHelper;
|
import yugecin.opsudance.utils.GLHelper;
|
||||||
|
|
||||||
import java.io.StringWriter;
|
import java.io.StringWriter;
|
||||||
|
@ -68,9 +69,6 @@ public class DisplayContainer implements ErrorDumpable, SkinChangedListener {
|
||||||
|
|
||||||
private Graphics graphics;
|
private Graphics graphics;
|
||||||
|
|
||||||
public int width;
|
|
||||||
public int height;
|
|
||||||
|
|
||||||
public int mouseX;
|
public int mouseX;
|
||||||
public int mouseY;
|
public int mouseY;
|
||||||
|
|
||||||
|
@ -149,12 +147,13 @@ public class DisplayContainer implements ErrorDumpable, SkinChangedListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
backButton = new BackButton();
|
||||||
|
|
||||||
// TODO clean this up
|
// TODO clean this up
|
||||||
GameMod.init(width, height);
|
GameMod.init(width, height);
|
||||||
PlaybackSpeed.init(width, height);
|
PlaybackSpeed.init(width, height);
|
||||||
HitObject.init(width, height);
|
HitObject.init(width, height);
|
||||||
DownloadNode.init(width, height);
|
DownloadNode.init(width, height);
|
||||||
UI.init(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUPS(int ups) {
|
public void setUPS(int ups) {
|
||||||
|
@ -262,7 +261,7 @@ public class DisplayContainer implements ErrorDumpable, SkinChangedListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setup() throws Exception {
|
public void setup() throws Exception {
|
||||||
width = height = -1;
|
width = height = width2 = height2 = -1;
|
||||||
Display.setTitle("opsu!dance");
|
Display.setTitle("opsu!dance");
|
||||||
setupResolutionOptionlist(nativeDisplayMode.getWidth(), nativeDisplayMode.getHeight());
|
setupResolutionOptionlist(nativeDisplayMode.getWidth(), nativeDisplayMode.getHeight());
|
||||||
updateDisplayMode(OPTION_SCREEN_RESOLUTION.getValueString());
|
updateDisplayMode(OPTION_SCREEN_RESOLUTION.getValueString());
|
||||||
|
@ -372,29 +371,34 @@ public class DisplayContainer implements ErrorDumpable, SkinChangedListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDisplayMode(int width, int height, boolean fullscreen) throws Exception {
|
public void setDisplayMode(int w, int h, boolean fullscreen) throws Exception {
|
||||||
if (this.width == width && this.height == height) {
|
if (width == w && height == h) {
|
||||||
Display.setFullscreen(fullscreen);
|
Display.setFullscreen(fullscreen);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DisplayMode displayMode = null;
|
DisplayMode displayMode = null;
|
||||||
if (fullscreen) {
|
if (fullscreen) {
|
||||||
displayMode = GLHelper.findFullscreenDisplayMode(nativeDisplayMode.getBitsPerPixel(), nativeDisplayMode.getFrequency(), width, height);
|
final int bpp = this.nativeDisplayMode.getBitsPerPixel();
|
||||||
|
final int freq = this.nativeDisplayMode.getFrequency();
|
||||||
|
displayMode = GLHelper.findFullscreenDisplayMode(bpp, freq, w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (displayMode == null) {
|
if (displayMode == null) {
|
||||||
displayMode = new DisplayMode(width, height);
|
displayMode = new DisplayMode(w, h);
|
||||||
if (fullscreen) {
|
if (fullscreen) {
|
||||||
fullscreen = false;
|
fullscreen = false;
|
||||||
String msg = String.format("Fullscreen mode is not supported for %sx%s", width, height);
|
String msg = "Fullscreen mode is not supported for %sx%s";
|
||||||
|
msg = String.format(msg, w, h);
|
||||||
Log.warn(msg);
|
Log.warn(msg);
|
||||||
bubNotifs.send(BUB_ORANGE, msg);
|
bubNotifs.send(BUB_ORANGE, msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.width = displayMode.getWidth();
|
width = displayMode.getWidth();
|
||||||
this.height = displayMode.getHeight();
|
height = displayMode.getHeight();
|
||||||
|
width2 = width / 2;
|
||||||
|
height2 = height / 2;
|
||||||
|
|
||||||
Display.setDisplayMode(displayMode);
|
Display.setDisplayMode(displayMode);
|
||||||
Display.setFullscreen(fullscreen);
|
Display.setFullscreen(fullscreen);
|
||||||
|
@ -509,6 +513,7 @@ public class DisplayContainer implements ErrorDumpable, SkinChangedListener {
|
||||||
this.state = state;
|
this.state = state;
|
||||||
this.state.enter();
|
this.state.enter();
|
||||||
input.addListener(this.state);
|
input.addListener(this.state);
|
||||||
|
backButton.resetHover();
|
||||||
if (this.rendering) {
|
if (this.rendering) {
|
||||||
// state might be changed in preRenderUpdate,
|
// state might be changed in preRenderUpdate,
|
||||||
// in that case the new state will be rendered without having
|
// in that case the new state will be rendered without having
|
||||||
|
|
|
@ -34,6 +34,7 @@ import yugecin.opsudance.options.Configuration;
|
||||||
import yugecin.opsudance.options.OptionsService;
|
import yugecin.opsudance.options.OptionsService;
|
||||||
import yugecin.opsudance.render.GameObjectRenderer;
|
import yugecin.opsudance.render.GameObjectRenderer;
|
||||||
import yugecin.opsudance.skinning.SkinService;
|
import yugecin.opsudance.skinning.SkinService;
|
||||||
|
import yugecin.opsudance.ui.BackButton;
|
||||||
import yugecin.opsudance.utils.ManifestWrapper;
|
import yugecin.opsudance.utils.ManifestWrapper;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
@ -55,6 +56,7 @@ public class InstanceContainer {
|
||||||
public static BeatmapParser beatmapParser;
|
public static BeatmapParser beatmapParser;
|
||||||
public static Updater updater;
|
public static Updater updater;
|
||||||
|
|
||||||
|
public static BackButton backButton;
|
||||||
public static DisplayContainer displayContainer;
|
public static DisplayContainer displayContainer;
|
||||||
public static Input input;
|
public static Input input;
|
||||||
|
|
||||||
|
@ -73,6 +75,8 @@ public class InstanceContainer {
|
||||||
public static GameRanking gameRankingState;
|
public static GameRanking gameRankingState;
|
||||||
public static GamePauseMenu pauseState;
|
public static GamePauseMenu pauseState;
|
||||||
|
|
||||||
|
public static int width, width2, height, height2;
|
||||||
|
|
||||||
public static void kickstart() {
|
public static void kickstart() {
|
||||||
updater = new Updater();
|
updater = new Updater();
|
||||||
env = new Environment();
|
env = new Environment();
|
||||||
|
|
|
@ -26,7 +26,7 @@ import yugecin.opsudance.events.ResolutionChangedListener;
|
||||||
import java.util.Formatter;
|
import java.util.Formatter;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static yugecin.opsudance.core.InstanceContainer.displayContainer;
|
import static yugecin.opsudance.core.InstanceContainer.*;
|
||||||
|
|
||||||
public class BarNotificationState implements ResolutionChangedListener {
|
public class BarNotificationState implements ResolutionChangedListener {
|
||||||
|
|
||||||
|
@ -60,10 +60,10 @@ public class BarNotificationState implements ResolutionChangedListener {
|
||||||
timeShown += displayContainer.renderDelta;
|
timeShown += displayContainer.renderDelta;
|
||||||
processAnimations();
|
processAnimations();
|
||||||
g.setColor(bgcol);
|
g.setColor(bgcol);
|
||||||
g.fillRect(0, displayContainer.height / 2 - barHalfHeight, displayContainer.width, barHalfHeight * 2);
|
g.fillRect(0, height2 - barHalfHeight, width, barHalfHeight * 2);
|
||||||
int y = textY;
|
int y = textY;
|
||||||
for (String line : lines) {
|
for (String line : lines) {
|
||||||
Fonts.LARGE.drawString((displayContainer.width - Fonts.LARGE.getWidth(line)) / 2, y, line, textCol);
|
Fonts.LARGE.drawString((width - Fonts.LARGE.getWidth(line)) / 2, y, line, textCol);
|
||||||
y += Fonts.LARGE.getLineHeight();
|
y += Fonts.LARGE.getLineHeight();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -88,9 +88,9 @@ public class BarNotificationState implements ResolutionChangedListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void calculatePosition() {
|
private void calculatePosition() {
|
||||||
this.lines = Fonts.wrap(Fonts.LARGE, message, (int) (displayContainer.width * 0.96f), true);
|
this.lines = Fonts.wrap(Fonts.LARGE, message, (int) (width * 0.96f), true);
|
||||||
int textHeight = (int) (Fonts.LARGE.getLineHeight() * (lines.size() + 0.5f));
|
int textHeight = (int) (Fonts.LARGE.getLineHeight() * (lines.size() + 0.5f));
|
||||||
textY = (displayContainer.height - textHeight) / 2 + (int) (Fonts.LARGE.getLineHeight() / 5f);
|
textY = (height - textHeight) / 2 + (int) (Fonts.LARGE.getLineHeight() / 5f);
|
||||||
barHalfTargetHeight = textHeight / 2;
|
barHalfTargetHeight = textHeight / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,10 +72,10 @@ public class BubNotifState implements MouseListener, ResolutionChangedListener {
|
||||||
|
|
||||||
private void calculatePositions() {
|
private void calculatePositions() {
|
||||||
// if width is 0, attempting to wrap it will result in infinite loop
|
// if width is 0, attempting to wrap it will result in infinite loop
|
||||||
Notification.width = Math.max(50, (int) (displayContainer.width * 0.1703125f));
|
Notification.width = Math.max(50, (int) (width * 0.1703125f));
|
||||||
Notification.baseLine = (int) (displayContainer.height * 0.9645f);
|
Notification.baseLine = (int) (height * 0.9645f);
|
||||||
Notification.paddingY = (int) (displayContainer.height * 0.0144f);
|
Notification.paddingY = (int) (height * 0.0144f);
|
||||||
Notification.finalX = displayContainer.width - Notification.width - (int) (displayContainer.width * 0.01);
|
Notification.finalX = width - Notification.width - (int) (width * 0.01);
|
||||||
Notification.fontPaddingX = (int) (Notification.width * 0.02f);
|
Notification.fontPaddingX = (int) (Notification.width * 0.02f);
|
||||||
Notification.fontPaddingY = (int) (Fonts.SMALLBOLD.getLineHeight() / 4f);
|
Notification.fontPaddingY = (int) (Fonts.SMALLBOLD.getLineHeight() / 4f);
|
||||||
Notification.lineHeight = Fonts.SMALLBOLD.getLineHeight();
|
Notification.lineHeight = Fonts.SMALLBOLD.getLineHeight();
|
||||||
|
|
|
@ -24,7 +24,7 @@ import yugecin.opsudance.events.ResolutionChangedListener;
|
||||||
import yugecin.opsudance.utils.FPSMeter;
|
import yugecin.opsudance.utils.FPSMeter;
|
||||||
|
|
||||||
import static yugecin.opsudance.options.Options.*;
|
import static yugecin.opsudance.options.Options.*;
|
||||||
import static yugecin.opsudance.core.InstanceContainer.displayContainer;
|
import static yugecin.opsudance.core.InstanceContainer.*;
|
||||||
|
|
||||||
public class FpsRenderState implements ResolutionChangedListener {
|
public class FpsRenderState implements ResolutionChangedListener {
|
||||||
|
|
||||||
|
@ -90,8 +90,8 @@ public class FpsRenderState implements ResolutionChangedListener {
|
||||||
@Override
|
@Override
|
||||||
public void onResolutionChanged(int w, int h) {
|
public void onResolutionChanged(int w, int h) {
|
||||||
singleHeight = Fonts.SMALL.getLineHeight();
|
singleHeight = Fonts.SMALL.getLineHeight();
|
||||||
x = displayContainer.width - 3;
|
x = width - 3;
|
||||||
y = displayContainer.height - 3 - singleHeight - 10;
|
y = height - 3 - singleHeight - 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* opsu!dance - fork of opsu! with cursordance auto
|
* opsu!dance - fork of opsu! with cursordance auto
|
||||||
* Copyright (C) 2016 yugecin
|
* Copyright (C) 2016-2018 yugecin
|
||||||
*
|
*
|
||||||
* opsu!dance is free software: you can redistribute it and/or modify
|
* opsu!dance is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -64,7 +64,7 @@ public class CircleMover extends Mover {
|
||||||
double a = ang + SOME_CONSTANT * t;
|
double a = ang + SOME_CONSTANT * t;
|
||||||
pos[0] = (startX + (endX - startX) * t) - middlexoffset - Math.cos(a) * radius;
|
pos[0] = (startX + (endX - startX) * t) - middlexoffset - Math.cos(a) * radius;
|
||||||
pos[1] = (startY + (endY - startY) * t) - middleyoffset - Math.sin(a) * radius;
|
pos[1] = (startY + (endY - startY) * t) - middleyoffset - Math.sin(a) * radius;
|
||||||
if (pos[0] < 0 || displayContainer.width < pos[0] || pos[1] < 0 || displayContainer.height < pos[1]) {
|
if (pos[0] < 0 || width < pos[0] || pos[1] < 0 || height < pos[1]) {
|
||||||
pass = false;
|
pass = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* opsu!dance - fork of opsu! with cursordance auto
|
* opsu!dance - fork of opsu! with cursordance auto
|
||||||
* Copyright (C) 2016 yugecin
|
* Copyright (C) 2016-2018 yugecin
|
||||||
*
|
*
|
||||||
* opsu!dance is free software: you can redistribute it and/or modify
|
* opsu!dance is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -44,8 +44,8 @@ public class ExgonMover extends Mover {
|
||||||
pos[0] = endX;
|
pos[0] = endX;
|
||||||
pos[1] = endY;
|
pos[1] = endY;
|
||||||
} else {
|
} else {
|
||||||
pos[0] = randgen.nextInt(displayContainer.width);
|
pos[0] = randgen.nextInt(width);
|
||||||
pos[1] = randgen.nextInt(displayContainer.height);
|
pos[1] = randgen.nextInt(height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return pos;
|
return pos;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* opsu!dance - fork of opsu! with cursordance auto
|
* opsu!dance - fork of opsu! with cursordance auto
|
||||||
* Copyright (C) 2016 yugecin
|
* Copyright (C) 2016-2018 yugecin
|
||||||
*
|
*
|
||||||
* opsu!dance is free software: you can redistribute it and/or modify
|
* opsu!dance is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -102,8 +102,8 @@ public class AutoMoverFactory implements MoverFactory {
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean checkBounds( double[] pos ) {
|
private boolean checkBounds( double[] pos ) {
|
||||||
return 0 < pos[0] && pos[0] < displayContainer.width - displayContainer.width / 8 &&
|
return 0 < pos[0] && pos[0] < width - width / 8 &&
|
||||||
0 < pos[1] && pos[1] < displayContainer.height - displayContainer.height / 8;
|
0 < pos[1] && pos[1] < height - height / 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -71,12 +71,12 @@ public class MoveStoryboard extends OverlayOpsuState{
|
||||||
public void revalidate() {
|
public void revalidate() {
|
||||||
super.revalidate();
|
super.revalidate();
|
||||||
|
|
||||||
btnAddLinear = new SimpleButton(displayContainer.width - 205, 50, 200, 25, Fonts.SMALL, "add linear", Colors.BLUE_BUTTON, Colors.WHITE_FADE, Colors.WHITE_FADE, Colors.ORANGE_BUTTON);
|
btnAddLinear = new SimpleButton(width - 205, 50, 200, 25, Fonts.SMALL, "add linear", Colors.BLUE_BUTTON, Colors.WHITE_FADE, Colors.WHITE_FADE, Colors.ORANGE_BUTTON);
|
||||||
btnAddQuadratic = new SimpleButton(displayContainer.width - 205, 80, 200, 25, Fonts.SMALL, "add quadratic", Colors.BLUE_BUTTON, Colors.WHITE_FADE, Colors.WHITE_FADE, Colors.ORANGE_BUTTON);
|
btnAddQuadratic = new SimpleButton(width - 205, 80, 200, 25, Fonts.SMALL, "add quadratic", Colors.BLUE_BUTTON, Colors.WHITE_FADE, Colors.WHITE_FADE, Colors.ORANGE_BUTTON);
|
||||||
btnAddCubic = new SimpleButton(displayContainer.width - 205, 110, 200, 25, Fonts.SMALL, "add cubic", Colors.BLUE_BUTTON, Colors.WHITE_FADE, Colors.WHITE_FADE, Colors.ORANGE_BUTTON);
|
btnAddCubic = new SimpleButton(width - 205, 110, 200, 25, Fonts.SMALL, "add cubic", Colors.BLUE_BUTTON, Colors.WHITE_FADE, Colors.WHITE_FADE, Colors.ORANGE_BUTTON);
|
||||||
btnAnimLin = new SimpleButton(displayContainer.width - 250, 50, 40, 25, Fonts.SMALL, "lin", Color.blue, Color.white, Color.white, Color.orange);
|
btnAnimLin = new SimpleButton(width - 250, 50, 40, 25, Fonts.SMALL, "lin", Color.blue, Color.white, Color.white, Color.orange);
|
||||||
btnAnimMid = new SimpleButton(displayContainer.width - 250, 80, 40, 25, Fonts.SMALL, "mid", Color.blue, Color.white, Color.white, Color.orange);
|
btnAnimMid = new SimpleButton(width - 250, 80, 40, 25, Fonts.SMALL, "mid", Color.blue, Color.white, Color.white, Color.orange);
|
||||||
btnAnimCub = new SimpleButton(displayContainer.width - 250, 110, 40, 25, Fonts.SMALL, "cub", Color.blue, Color.white, Color.white, Color.orange);
|
btnAnimCub = new SimpleButton(width - 250, 110, 40, 25, Fonts.SMALL, "cub", Color.blue, Color.white, Color.white, Color.orange);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -190,7 +190,7 @@ public class MoveStoryboard extends OverlayOpsuState{
|
||||||
return dummyMove;
|
return dummyMove;
|
||||||
}
|
}
|
||||||
if (moves[objectIndex] == null) {
|
if (moves[objectIndex] == null) {
|
||||||
return moves[objectIndex] = new StoryboardMoveImpl(gameObjects[objectIndex - 1].end, gameObjects[objectIndex].start, displayContainer.width);
|
return moves[objectIndex] = new StoryboardMoveImpl(gameObjects[objectIndex - 1].end, gameObjects[objectIndex].start, width);
|
||||||
}
|
}
|
||||||
return moves[objectIndex];
|
return moves[objectIndex];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* opsu!dance - fork of opsu! with cursordance auto
|
* opsu!dance - fork of opsu! with cursordance auto
|
||||||
* Copyright (C) 2016 yugecin
|
* Copyright (C) 2016-2018 yugecin
|
||||||
*
|
*
|
||||||
* opsu!dance is free software: you can redistribute it and/or modify
|
* opsu!dance is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -38,10 +38,10 @@ public class ApproachCircleSpinner extends Spinner {
|
||||||
ang += 15;
|
ang += 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
double rad = displayContainer.width / 4.0f * (1d - Spinner.PROGRESS);
|
double rad = width / 4.0f * (1d - Spinner.PROGRESS);
|
||||||
|
|
||||||
point[0] = displayContainer.width / 2.0f + rad * Math.sin(ang / 180d * Math.PI);
|
point[0] = width2 + rad * Math.sin(ang / 180d * Math.PI);
|
||||||
point[1] = displayContainer.height / 2.0f - rad * Math.cos(ang / 180d * Math.PI);
|
point[1] = height2 - rad * Math.cos(ang / 180d * Math.PI);
|
||||||
|
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* opsu!dance - fork of opsu! with cursordance auto
|
* opsu!dance - fork of opsu! with cursordance auto
|
||||||
* Copyright (C) 2016 yugecin
|
* Copyright (C) 2016-2018 yugecin
|
||||||
*
|
*
|
||||||
* opsu!dance is free software: you can redistribute it and/or modify
|
* opsu!dance is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -41,30 +41,30 @@ public class BeamSpinner extends Spinner {
|
||||||
index = ++index % 4;
|
index = ++index % 4;
|
||||||
final int MOD = 60;
|
final int MOD = 60;
|
||||||
|
|
||||||
point[0] = displayContainer.width / 2d;
|
point[0] = width2;
|
||||||
point[1] = displayContainer.height / 2d;
|
point[1] = height2;
|
||||||
|
|
||||||
if( index == 0 ) {
|
if (index == 0) {
|
||||||
add( MOD, 90 );
|
add(MOD, 90);
|
||||||
add( MOD, 180 );
|
add(MOD, 180);
|
||||||
} else if( index == 1 ) {
|
} else if (index == 1) {
|
||||||
add( MOD, 90 );
|
add(MOD, 90);
|
||||||
add( displayContainer.height / 2 * 0.8d, 0 );
|
add(height2 * 0.8d, 0);
|
||||||
} else if( index == 2 ) {
|
} else if (index == 2) {
|
||||||
add( MOD, -90 );
|
add(MOD, -90);
|
||||||
add( displayContainer.height / 2 * 0.8d, 0 );
|
add(height2 * 0.8d, 0);
|
||||||
} else if( index == 3 ) {
|
} else if (index == 3) {
|
||||||
add( MOD, -90 );
|
add(MOD, -90);
|
||||||
add( MOD, 180 );
|
add(MOD, 180);
|
||||||
ang += 0.3;
|
ang += 0.3;
|
||||||
}
|
}
|
||||||
|
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void add( double rad, double ang ) {
|
private void add (double rad, double ang ) {
|
||||||
point[0] += rad * Math.cos( (this.ang + ang) / 180d * Math.PI);
|
point[0] += rad * Math.cos((this.ang + ang) / 180d * Math.PI);
|
||||||
point[1] -= rad * Math.sin( (this.ang + ang) / 180d * Math.PI);
|
point[1] -= rad * Math.sin((this.ang + ang) / 180d * Math.PI);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* opsu!dance - fork of opsu! with cursordance auto
|
* opsu!dance - fork of opsu! with cursordance auto
|
||||||
* Copyright (C) 2016 yugecin
|
* Copyright (C) 2016-2018 yugecin
|
||||||
*
|
*
|
||||||
* opsu!dance is free software: you can redistribute it and/or modify
|
* opsu!dance is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -36,10 +36,10 @@ public class CircleSpinner extends Spinner {
|
||||||
ang += 15;
|
ang += 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
double rad = displayContainer.width / 4.0f;
|
double rad = width / 4.0f;
|
||||||
|
|
||||||
point[0] = displayContainer.width / 2.0f + rad * Math.sin(ang / 180d * Math.PI);
|
point[0] = width2 + rad * Math.sin(ang / 180d * Math.PI);
|
||||||
point[1] = displayContainer.height / 2.0f - rad * Math.cos(ang / 180d * Math.PI);
|
point[1] = height2 - rad * Math.cos(ang / 180d * Math.PI);
|
||||||
|
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* opsu!dance - fork of opsu! with cursordance auto
|
* opsu!dance - fork of opsu! with cursordance auto
|
||||||
* Copyright (C) 2016 yugecin
|
* Copyright (C) 2016-2018 yugecin
|
||||||
*
|
*
|
||||||
* opsu!dance is free software: you can redistribute it and/or modify
|
* opsu!dance is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
*/
|
*/
|
||||||
package yugecin.opsudance.spinners;
|
package yugecin.opsudance.spinners;
|
||||||
|
|
||||||
import static yugecin.opsudance.core.InstanceContainer.displayContainer;
|
import static yugecin.opsudance.core.InstanceContainer.*;
|
||||||
|
|
||||||
public class CubeSpinner extends Spinner {
|
public class CubeSpinner extends Spinner {
|
||||||
|
|
||||||
|
@ -90,10 +90,10 @@ public class CubeSpinner extends Spinner {
|
||||||
x *= 3.0d / ( z + 3.0d + 5.0d + 0.5 );
|
x *= 3.0d / ( z + 3.0d + 5.0d + 0.5 );
|
||||||
y *= 3.0d / ( z + 3.0d + 5.0d + 0.5 );
|
y *= 3.0d / ( z + 3.0d + 5.0d + 0.5 );
|
||||||
|
|
||||||
double scale = displayContainer.width / (3.0f + 0.5f * Math.cos(size / 180f * Math.PI));
|
double scale = width / (3.0f + 0.5f * Math.cos(size / 180f * Math.PI));
|
||||||
//double scale = Options.width / (3.0f + -1f * ((float)(Options.s.ElapsedMilliseconds % Options.beatTimeMs)/(float)Options.beatTimeMs));
|
//double scale = Options.width / (3.0f + -1f * ((float)(Options.s.ElapsedMilliseconds % Options.beatTimeMs)/(float)Options.beatTimeMs));
|
||||||
point[0] = (int) ( displayContainer.width / 2.0f + scale * x );
|
point[0] = (int) (width2 + scale * x );
|
||||||
point[1] = (int) ( displayContainer.height / 2.0f - scale * y );
|
point[1] = (int) (height2 - scale * y );
|
||||||
|
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* opsu!dance - fork of opsu! with cursordance auto
|
* opsu!dance - fork of opsu! with cursordance auto
|
||||||
* Copyright (C) 2016 yugecin
|
* Copyright (C) 2016-2018 yugecin
|
||||||
*
|
*
|
||||||
* opsu!dance is free software: you can redistribute it and/or modify
|
* opsu!dance is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -38,10 +38,10 @@ public class DonutSpinner extends Spinner {
|
||||||
ang += 15;
|
ang += 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
double rad = displayContainer.width / 4.0f;
|
double rad = width / 4.0f;
|
||||||
|
|
||||||
point[0] = displayContainer.width / 2.0f + rad * Math.sin(ang);
|
point[0] = width2 + rad * Math.sin(ang);
|
||||||
point[1] = displayContainer.height / 2.0f - rad * Math.cos(ang);
|
point[1] = height2 - rad * Math.cos(ang);
|
||||||
|
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* opsu!dance - fork of opsu! with cursordance auto
|
* opsu!dance - fork of opsu! with cursordance auto
|
||||||
* Copyright (C) 2016 yugecin
|
* Copyright (C) 2016-2018 yugecin
|
||||||
*
|
*
|
||||||
* opsu!dance is free software: you can redistribute it and/or modify
|
* opsu!dance is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -39,12 +39,12 @@ public class FivePointStarApproachSpinner extends Spinner {
|
||||||
odd = !odd;
|
odd = !odd;
|
||||||
}
|
}
|
||||||
|
|
||||||
double rad = displayContainer.width / 4.0f * (1d - Spinner.PROGRESS);
|
double rad = width / 4.0f * (1d - Spinner.PROGRESS);
|
||||||
if (!odd) {
|
if (!odd) {
|
||||||
rad /= 3d;
|
rad /= 3d;
|
||||||
}
|
}
|
||||||
point[0] = displayContainer.width / 2d + Math.cos(ang) * rad;
|
point[0] = width2 + Math.cos(ang) * rad;
|
||||||
point[1] = displayContainer.height / 2d + Math.sin(ang) * rad;
|
point[1] = height2 + Math.sin(ang) * rad;
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* opsu!dance - fork of opsu! with cursordance auto
|
* opsu!dance - fork of opsu! with cursordance auto
|
||||||
* Copyright (C) 2016 yugecin
|
* Copyright (C) 2016-2018 yugecin
|
||||||
*
|
*
|
||||||
* opsu!dance is free software: you can redistribute it and/or modify
|
* opsu!dance is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -24,11 +24,9 @@ public class FivePointStarSpinner extends Spinner {
|
||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
double[][] points = new double[10][];
|
double[][] points = new double[10][];
|
||||||
double midx = displayContainer.width / 2d;
|
|
||||||
double midy = displayContainer.height / 2d;
|
|
||||||
double angleIncRads = Math.PI * 36d / 180d;
|
double angleIncRads = Math.PI * 36d / 180d;
|
||||||
double ang = -Math.PI / 2d;
|
double ang = -Math.PI / 2d;
|
||||||
double maxrad = displayContainer.width / 4d;
|
double maxrad = width / 4d;
|
||||||
double minrad = maxrad / 3d;
|
double minrad = maxrad / 3d;
|
||||||
for (int i = 0; i < 10; i++) {
|
for (int i = 0; i < 10; i++) {
|
||||||
double rad = maxrad;
|
double rad = maxrad;
|
||||||
|
@ -36,8 +34,8 @@ public class FivePointStarSpinner extends Spinner {
|
||||||
rad = minrad;
|
rad = minrad;
|
||||||
}
|
}
|
||||||
points[i] = new double[] {
|
points[i] = new double[] {
|
||||||
midx + Math.cos(ang) * rad,
|
width2 + Math.cos(ang) * rad,
|
||||||
midy + Math.sin(ang) * rad
|
height2 + Math.sin(ang) * rad
|
||||||
};
|
};
|
||||||
ang += angleIncRads;
|
ang += angleIncRads;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* opsu!dance - fork of opsu! with cursordance auto
|
* opsu!dance - fork of opsu! with cursordance auto
|
||||||
* Copyright (C) 2016 yugecin
|
* Copyright (C) 2016-2018 yugecin
|
||||||
*
|
*
|
||||||
* opsu!dance is free software: you can redistribute it and/or modify
|
* opsu!dance is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -17,9 +17,7 @@
|
||||||
*/
|
*/
|
||||||
package yugecin.opsudance.spinners;
|
package yugecin.opsudance.spinners;
|
||||||
|
|
||||||
import yugecin.opsudance.options.Options;
|
import static yugecin.opsudance.core.InstanceContainer.*;
|
||||||
|
|
||||||
import static yugecin.opsudance.core.InstanceContainer.displayContainer;
|
|
||||||
|
|
||||||
public class HalfCircleSpinner extends Spinner {
|
public class HalfCircleSpinner extends Spinner {
|
||||||
|
|
||||||
|
@ -47,8 +45,8 @@ public class HalfCircleSpinner extends Spinner {
|
||||||
skipang += 359;
|
skipang += 359;
|
||||||
}
|
}
|
||||||
|
|
||||||
point[0] = displayContainer.width / 2.0d + displayContainer.height / 2 * 0.8d * Math.cos(ang/180d*Math.PI);
|
point[0] = width2 + height2 * 0.8d * Math.cos(ang/180d*Math.PI);
|
||||||
point[1] = displayContainer.height / 2.0d + displayContainer.height / 2 * 0.8d * Math.sin(ang/180d*Math.PI);
|
point[1] = height2 + height2 * 0.8d * Math.sin(ang/180d*Math.PI);
|
||||||
|
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* opsu!dance - fork of opsu! with cursordance auto
|
* opsu!dance - fork of opsu! with cursordance auto
|
||||||
* Copyright (C) 2016 yugecin
|
* Copyright (C) 2016-2018 yugecin
|
||||||
*
|
*
|
||||||
* opsu!dance is free software: you can redistribute it and/or modify
|
* opsu!dance is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -24,9 +24,9 @@ public class IlluminatiSpinner extends Spinner {
|
||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
init( new double[][] {
|
init( new double[][] {
|
||||||
new double[] { displayContainer.width / 2d - 120, displayContainer.height / 2d + 80 },
|
new double[] { width2 - 120, height2 + 80 },
|
||||||
new double[] { displayContainer.width / 2d, displayContainer.height / 2d - 160 },
|
new double[] { width2, height2 - 160 },
|
||||||
new double[] { displayContainer.width / 2d + 120, displayContainer.height / 2d + 80 }
|
new double[] { width2 + 120, height2 + 80 }
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* opsu!dance - fork of opsu! with cursordance auto
|
* opsu!dance - fork of opsu! with cursordance auto
|
||||||
* Copyright (C) 2016 yugecin
|
* Copyright (C) 2016-2018 yugecin
|
||||||
*
|
*
|
||||||
* opsu!dance is free software: you can redistribute it and/or modify
|
* opsu!dance is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -17,6 +17,7 @@
|
||||||
*/
|
*/
|
||||||
package yugecin.opsudance.spinners;
|
package yugecin.opsudance.spinners;
|
||||||
|
|
||||||
|
import static java.lang.Math.*;
|
||||||
import static yugecin.opsudance.core.InstanceContainer.*;
|
import static yugecin.opsudance.core.InstanceContainer.*;
|
||||||
|
|
||||||
public class LessThanThreeSpinner extends Spinner {
|
public class LessThanThreeSpinner extends Spinner {
|
||||||
|
@ -24,9 +25,7 @@ public class LessThanThreeSpinner extends Spinner {
|
||||||
private int angle = 0;
|
private int angle = 0;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init()
|
public void init() {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -37,15 +36,12 @@ public class LessThanThreeSpinner extends Spinner {
|
||||||
}
|
}
|
||||||
if( angle > 360 ) angle = 0;
|
if( angle > 360 ) angle = 0;
|
||||||
double theta = angle / 180d * Math.PI;
|
double theta = angle / 180d * Math.PI;
|
||||||
double[] pos = new double[] {
|
double[] pos = { width2, height2 };
|
||||||
displayContainer.width / 2d,
|
|
||||||
displayContainer.height / 2d
|
|
||||||
};
|
|
||||||
|
|
||||||
double r = 2 - 2 * Math.sin( theta ) + Math.sin( theta ) * Math.sqrt( Math.abs( Math.cos( theta ) ) ) / ( Math.sin( theta ) + 1.4 );
|
double r = 2 - 2 * sin(theta) + sin(theta) * sqrt(abs(cos(theta))) / (sin(theta) + 1.4);
|
||||||
|
|
||||||
pos[0] += Math.cos( theta ) * r * 100;
|
pos[0] += Math.cos(theta) * r * 100;
|
||||||
pos[1] -= Math.sin( theta ) * r * 100 + 100;
|
pos[1] -= Math.sin(theta) * r * 100 + 100;
|
||||||
|
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* opsu!dance - fork of opsu! with cursordance auto
|
* opsu!dance - fork of opsu! with cursordance auto
|
||||||
* Copyright (C) 2016 yugecin
|
* Copyright (C) 2016-2018 yugecin
|
||||||
*
|
*
|
||||||
* opsu!dance is free software: you can redistribute it and/or modify
|
* opsu!dance is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -29,7 +29,7 @@ public class RektCircleSpinner extends Spinner {
|
||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
index = 0;
|
index = 0;
|
||||||
size = displayContainer.height * 0.8d;
|
size = height * 0.8d;
|
||||||
point = new double[2];
|
point = new double[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,20 +42,20 @@ public class RektCircleSpinner extends Spinner {
|
||||||
final int INC = 50;
|
final int INC = 50;
|
||||||
|
|
||||||
if( index == 0 ) {
|
if( index == 0 ) {
|
||||||
point[0] = displayContainer.width / 2d + size / 2d - pos;
|
point[0] = width2 + size / 2d - pos;
|
||||||
point[1] = displayContainer.height / 2d - size / 2d;
|
point[1] = height2 - size / 2d;
|
||||||
index++;
|
index++;
|
||||||
} else if( index == 1 ) {
|
} else if( index == 1 ) {
|
||||||
point[0] = displayContainer.width / 2 - size / 2;
|
point[0] = width2 - size / 2;
|
||||||
point[1] = displayContainer.height / 2 - size / 2 + pos;
|
point[1] = height2 - size / 2 + pos;
|
||||||
index++;
|
index++;
|
||||||
} else if( index == 2 ) {
|
} else if( index == 2 ) {
|
||||||
point[0] = displayContainer.width / 2 - size / 2 + pos;
|
point[0] = width2 - size / 2 + pos;
|
||||||
point[1] = displayContainer.height / 2 + size / 2;
|
point[1] = height2 + size / 2;
|
||||||
index++;
|
index++;
|
||||||
} else if( index == 3 ) {
|
} else if( index == 3 ) {
|
||||||
point[0] = displayContainer.width / 2 + size / 2;
|
point[0] = width2 + size / 2;
|
||||||
point[1] = displayContainer.height / 2 + size / 2 - pos;
|
point[1] = height2 + size / 2 - pos;
|
||||||
pos += INC;
|
pos += INC;
|
||||||
if( pos > size ) {
|
if( pos > size ) {
|
||||||
pos = INC;
|
pos = INC;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* opsu!dance - fork of opsu! with cursordance auto
|
* opsu!dance - fork of opsu! with cursordance auto
|
||||||
* Copyright (C) 2016 yugecin
|
* Copyright (C) 2016-2018 yugecin
|
||||||
*
|
*
|
||||||
* opsu!dance is free software: you can redistribute it and/or modify
|
* opsu!dance is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -25,11 +25,11 @@ public class RektSpinner extends Spinner {
|
||||||
public void init() {
|
public void init() {
|
||||||
init(new double[][] {
|
init(new double[][] {
|
||||||
{ 10, 10 },
|
{ 10, 10 },
|
||||||
{ displayContainer.width / 2d, 10 },
|
{ width2, 10 },
|
||||||
{ displayContainer.width - 10, 10 },
|
{ width - 10, 10 },
|
||||||
{ displayContainer.width - 10, displayContainer.height - 10 },
|
{ width - 10, height - 10 },
|
||||||
{ displayContainer.width / 2d, displayContainer.height - 10 },
|
{ width2, height - 10 },
|
||||||
{ 10, displayContainer.height - 10 }
|
{ 10, height - 10 }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* opsu!dance - fork of opsu! with cursordance auto
|
* opsu!dance - fork of opsu! with cursordance auto
|
||||||
* Copyright (C) 2017 yugecin
|
* Copyright (C) 2017-2018 yugecin
|
||||||
*
|
*
|
||||||
* opsu!dance is free software: you can redistribute it and/or modify
|
* opsu!dance is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -23,7 +23,8 @@ import itdelatrisu.opsu.ui.Fonts;
|
||||||
import itdelatrisu.opsu.ui.MenuButton;
|
import itdelatrisu.opsu.ui.MenuButton;
|
||||||
import itdelatrisu.opsu.ui.animations.AnimationEquation;
|
import itdelatrisu.opsu.ui.animations.AnimationEquation;
|
||||||
import org.newdawn.slick.*;
|
import org.newdawn.slick.*;
|
||||||
import yugecin.opsudance.core.DisplayContainer;
|
|
||||||
|
import static yugecin.opsudance.core.InstanceContainer.*;
|
||||||
|
|
||||||
public class BackButton {
|
public class BackButton {
|
||||||
|
|
||||||
|
@ -80,7 +81,7 @@ public class BackButton {
|
||||||
/** The real button with, determined by the size and animations. */
|
/** The real button with, determined by the size and animations. */
|
||||||
private int realButtonWidth;
|
private int realButtonWidth;
|
||||||
|
|
||||||
public BackButton(DisplayContainer container) {
|
public BackButton() {
|
||||||
if (!GameImage.MENU_BACK.hasGameSkinImage()) {
|
if (!GameImage.MENU_BACK.hasGameSkinImage()) {
|
||||||
backButton = null;
|
backButton = null;
|
||||||
textWidth = Fonts.MEDIUM.getWidth("back");
|
textWidth = Fonts.MEDIUM.getWidth("back");
|
||||||
|
@ -90,7 +91,7 @@ public class BackButton {
|
||||||
paddingY *= 0.736f;
|
paddingY *= 0.736f;
|
||||||
paddingX = paddingY / 2f;
|
paddingX = paddingY / 2f;
|
||||||
chevronBaseSize = paddingY * 3f / 2f;
|
chevronBaseSize = paddingY * 3f / 2f;
|
||||||
buttonYpos = (int) (container.height - paddingY * 4f);
|
buttonYpos = height - (int) (paddingY * 4f);
|
||||||
slopeImageSize = (int) (paddingY * 3f);
|
slopeImageSize = (int) (paddingY * 3f);
|
||||||
slopeImageSlopeWidth = (int) (slopeImageSize * 0.295f);
|
slopeImageSlopeWidth = (int) (slopeImageSize * 0.295f);
|
||||||
firstButtonWidth = slopeImageSize;
|
firstButtonWidth = slopeImageSize;
|
||||||
|
@ -101,10 +102,10 @@ public class BackButton {
|
||||||
|
|
||||||
if (GameImage.MENU_BACK.getImages() != null) {
|
if (GameImage.MENU_BACK.getImages() != null) {
|
||||||
Animation back = GameImage.MENU_BACK.getAnimation(120);
|
Animation back = GameImage.MENU_BACK.getAnimation(120);
|
||||||
backButton = new MenuButton(back, back.getWidth() / 2f, container.height - (back.getHeight() / 2f));
|
backButton = new MenuButton(back, back.getWidth() / 2f, height - (back.getHeight() / 2f));
|
||||||
} else {
|
} else {
|
||||||
Image back = GameImage.MENU_BACK.getImage();
|
Image back = GameImage.MENU_BACK.getImage();
|
||||||
backButton = new MenuButton(back, back.getWidth() / 2f, container.height - (back.getHeight() / 2f));
|
backButton = new MenuButton(back, back.getWidth() / 2f, height - (back.getHeight() / 2f));
|
||||||
}
|
}
|
||||||
backButton.setHoverAnimationDuration(350);
|
backButton.setHoverAnimationDuration(350);
|
||||||
backButton.setHoverAnimationEquation(AnimationEquation.IN_OUT_BACK);
|
backButton.setHoverAnimationEquation(AnimationEquation.IN_OUT_BACK);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* opsu!dance - fork of opsu! with cursordance auto
|
* opsu!dance - fork of opsu! with cursordance auto
|
||||||
* Copyright (C) 2016 yugecin
|
* Copyright (C) 2016-2018 yugecin
|
||||||
*
|
*
|
||||||
* opsu!dance is free software: you can redistribute it and/or modify
|
* opsu!dance is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -35,6 +35,7 @@ import java.util.HashMap;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import static yugecin.opsudance.core.InstanceContainer.*;
|
||||||
import static yugecin.opsudance.options.Options.*;
|
import static yugecin.opsudance.options.Options.*;
|
||||||
|
|
||||||
public class OptionsOverlay extends OverlayOpsuState {
|
public class OptionsOverlay extends OverlayOpsuState {
|
||||||
|
@ -110,8 +111,7 @@ public class OptionsOverlay extends OverlayOpsuState {
|
||||||
private int openDropdownVirtualY;
|
private int openDropdownVirtualY;
|
||||||
|
|
||||||
private int targetWidth;
|
private int targetWidth;
|
||||||
private int width;
|
private int currentWidth;
|
||||||
private int height;
|
|
||||||
|
|
||||||
private int navButtonSize;
|
private int navButtonSize;
|
||||||
private int navStartY;
|
private int navStartY;
|
||||||
|
@ -185,18 +185,17 @@ public class OptionsOverlay extends OverlayOpsuState {
|
||||||
super.revalidate();
|
super.revalidate();
|
||||||
|
|
||||||
boolean isWidescreen = displayContainer.isWidescreen();
|
boolean isWidescreen = displayContainer.isWidescreen();
|
||||||
targetWidth = (int) (displayContainer.width * (isWidescreen ? 0.4f : 0.5f));
|
targetWidth = (int) (width * (isWidescreen ? 0.4f : 0.5f));
|
||||||
height = displayContainer.height;
|
|
||||||
|
|
||||||
// calculate positions
|
// calculate positions
|
||||||
float navIconWidthRatio = isWidescreen ? 0.046875f : 0.065f;
|
float navIconWidthRatio = isWidescreen ? 0.046875f : 0.065f;
|
||||||
// non-widescreen ratio is not accurate
|
// non-widescreen ratio is not accurate
|
||||||
navButtonSize = (int) (displayContainer.width * navIconWidthRatio);
|
navButtonSize = (int) (width * navIconWidthRatio);
|
||||||
navIndicatorSize = navButtonSize / 10;
|
navIndicatorSize = navButtonSize / 10;
|
||||||
navTargetWidth = (int) (targetWidth * 0.45f) - navButtonSize;
|
navTargetWidth = (int) (targetWidth * 0.45f) - navButtonSize;
|
||||||
paddingRight = (int) (displayContainer.width * 0.009375f); // not so accurate
|
paddingRight = (int) (width * 0.009375f); // not so accurate
|
||||||
paddingLeft = navButtonSize + (int) (displayContainer.width * 0.0180f); // not so accurate
|
paddingLeft = navButtonSize + (int) (width * 0.0180f); // not so accurate
|
||||||
paddingTextLeft = paddingLeft + LINEWIDTH + (int) (displayContainer.width * 0.00625f); // not so accurate
|
paddingTextLeft = paddingLeft + LINEWIDTH + (int) (width * 0.00625f); // not so accurate
|
||||||
optionStartX = paddingTextLeft;
|
optionStartX = paddingTextLeft;
|
||||||
textOptionsY = Fonts.LARGE.getLineHeight() * 2;
|
textOptionsY = Fonts.LARGE.getLineHeight() * 2;
|
||||||
textChangeY = textOptionsY + Fonts.LARGE.getLineHeight();
|
textChangeY = textOptionsY + Fonts.LARGE.getLineHeight();
|
||||||
|
@ -206,8 +205,8 @@ public class OptionsOverlay extends OverlayOpsuState {
|
||||||
sectionLineHeight = (int) (Fonts.LARGE.getLineHeight() * 1.5f);
|
sectionLineHeight = (int) (Fonts.LARGE.getLineHeight() * 1.5f);
|
||||||
|
|
||||||
if (active) {
|
if (active) {
|
||||||
width = targetWidth;
|
currentWidth = targetWidth;
|
||||||
optionWidth = width - optionStartX - paddingRight;
|
optionWidth = currentWidth - optionStartX - paddingRight;
|
||||||
}
|
}
|
||||||
|
|
||||||
optionHeight = (int) (Fonts.MEDIUM.getLineHeight() * 1.3f);
|
optionHeight = (int) (Fonts.MEDIUM.getLineHeight() * 1.3f);
|
||||||
|
@ -267,11 +266,11 @@ public class OptionsOverlay extends OverlayOpsuState {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRender(Graphics g) {
|
public void onRender(Graphics g) {
|
||||||
g.setClip(navButtonSize, 0, width - navButtonSize, height);
|
g.setClip(navButtonSize, 0, currentWidth - navButtonSize, height);
|
||||||
|
|
||||||
// bg
|
// bg
|
||||||
g.setColor(COL_BG);
|
g.setColor(COL_BG);
|
||||||
g.fillRect(navButtonSize, 0, width, height);
|
g.fillRect(navButtonSize, 0, currentWidth, height);
|
||||||
|
|
||||||
// title
|
// title
|
||||||
renderTitle();
|
renderTitle();
|
||||||
|
@ -291,13 +290,13 @@ public class OptionsOverlay extends OverlayOpsuState {
|
||||||
|
|
||||||
// scrollbar
|
// scrollbar
|
||||||
g.setColor(COL_WHITE);
|
g.setColor(COL_WHITE);
|
||||||
g.fillRect(width - 5, scrollHandler.getPosition() / maxScrollOffset * (height - 45), 5, 45);
|
g.fillRect(currentWidth - 5, scrollHandler.getPosition() / maxScrollOffset * (height - 45), 5, 45);
|
||||||
g.clearClip();
|
g.clearClip();
|
||||||
|
|
||||||
renderNavigation(g);
|
renderNavigation(g);
|
||||||
|
|
||||||
// UI
|
// UI
|
||||||
UI.getBackButton().draw(g);
|
backButton.draw(g);
|
||||||
|
|
||||||
// tooltip
|
// tooltip
|
||||||
renderTooltip(g);
|
renderTooltip(g);
|
||||||
|
@ -373,16 +372,16 @@ public class OptionsOverlay extends OverlayOpsuState {
|
||||||
indicatorPos += AnimationEquation.OUT_BACK.calc((float) indicatorMoveAnimationTime / INDICATORMOVEANIMATIONTIME) * indicatorOffsetToNextPos;
|
indicatorPos += AnimationEquation.OUT_BACK.calc((float) indicatorMoveAnimationTime / INDICATORMOVEANIMATIONTIME) * indicatorOffsetToNextPos;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
g.fillRect(navButtonSize, indicatorPos - scrollHandler.getPosition(), width, optionHeight);
|
g.fillRect(navButtonSize, indicatorPos - scrollHandler.getPosition(), currentWidth, optionHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void renderKeyEntry(Graphics g) {
|
private void renderKeyEntry(Graphics g) {
|
||||||
g.setColor(COL_BG);
|
g.setColor(COL_BG);
|
||||||
g.fillRect(0, 0, displayContainer.width, height);
|
g.fillRect(0, 0, width, height);
|
||||||
g.setColor(COL_WHITE);
|
g.setColor(COL_WHITE);
|
||||||
String prompt = (keyEntryLeft) ? "Please press the new left-click key." : "Please press the new right-click key.";
|
String prompt = (keyEntryLeft) ? "Please press the new left-click key." : "Please press the new right-click key.";
|
||||||
int y = (displayContainer.height - Fonts.LARGE.getLineHeight()) / 2;
|
int y = height2 - Fonts.LARGE.getLineHeight() / 2;
|
||||||
FontUtil.drawCentered(Fonts.LARGE, displayContainer.width, 0, y, prompt, COL_WHITE);
|
FontUtil.drawCentered(Fonts.LARGE, width, 0, y, prompt, COL_WHITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void renderTooltip(Graphics g) {
|
private void renderTooltip(Graphics g) {
|
||||||
|
@ -413,7 +412,7 @@ public class OptionsOverlay extends OverlayOpsuState {
|
||||||
if (section != activeSection) {
|
if (section != activeSection) {
|
||||||
COL_CYAN.a *= 0.2f;
|
COL_CYAN.a *= 0.2f;
|
||||||
}
|
}
|
||||||
FontUtil.drawRightAligned(Fonts.XLARGE, width, -paddingRight,
|
FontUtil.drawRightAligned(Fonts.XLARGE, currentWidth, -paddingRight,
|
||||||
(int) (y + Fonts.XLARGE.getLineHeight() * 0.3f), section.name.toUpperCase(),
|
(int) (y + Fonts.XLARGE.getLineHeight() * 0.3f), section.name.toUpperCase(),
|
||||||
COL_CYAN);
|
COL_CYAN);
|
||||||
COL_CYAN.a = previousAlpha;
|
COL_CYAN.a = previousAlpha;
|
||||||
|
@ -569,7 +568,7 @@ public class OptionsOverlay extends OverlayOpsuState {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void renderTitle() {
|
private void renderTitle() {
|
||||||
int textWidth = width - navButtonSize;
|
int textWidth = currentWidth - navButtonSize;
|
||||||
FontUtil.drawCentered(Fonts.LARGE, textWidth, navButtonSize,
|
FontUtil.drawCentered(Fonts.LARGE, textWidth, navButtonSize,
|
||||||
textOptionsY - scrollHandler.getIntPosition(), "Options", COL_WHITE);
|
textOptionsY - scrollHandler.getIntPosition(), "Options", COL_WHITE);
|
||||||
FontUtil.drawCentered(Fonts.MEDIUM, textWidth, navButtonSize,
|
FontUtil.drawCentered(Fonts.MEDIUM, textWidth, navButtonSize,
|
||||||
|
@ -581,7 +580,7 @@ public class OptionsOverlay extends OverlayOpsuState {
|
||||||
if (scrollHandler.getIntPosition() > posSearchY) {
|
if (scrollHandler.getIntPosition() > posSearchY) {
|
||||||
ypos = textSearchYOffset;
|
ypos = textSearchYOffset;
|
||||||
g.setColor(COL_BG);
|
g.setColor(COL_BG);
|
||||||
g.fillRect(navButtonSize, 0, width, textSearchYOffset * 2 + Fonts.LARGE.getLineHeight());
|
g.fillRect(navButtonSize, 0, currentWidth, textSearchYOffset * 2 + Fonts.LARGE.getLineHeight());
|
||||||
}
|
}
|
||||||
Color searchCol = COL_WHITE;
|
Color searchCol = COL_WHITE;
|
||||||
float invalidProgress = 0f;
|
float invalidProgress = 0f;
|
||||||
|
@ -597,7 +596,7 @@ public class OptionsOverlay extends OverlayOpsuState {
|
||||||
if (lastSearchText.length() > 0) {
|
if (lastSearchText.length() > 0) {
|
||||||
searchText = lastSearchText;
|
searchText = lastSearchText;
|
||||||
}
|
}
|
||||||
int textWidth = width - navButtonSize;
|
int textWidth = currentWidth - navButtonSize;
|
||||||
if (invalidSearchAnimationProgress > 0) {
|
if (invalidSearchAnimationProgress > 0) {
|
||||||
g.rotate(navButtonSize + textWidth / 2, ypos, invalidProgress * invalidSearchTextRotation);
|
g.rotate(navButtonSize + textWidth / 2, ypos, invalidProgress * invalidSearchTextRotation);
|
||||||
}
|
}
|
||||||
|
@ -684,7 +683,7 @@ public class OptionsOverlay extends OverlayOpsuState {
|
||||||
prevMouseY = mouseY;
|
prevMouseY = mouseY;
|
||||||
updateHoverOption(mouseX, mouseY);
|
updateHoverOption(mouseX, mouseY);
|
||||||
updateIndicatorAlpha();
|
updateIndicatorAlpha();
|
||||||
UI.getBackButton().hoverUpdate(delta, mouseX, mouseY);
|
backButton.hoverUpdate(delta, mouseX, mouseY);
|
||||||
if (isAdjustingSlider) {
|
if (isAdjustingSlider) {
|
||||||
int sliderValue = ((NumericOption) hoverOption).val;
|
int sliderValue = ((NumericOption) hoverOption).val;
|
||||||
updateSliderOption();
|
updateSliderOption();
|
||||||
|
@ -737,11 +736,11 @@ public class OptionsOverlay extends OverlayOpsuState {
|
||||||
private void updateShowHideAnimation(int delta) {
|
private void updateShowHideAnimation(int delta) {
|
||||||
if (acceptInput && animationtime >= SHOWANIMATIONTIME) {
|
if (acceptInput && animationtime >= SHOWANIMATIONTIME) {
|
||||||
// animation already finished
|
// animation already finished
|
||||||
width = targetWidth;
|
currentWidth = targetWidth;
|
||||||
showHideProgress = 1f;
|
showHideProgress = 1f;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
optionWidth = width - optionStartX - paddingRight;
|
optionWidth = currentWidth - optionStartX - paddingRight;
|
||||||
|
|
||||||
// navigation elemenst fade out with a different animation
|
// navigation elemenst fade out with a different animation
|
||||||
float navProgress;
|
float navProgress;
|
||||||
|
@ -763,7 +762,7 @@ public class OptionsOverlay extends OverlayOpsuState {
|
||||||
navProgress = hideAnimationStartProgress * AnimationEquation.IN_CIRC.calc(showHideProgress);
|
navProgress = hideAnimationStartProgress * AnimationEquation.IN_CIRC.calc(showHideProgress);
|
||||||
showHideProgress = hideAnimationStartProgress * AnimationEquation.IN_EXPO.calc(showHideProgress);
|
showHideProgress = hideAnimationStartProgress * AnimationEquation.IN_EXPO.calc(showHideProgress);
|
||||||
}
|
}
|
||||||
width = navButtonSize + (int) (showHideProgress * (targetWidth - navButtonSize));
|
currentWidth = navButtonSize + (int) (showHideProgress * (targetWidth - navButtonSize));
|
||||||
COL_NAV_FILTERED.a = COL_NAV_INACTIVE.a = COL_NAV_FILTERED_HOVERED.a = COL_NAV_INDICATOR.a =
|
COL_NAV_FILTERED.a = COL_NAV_INACTIVE.a = COL_NAV_FILTERED_HOVERED.a = COL_NAV_INDICATOR.a =
|
||||||
COL_NAV_WHITE.a = COL_NAV_BG.a = navProgress;
|
COL_NAV_WHITE.a = COL_NAV_BG.a = navProgress;
|
||||||
COL_BG.a = BG_ALPHA * showHideProgress;
|
COL_BG.a = BG_ALPHA * showHideProgress;
|
||||||
|
@ -782,7 +781,7 @@ public class OptionsOverlay extends OverlayOpsuState {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (x > width) {
|
if (x > currentWidth) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -874,7 +873,7 @@ public class OptionsOverlay extends OverlayOpsuState {
|
||||||
scrollHandler.scrollToPosition(sectionPosition);
|
scrollHandler.scrollToPosition(sectionPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UI.getBackButton().contains(x, y)){
|
if (backButton.contains(x, y)){
|
||||||
hide();
|
hide();
|
||||||
if (listener != null) {
|
if (listener != null) {
|
||||||
listener.onLeaveOptionsMenu();
|
listener.onLeaveOptionsMenu();
|
||||||
|
@ -1011,7 +1010,7 @@ public class OptionsOverlay extends OverlayOpsuState {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
hoverOption = null;
|
hoverOption = null;
|
||||||
if (mouseX > width) {
|
if (mouseX > currentWidth) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,6 @@ import itdelatrisu.opsu.ui.Fonts;
|
||||||
import org.newdawn.slick.Color;
|
import org.newdawn.slick.Color;
|
||||||
import org.newdawn.slick.Graphics;
|
import org.newdawn.slick.Graphics;
|
||||||
import yugecin.opsudance.ObjectColorOverrides;
|
import yugecin.opsudance.ObjectColorOverrides;
|
||||||
import yugecin.opsudance.core.DisplayContainer;
|
|
||||||
import yugecin.opsudance.core.state.OverlayOpsuState;
|
import yugecin.opsudance.core.state.OverlayOpsuState;
|
||||||
import yugecin.opsudance.options.OptionTab;
|
import yugecin.opsudance.options.OptionTab;
|
||||||
import yugecin.opsudance.sbv2.MoveStoryboard;
|
import yugecin.opsudance.sbv2.MoveStoryboard;
|
||||||
|
@ -35,14 +34,12 @@ import java.util.*;
|
||||||
|
|
||||||
import static org.lwjgl.input.Keyboard.*;
|
import static org.lwjgl.input.Keyboard.*;
|
||||||
import static yugecin.opsudance.options.Options.*;
|
import static yugecin.opsudance.options.Options.*;
|
||||||
|
import static yugecin.opsudance.core.InstanceContainer.*;
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public class StoryboardOverlay extends OverlayOpsuState implements OptionsOverlay.Listener {
|
public class StoryboardOverlay extends OverlayOpsuState implements OptionsOverlay.Listener {
|
||||||
|
|
||||||
private final static List<Option> optionList = new ArrayList<>();
|
private final static List<Option> optionList = new ArrayList<>();
|
||||||
|
|
||||||
private final DisplayContainer displayContainer;
|
|
||||||
|
|
||||||
private boolean hide;
|
private boolean hide;
|
||||||
|
|
||||||
private int speed;
|
private int speed;
|
||||||
|
@ -62,8 +59,7 @@ public class StoryboardOverlay extends OverlayOpsuState implements OptionsOverla
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public StoryboardOverlay(DisplayContainer displayContainer, MoveStoryboard msb, OptionsOverlay optionsOverlay, Game game) {
|
public StoryboardOverlay(MoveStoryboard msb, OptionsOverlay optionsOverlay, Game game) {
|
||||||
this.displayContainer = displayContainer;
|
|
||||||
this.msb = msb;
|
this.msb = msb;
|
||||||
this.optionsOverlay = optionsOverlay;
|
this.optionsOverlay = optionsOverlay;
|
||||||
this.game = game;
|
this.game = game;
|
||||||
|
@ -78,18 +74,18 @@ public class StoryboardOverlay extends OverlayOpsuState implements OptionsOverla
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int lh = Fonts.SMALL.getLineHeight();
|
int lh = Fonts.SMALL.getLineHeight();
|
||||||
Fonts.SMALL.drawString(10, displayContainer.height - 50 + lh, "save position: ctrl+s, load position: ctrl+l", Color.cyan);
|
Fonts.SMALL.drawString(10, height - 50 + lh, "save position: ctrl+s, load position: ctrl+l", Color.cyan);
|
||||||
Fonts.SMALL.drawString(10, displayContainer.height - 50, "speed: C " + (speed / 10f) + " V", Color.cyan);
|
Fonts.SMALL.drawString(10, height - 50, "speed: C " + (speed / 10f) + " V", Color.cyan);
|
||||||
Fonts.SMALL.drawString(10, displayContainer.height - 50 - lh, "Menu: N", Color.cyan);
|
Fonts.SMALL.drawString(10, height - 50 - lh, "Menu: N", Color.cyan);
|
||||||
Fonts.SMALL.drawString(10, displayContainer.height - 50 - lh * 2, "HIDE: H", Color.cyan);
|
Fonts.SMALL.drawString(10, height - 50 - lh * 2, "HIDE: H", Color.cyan);
|
||||||
Fonts.SMALL.drawString(10, displayContainer.height - 50 - lh * 3, "obj: J " + index + " K", Color.cyan);
|
Fonts.SMALL.drawString(10, height - 50 - lh * 3, "obj: J " + index + " K", Color.cyan);
|
||||||
g.setColor(Color.red);
|
g.setColor(Color.red);
|
||||||
if (index < optionsMap.length && optionsMap[index] != null) {
|
if (index < optionsMap.length && optionsMap[index] != null) {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (Object o : optionsMap[index].entrySet()) {
|
for (Object o : optionsMap[index].entrySet()) {
|
||||||
Map.Entry<Option, String> option = (Map.Entry<Option, String>) o;
|
Map.Entry<Option, String> option = (Map.Entry<Option, String>) o;
|
||||||
Fonts.SMALL.drawString(10, 50 + i * lh, option.getKey().name, Color.cyan);
|
Fonts.SMALL.drawString(10, 50 + i * lh, option.getKey().name, Color.cyan);
|
||||||
Fonts.SMALL.drawString(displayContainer.width / 5, 50 + i * lh, option.getKey().getValueString(), Color.cyan);
|
Fonts.SMALL.drawString(width / 5, 50 + i * lh, option.getKey().getValueString(), Color.cyan);
|
||||||
g.fillRect(0, 50 + i * lh + lh / 4, 10, 10);
|
g.fillRect(0, 50 + i * lh + lh / 4, 10, 10);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
@ -98,7 +94,7 @@ public class StoryboardOverlay extends OverlayOpsuState implements OptionsOverla
|
||||||
int start = gameObjects[0].getTime();
|
int start = gameObjects[0].getTime();
|
||||||
int end = gameObjects[gameObjects.length - 1].getEndTime();
|
int end = gameObjects[gameObjects.length - 1].getEndTime();
|
||||||
float curtime = (float) (MusicController.getPosition() - start) / (end - start);
|
float curtime = (float) (MusicController.getPosition() - start) / (end - start);
|
||||||
g.fillRect(curtime * displayContainer.width, displayContainer.height - 10f, 10f, 10f);
|
g.fillRect(curtime * width, height - 10f, 10f, 10f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user