Merge branch 'master' into kockout-wdata

# Conflicts:
#	src/itdelatrisu/opsu/states/Game.java
#	src/itdelatrisu/opsu/states/Splash.java
This commit is contained in:
yugecin
2018-10-22 21:59:11 +02:00
145 changed files with 2112 additions and 1884 deletions

View File

@@ -34,15 +34,14 @@ import itdelatrisu.opsu.ui.Colors;
import org.newdawn.slick.Color;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.Image;
import yugecin.opsudance.core.DisplayContainer;
import yugecin.opsudance.skinning.SkinService;
import static yugecin.opsudance.core.InstanceContainer.*;
/**
* Data type representing a spinner object.
*/
public class Spinner extends GameObject {
/** Container dimensions. */
private static int width, height;
/** The map's overall difficulty value. */
private static float overallDifficulty = 5f;
@@ -112,9 +111,7 @@ public class Spinner extends GameObject {
* Initializes the Spinner data type with images and dimensions.
* @param difficulty the map's overall difficulty value
*/
public static void init(DisplayContainer displayContainer, float difficulty) {
width = displayContainer.width;
height = displayContainer.height;
public static void init(float difficulty) {
overallDifficulty = difficulty;
}
@@ -207,7 +204,7 @@ public class Spinner extends GameObject {
// rpm
Image rpmImg = GameImage.SPINNER_RPM.getImage();
rpmImg.setAlpha(alpha);
rpmImg.drawCentered(width / 2f, height - rpmImg.getHeight() / 2f);
rpmImg.drawCentered(width2, height - rpmImg.getHeight() / 2f);
if (timeDiff < 0)
data.drawSymbolString(Integer.toString(drawnRPM), (width + rpmImg.getWidth() * 0.95f) / 2f,
height - data.getScoreSymbolImage('0').getHeight() * 1.025f, 1f, 1f, true);
@@ -225,21 +222,21 @@ public class Spinner extends GameObject {
// main spinner elements
GameImage.SPINNER_CIRCLE.getImage().setAlpha(alpha);
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()) {
float approachScale = 1 - Utils.clamp(((float) timeDiff / (hitObject.getTime() - hitObject.getEndTime())), 0f, 1f);
Image approachCircleScaled = GameImage.SPINNER_APPROACHCIRCLE.getImage().getScaledCopy(approachScale);
approachCircleScaled.setAlpha(alpha);
approachCircleScaled.drawCentered(width / 2, height / 2);
approachCircleScaled.drawCentered(width2, height2);
}
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) {
GameImage.SPINNER_CLEAR.getImage().drawCentered(width / 2, height / 4);
GameImage.SPINNER_CLEAR.getImage().drawCentered(width2, height / 4);
int extraRotations = (int) (rotations - rotationsNeeded);
if (extraRotations > 0)
data.drawSymbolNumber(extraRotations * 1000, width / 2, height * 2 / 3, 1f, 1f);
data.drawSymbolNumber(extraRotations * 1000, width2, height * 2 / 3, 1f, 1f);
}
}
@@ -261,14 +258,14 @@ public class Spinner extends GameObject {
else
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);
return result;
}
@Override
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;
}
@@ -297,7 +294,7 @@ public class Spinner extends GameObject {
angleDiff = delta * SPUN_OUT_MULTIPLIER;
isSpinning = true;
} 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
if (!isSpinning && (keyPressed || GameMod.RELAX.isActive())) {