Fixed bugs with Hard Rock mod and replays during breaks.

- Hard Rock now flips hit object coordinates along the x axis, as in osu!.
- Fixed a bug where replay data wasn't being shown during breaks.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han 2015-03-12 20:33:32 -04:00
parent 49c85b3b08
commit a19eb39259
2 changed files with 21 additions and 4 deletions

View File

@ -59,6 +59,9 @@ public class OsuHitObject {
xOffset, // offset right of border
yOffset; // offset below health bar
/** The container height. */
private static int containerHeight;
/** Starting coordinates. */
private float x, y;
@ -107,6 +110,7 @@ public class OsuHitObject {
* @param height the container height
*/
public static void init(int width, int height) {
containerHeight = height;
int swidth = width;
int sheight = height;
if (swidth * 3 > sheight * 4)
@ -238,7 +242,12 @@ public class OsuHitObject {
/**
* Returns the scaled starting y coordinate.
*/
public float getScaledY() { return y * yMultiplier + yOffset; }
public float getScaledY() {
if (GameMod.HARD_ROCK.isActive())
return containerHeight - (y * yMultiplier + yOffset);
else
return y * yMultiplier + yOffset;
}
/**
* Returns the start time.
@ -309,8 +318,13 @@ public class OsuHitObject {
return null;
float[] y = new float[sliderY.length];
for (int i = 0; i < y.length; i++)
y[i] = sliderY[i] * yMultiplier + yOffset;
if (GameMod.HARD_ROCK.isActive()) {
for (int i = 0; i < y.length; i++)
y[i] = containerHeight - (sliderY[i] * yMultiplier + yOffset);
} else {
for (int i = 0; i < y.length; i++)
y[i] = sliderY[i] * yMultiplier + yOffset;
}
return y;
}

View File

@ -303,7 +303,10 @@ public class Game extends BasicGameState {
if (GameMod.AUTO.isActive())
GameImage.UNRANKED.getImage().drawCentered(width / 2, height * 0.077f);
UI.draw(g);
if (!isReplay)
UI.draw(g);
else
UI.draw(g, replayX, replayY, replayKeyPressed);
return;
}
}