post merge stuff

This commit is contained in:
yugecin 2017-03-30 00:06:13 +02:00
parent 3629dfd4d7
commit 9df139bded
3 changed files with 17 additions and 4 deletions

View File

@ -1492,7 +1492,7 @@ public class Game extends ComplexOpsuState {
EventBus.post(new BubbleNotificationEvent("could not load replay " + file.getName(), BubbleNotificationEvent.COMMONCOLOR_RED)); EventBus.post(new BubbleNotificationEvent("could not load replay " + file.getName(), BubbleNotificationEvent.COMMONCOLOR_RED));
continue; continue;
} }
replays.add(new ReplayPlayback(r, new Color(java.awt.Color.getHSBColor((hue) / 360f, 1.0f, 1.0f).getRGB()))); replays.add(new ReplayPlayback(displayContainer, r, new Color(java.awt.Color.getHSBColor((hue) / 360f, 1.0f, 1.0f).getRGB())));
hue += hueshift; hue += hueshift;
} }

View File

@ -67,6 +67,8 @@ public class Cursor {
private boolean isMirrored; private boolean isMirrored;
private Color filter;
public Cursor() { public Cursor() {
this(false); this(false);
} }
@ -76,6 +78,11 @@ public class Cursor {
this.isMirrored = isMirrored; this.isMirrored = isMirrored;
} }
public Cursor(Color filter) {
this(false);
this.filter = filter;
}
/** /**
* Draws the cursor. * Draws the cursor.
* @param mousePressed whether or not the mouse button is pressed * @param mousePressed whether or not the mouse button is pressed
@ -130,6 +137,10 @@ public class Cursor {
lastCursorColor = filter = Dancer.cursorColorOverride.getColor(); lastCursorColor = filter = Dancer.cursorColorOverride.getColor();
} }
if (this.filter != null) {
filter = this.filter;
}
// draw a fading trail // draw a fading trail
float alpha = 0f; float alpha = 0f;
float t = 2f / trail.size(); float t = 2f / trail.size();
@ -138,7 +149,7 @@ public class Cursor {
cursorTrail.startUse(); cursorTrail.startUse();
for (Point p : trail) { for (Point p : trail) {
alpha += t; alpha += t;
cursorTrail.setImageColor(filter.r, filter.g, filter.b, alpha); cursorTrail.setImageColor(filter.r, filter.g, filter.b, alpha * 0.2f);
cursorTrail.drawEmbedded( cursorTrail.drawEmbedded(
p.x - (cursorTrailWidth / 2f), p.y - (cursorTrailHeight / 2f), p.x - (cursorTrailWidth / 2f), p.y - (cursorTrailHeight / 2f),
cursorTrailWidth, cursorTrailHeight, cursorTrailRotation); cursorTrailWidth, cursorTrailHeight, cursorTrailRotation);

View File

@ -27,6 +27,7 @@ import yugecin.opsudance.core.DisplayContainer;
public class ReplayPlayback { public class ReplayPlayback {
private final DisplayContainer container;
public final Replay replay; public final Replay replay;
public ReplayFrame currentFrame; public ReplayFrame currentFrame;
public ReplayFrame nextFrame; public ReplayFrame nextFrame;
@ -38,7 +39,8 @@ public class ReplayPlayback {
private boolean hr; private boolean hr;
private String player; private String player;
public ReplayPlayback(Replay replay, Color color) { public ReplayPlayback(DisplayContainer container, Replay replay, Color color) {
this.container = container;
this.replay = replay; this.replay = replay;
resetFrameIndex(); resetFrameIndex();
this.color = color; this.color = color;
@ -116,7 +118,7 @@ public class ReplayPlayback {
Fonts.SMALLBOLD.drawString(SQSIZE * 5, ypos, this.player, color); Fonts.SMALLBOLD.drawString(SQSIZE * 5, ypos, this.player, color);
int y = currentFrame.getScaledY(); int y = currentFrame.getScaledY();
if (hr) { if (hr) {
y = DisplayContainer.instance.height - y; y = container.height - y;
} }
cursor.setCursorPosition(renderdelta, currentFrame.getScaledX(), y); cursor.setCursorPosition(renderdelta, currentFrame.getScaledX(), y);
cursor.draw(false); cursor.draw(false);