From 5a268bc71380ac7dd807be52dff6ad05a964f246 Mon Sep 17 00:00:00 2001 From: yugecin Date: Mon, 22 Oct 2018 22:10:43 +0200 Subject: [PATCH] post-merge fixes --- src/itdelatrisu/opsu/states/Game.java | 18 ++++++------------ src/yugecin/opsudance/ReplayPlayback.java | 10 ++++------ 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/src/itdelatrisu/opsu/states/Game.java b/src/itdelatrisu/opsu/states/Game.java index e71fa0ad..4bf15158 100644 --- a/src/itdelatrisu/opsu/states/Game.java +++ b/src/itdelatrisu/opsu/states/Game.java @@ -733,12 +733,12 @@ public class Game extends ComplexOpsuState { for (ReplayPlayback replayPlayback : replays) { totalHeight += replayPlayback.getHeight(); } - float ypos = (displayContainer.height - totalHeight) / 2 - ReplayPlayback.UNITHEIGHT; + float ypos = (height - totalHeight) / 2 - ReplayPlayback.UNITHEIGHT; for (ReplayPlayback replayPlayback : replays) { float h = replayPlayback.getHeight(); ypos += h; //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(); - 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()) { - BubNotifListener.EVENT.make().onBubNotif(String.format( - "replay folder '%s' does not exist", replaydir.getAbsolutePath() - ), Colors.BUB_RED); + bubNotifs.sendf(Colors.BUB_RED, "replay folder '%s' does not exist", replaydir.getAbsolutePath()); displayContainer.switchStateInstantly(songMenuState); return; } @@ -1515,12 +1513,12 @@ public class Game extends ComplexOpsuState { try { r.load(); } 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; } Color color = new Color(java.awt.Color.getHSBColor((hue) / 360f, 1.0f, 1.0f).getRGB()); 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; } @@ -1826,10 +1824,6 @@ public class Game extends ComplexOpsuState { GameMod.loadModState(previousMods); } - /** - * Adjusts the beatmap's local music offset. - * @param sign the sign (multiplier) - */ public void adjustLocalMusicOffset(int amount) { int newOffset = beatmap.localMusicOffset + amount; barNotifs.send(String.format("Local beatmap offset set to %dms", newOffset)); diff --git a/src/yugecin/opsudance/ReplayPlayback.java b/src/yugecin/opsudance/ReplayPlayback.java index b647b644..7e6147bc 100644 --- a/src/yugecin/opsudance/ReplayPlayback.java +++ b/src/yugecin/opsudance/ReplayPlayback.java @@ -26,7 +26,6 @@ import itdelatrisu.opsu.ui.animations.AnimationEquation; import org.newdawn.slick.Color; import org.newdawn.slick.Graphics; import org.newdawn.slick.Image; -import yugecin.opsudance.core.DisplayContainer; import yugecin.opsudance.core.Entrypoint; import java.io.*; @@ -36,12 +35,12 @@ import java.util.LinkedList; import static itdelatrisu.opsu.GameData.*; import static itdelatrisu.opsu.Utils.*; import static itdelatrisu.opsu.ui.animations.AnimationEquation.*; +import static yugecin.opsudance.core.InstanceContainer.*; public class ReplayPlayback { private static final boolean HIDEMOUSEBTNS = true; - private final DisplayContainer container; private final HitData hitdata; public final Replay replay; public ReplayFrame currentFrame; @@ -73,8 +72,7 @@ public class ReplayPlayback { private static final Color missedColor = new Color(0.4f, 0.4f, 0.4f, 1f); - public ReplayPlayback(DisplayContainer container, Replay replay, HitData hitdata, Color color) { - this.container = container; + public ReplayPlayback(Replay replay, HitData hitdata, Color color) { this.replay = replay; this.hitdata = hitdata; resetFrameIndex(); @@ -259,7 +257,7 @@ public class ReplayPlayback { failposx = currentFrame.getScaledX(); failposy = currentFrame.getScaledY(); if (hr) { - failposy = container.height - failposy; + failposy = height - failposy; } } missed = true; @@ -298,7 +296,7 @@ public class ReplayPlayback { } int y = currentFrame.getScaledY(); if (hr) { - y = container.height - y; + y = height - y; } cursor.setCursorPosition(renderdelta, currentFrame.getScaledX(), y); cursor.draw(false);