post-merge fixes

This commit is contained in:
yugecin 2018-10-22 22:10:43 +02:00
parent 3d470cbe7a
commit 5a268bc713
2 changed files with 10 additions and 18 deletions

View File

@ -733,12 +733,12 @@ public class Game extends ComplexOpsuState {
for (ReplayPlayback replayPlayback : replays) { for (ReplayPlayback replayPlayback : replays) {
totalHeight += replayPlayback.getHeight(); totalHeight += replayPlayback.getHeight();
} }
float ypos = (displayContainer.height - totalHeight) / 2 - ReplayPlayback.UNITHEIGHT; float ypos = (height - totalHeight) / 2 - ReplayPlayback.UNITHEIGHT;
for (ReplayPlayback replayPlayback : replays) { for (ReplayPlayback replayPlayback : replays) {
float h = replayPlayback.getHeight(); float h = replayPlayback.getHeight();
ypos += h; ypos += h;
//if (h > 0f) { //if (h > 0f) {
replayPlayback.render(displayContainer.renderDelta, g, ypos, trackPosition); replayPlayback.render(renderDelta, g, ypos, trackPosition);
//} //}
} }
} }
@ -1486,11 +1486,9 @@ public class Game extends ComplexOpsuState {
super.enter(); super.enter();
File replaydir = new File("d:/Users/Robin/games/osu/osr-stuff-master/furioso/"); File replaydir = new File("d:/Users/Robin/games/osu/osr-stuff-master/xi/");
if (!replaydir.exists()) { if (!replaydir.exists()) {
BubNotifListener.EVENT.make().onBubNotif(String.format( bubNotifs.sendf(Colors.BUB_RED, "replay folder '%s' does not exist", replaydir.getAbsolutePath());
"replay folder '%s' does not exist", replaydir.getAbsolutePath()
), Colors.BUB_RED);
displayContainer.switchStateInstantly(songMenuState); displayContainer.switchStateInstantly(songMenuState);
return; return;
} }
@ -1515,12 +1513,12 @@ public class Game extends ComplexOpsuState {
try { try {
r.load(); r.load();
} catch (IOException e) { } catch (IOException e) {
BubNotifListener.EVENT.make().onBubNotif("could not load replay " + file.getName(), Colors.BUB_RED); bubNotifs.sendf(Colors.BUB_RED, "could not load replay %s", file.getName());
continue; continue;
} }
Color color = new Color(java.awt.Color.getHSBColor((hue) / 360f, 1.0f, 1.0f).getRGB()); Color color = new Color(java.awt.Color.getHSBColor((hue) / 360f, 1.0f, 1.0f).getRGB());
final ReplayPlayback.HitData hitdata = new ReplayPlayback.HitData(hitdatafile); final ReplayPlayback.HitData hitdata = new ReplayPlayback.HitData(hitdatafile);
replays.add(new ReplayPlayback(displayContainer, r, hitdata, color)); replays.add(new ReplayPlayback(r, hitdata, color));
hue += hueshift; hue += hueshift;
} }
@ -1826,10 +1824,6 @@ public class Game extends ComplexOpsuState {
GameMod.loadModState(previousMods); GameMod.loadModState(previousMods);
} }
/**
* Adjusts the beatmap's local music offset.
* @param sign the sign (multiplier)
*/
public void adjustLocalMusicOffset(int amount) { public void adjustLocalMusicOffset(int amount) {
int newOffset = beatmap.localMusicOffset + amount; int newOffset = beatmap.localMusicOffset + amount;
barNotifs.send(String.format("Local beatmap offset set to %dms", newOffset)); barNotifs.send(String.format("Local beatmap offset set to %dms", newOffset));

View File

@ -26,7 +26,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.core.Entrypoint; import yugecin.opsudance.core.Entrypoint;
import java.io.*; import java.io.*;
@ -36,12 +35,12 @@ import java.util.LinkedList;
import static itdelatrisu.opsu.GameData.*; import static itdelatrisu.opsu.GameData.*;
import static itdelatrisu.opsu.Utils.*; import static itdelatrisu.opsu.Utils.*;
import static itdelatrisu.opsu.ui.animations.AnimationEquation.*; import static itdelatrisu.opsu.ui.animations.AnimationEquation.*;
import static yugecin.opsudance.core.InstanceContainer.*;
public class ReplayPlayback { public class ReplayPlayback {
private static final boolean HIDEMOUSEBTNS = true; private static final boolean HIDEMOUSEBTNS = true;
private final DisplayContainer container;
private final HitData hitdata; private final HitData hitdata;
public final Replay replay; public final Replay replay;
public ReplayFrame currentFrame; public ReplayFrame currentFrame;
@ -73,8 +72,7 @@ public class ReplayPlayback {
private static final Color missedColor = new Color(0.4f, 0.4f, 0.4f, 1f); private static final Color missedColor = new Color(0.4f, 0.4f, 0.4f, 1f);
public ReplayPlayback(DisplayContainer container, Replay replay, HitData hitdata, Color color) { public ReplayPlayback(Replay replay, HitData hitdata, Color color) {
this.container = container;
this.replay = replay; this.replay = replay;
this.hitdata = hitdata; this.hitdata = hitdata;
resetFrameIndex(); resetFrameIndex();
@ -259,7 +257,7 @@ public class ReplayPlayback {
failposx = currentFrame.getScaledX(); failposx = currentFrame.getScaledX();
failposy = currentFrame.getScaledY(); failposy = currentFrame.getScaledY();
if (hr) { if (hr) {
failposy = container.height - failposy; failposy = height - failposy;
} }
} }
missed = true; missed = true;
@ -298,7 +296,7 @@ public class ReplayPlayback {
} }
int y = currentFrame.getScaledY(); int y = currentFrame.getScaledY();
if (hr) { if (hr) {
y = container.height - y; y = height - y;
} }
cursor.setCursorPosition(renderdelta, currentFrame.getScaledX(), y); cursor.setCursorPosition(renderdelta, currentFrame.getScaledX(), y);
cursor.draw(false); cursor.draw(false);