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));
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;
}

View File

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

View File

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