From 40cf8775401894c759b0bd67d861737464c59b04 Mon Sep 17 00:00:00 2001 From: Jeffrey Han Date: Fri, 9 Dec 2016 22:56:23 -0500 Subject: [PATCH 1/3] Removed HexideServer. Looks like it's down for good. Signed-off-by: Jeffrey Han --- src/itdelatrisu/opsu/downloads/servers/HexideServer.java | 2 ++ src/itdelatrisu/opsu/states/DownloadsMenu.java | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/itdelatrisu/opsu/downloads/servers/HexideServer.java b/src/itdelatrisu/opsu/downloads/servers/HexideServer.java index 1d31289f..e9b7c683 100644 --- a/src/itdelatrisu/opsu/downloads/servers/HexideServer.java +++ b/src/itdelatrisu/opsu/downloads/servers/HexideServer.java @@ -33,6 +33,8 @@ import org.json.JSONObject; /** * Download server: https://osu.hexide.com/ + *

+ * This server went offline in 2016. */ public class HexideServer extends DownloadServer { /** Server name. */ diff --git a/src/itdelatrisu/opsu/states/DownloadsMenu.java b/src/itdelatrisu/opsu/states/DownloadsMenu.java index 62f0eff6..76fd7376 100644 --- a/src/itdelatrisu/opsu/states/DownloadsMenu.java +++ b/src/itdelatrisu/opsu/states/DownloadsMenu.java @@ -34,7 +34,6 @@ import itdelatrisu.opsu.downloads.DownloadList; import itdelatrisu.opsu.downloads.DownloadNode; import itdelatrisu.opsu.downloads.servers.BloodcatServer; import itdelatrisu.opsu.downloads.servers.DownloadServer; -import itdelatrisu.opsu.downloads.servers.HexideServer; import itdelatrisu.opsu.downloads.servers.MengSkyServer; import itdelatrisu.opsu.downloads.servers.MnetworkServer; import itdelatrisu.opsu.downloads.servers.YaSOnlineServer; @@ -82,8 +81,10 @@ public class DownloadsMenu extends BasicGameState { /** Available beatmap download servers. */ private static final DownloadServer[] SERVERS = { - new BloodcatServer(), new HexideServer(), new YaSOnlineServer(), - new MnetworkServer(), new MengSkyServer() + new BloodcatServer(), + new YaSOnlineServer(), + new MnetworkServer(), + new MengSkyServer() }; /** The current list of search results. */ From e6ca847d17f88bf5b529615470bd7fe4b8b53f3f Mon Sep 17 00:00:00 2001 From: Jeffrey Han Date: Fri, 9 Dec 2016 23:15:47 -0500 Subject: [PATCH 2/3] Follow-up to #209: minor consistency changes. Signed-off-by: Jeffrey Han --- src/itdelatrisu/opsu/states/Game.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/itdelatrisu/opsu/states/Game.java b/src/itdelatrisu/opsu/states/Game.java index 3afbb4aa..fdeee9a8 100644 --- a/src/itdelatrisu/opsu/states/Game.java +++ b/src/itdelatrisu/opsu/states/Game.java @@ -466,16 +466,16 @@ public class Game extends BasicGameState { // letterbox effect (black bars on top/bottom) if (beatmap.letterboxInBreaks && breakLength >= 4000) { // let it fade in/out - float a = Color.black.a; + float a = Colors.BLACK_ALPHA.a; if (trackPosition - breakTime > breakLength / 2) { - Color.black.a = (Math.min(500f, breakTime + breakLength - trackPosition)) / 500f; + Colors.BLACK_ALPHA.a = (Math.min(500f, breakTime + breakLength - trackPosition)) / 500f; } else { - Color.black.a = Math.min(500, trackPosition - breakTime) / 500f; + Colors.BLACK_ALPHA.a = Math.min(500, trackPosition - breakTime) / 500f; } - g.setColor(Color.black); - Color.black.a = a; + g.setColor(Colors.BLACK_ALPHA); g.fillRect(0, 0, width, height * 0.125f); g.fillRect(0, height * 0.875f, width, height * 0.125f); + Colors.BLACK_ALPHA.a = a; } data.drawGameElements(g, true, objectIndex == 0); @@ -873,7 +873,8 @@ public class Game extends BasicGameState { if (beatmap.breaks != null && breakIndex < beatmap.breaks.size()) { int breakValue = beatmap.breaks.get(breakIndex); if (breakTime > 0) { // in a break period - if (trackPosition < breakValue && trackPosition < beatmap.objects[objectIndex].getTime() - approachTime) + if (trackPosition < breakValue && + trackPosition < beatmap.objects[objectIndex].getTime() - approachTime) return; else { // break is over From cc250ad6fc634b8cc7f78c72f7f45cb7cd8e424e Mon Sep 17 00:00:00 2001 From: Jeffrey Han Date: Sat, 10 Dec 2016 00:49:33 -0500 Subject: [PATCH 3/3] Follow-up to #210. Disabled bouncing reverse arrow; minor cleanup. Signed-off-by: Jeffrey Han --- src/itdelatrisu/opsu/GameData.java | 1 + src/itdelatrisu/opsu/objects/Slider.java | 57 +++++++++++++++--------- 2 files changed, 36 insertions(+), 22 deletions(-) diff --git a/src/itdelatrisu/opsu/GameData.java b/src/itdelatrisu/opsu/GameData.java index f9e058c0..baa77e8e 100644 --- a/src/itdelatrisu/opsu/GameData.java +++ b/src/itdelatrisu/opsu/GameData.java @@ -901,6 +901,7 @@ public class GameData { float scale = (!hitResult.expand) ? 1f : 1f + (HITCIRCLE_ANIM_SCALE - 1f) * progress; float alpha = 1f - progress; + // "hidden" mod: circle and slider animations not drawn if (!GameMod.HIDDEN.isActive()) { // slider curve if (hitResult.curve != null) { diff --git a/src/itdelatrisu/opsu/objects/Slider.java b/src/itdelatrisu/opsu/objects/Slider.java index 1f79dbfe..94e68363 100644 --- a/src/itdelatrisu/opsu/objects/Slider.java +++ b/src/itdelatrisu/opsu/objects/Slider.java @@ -104,11 +104,11 @@ public class Slider implements GameObject { /** Number of ticks hit and tick intervals so far. */ private int ticksHit = 0, tickIntervals = 1; - /** The current tick expanded time */ - private int tickExpand = 0; + /** The current tick time for the follow circle expanding animation. */ + private int tickExpandTime = 0; - /** The duration of the tick expand */ - private final int TICKEXPANDTIME = 200; + /** The duration of the follow circle expanding animation on ticks. */ + private static final int TICK_EXPAND_TIME = 200; /** Container dimensions. */ private static int containerWidth, containerHeight; @@ -194,10 +194,12 @@ public class Slider implements GameObject { Image hitCircle = GameImage.HITCIRCLE.getImage(); Vec2f endPos = curve.pointAt(1); - float oldWHITE_FADEalpha = Colors.WHITE_FADE.a; + float oldWhiteFadeAlpha = Colors.WHITE_FADE.a; float sliderAlpha = 1f; if (GameMod.HIDDEN.isActive() && trackPosition > hitObject.getTime()) { - Colors.WHITE_FADE.a = color.a = sliderAlpha = Math.max(0f, 1f - ((float) (trackPosition - hitObject.getTime()) / (getEndTime() - hitObject.getTime())) * 1.05f); + // "hidden" mod: fade out sliders + Colors.WHITE_FADE.a = color.a = sliderAlpha = + Math.max(0f, 1f - ((float) (trackPosition - hitObject.getTime()) / (getEndTime() - hitObject.getTime())) * 1.05f); } float curveInterval = Options.isSliderSnaking() ? alpha : 1f; @@ -218,7 +220,7 @@ public class Slider implements GameObject { // ticks if (ticksT != null) { drawSliderTicks(g, trackPosition, sliderAlpha, decorationsAlpha); - Colors.WHITE_FADE.a = oldWHITE_FADEalpha; + Colors.WHITE_FADE.a = oldWhiteFadeAlpha; } if (GameMod.HIDDEN.isActive()) { @@ -236,10 +238,10 @@ public class Slider implements GameObject { hitCircle.getWidth() * 0.40f / data.getDefaultSymbolImage(0).getHeight(), alpha); if (overlayAboveNumber) { - oldWHITE_FADEalpha = Colors.WHITE_FADE.a; + oldWhiteFadeAlpha = Colors.WHITE_FADE.a; Colors.WHITE_FADE.a = sliderAlpha; hitCircleOverlay.drawCentered(x, y, Colors.WHITE_FADE); - Colors.WHITE_FADE.a = oldWHITE_FADEalpha; + Colors.WHITE_FADE.a = oldWhiteFadeAlpha; } // repeats @@ -247,7 +249,8 @@ public class Slider implements GameObject { for (int tcurRepeat = currentRepeats; tcurRepeat <= currentRepeats + 1; tcurRepeat++) { if (hitObject.getRepeatCount() - 1 > tcurRepeat) { Image arrow = GameImage.REVERSEARROW.getImage(); - arrow = arrow.getScaledCopy((float) (1 + 0.2d * ((trackPosition + sliderTime * tcurRepeat) % 292) / 292)); + // bouncing animation + //arrow = arrow.getScaledCopy((float) (1 + 0.2d * ((trackPosition + sliderTime * tcurRepeat) % 292) / 292)); float colorLuminance = 0.299f*color.r + 0.587f*color.g + 0.114f*color.b; Color arrowColor = colorLuminance < 0.8f ? Color.white : Color.black; if (tcurRepeat != currentRepeats) { @@ -297,7 +300,8 @@ public class Slider implements GameObject { // follow circle if (followCircleActive) { - GameImage.SLIDER_FOLLOWCIRCLE.getImage().getScaledCopy(1f + (tickExpand / (float) TICKEXPANDTIME) * 0.1f).drawCentered(c.x, c.y); + float followCircleScale = 1f + (tickExpandTime / (float) TICK_EXPAND_TIME) * 0.1f; + GameImage.SLIDER_FOLLOWCIRCLE.getImage().getScaledCopy(followCircleScale).drawCentered(c.x, c.y); // "flashlight" mod: dim the screen if (GameMod.FLASHLIGHT.isActive()) { @@ -313,6 +317,13 @@ public class Slider implements GameObject { Colors.WHITE_FADE.a = oldAlpha; } + /** + * Draws slider ticks. + * @param g the graphics context + * @param trackPosition the track position + * @param curveAlpha the curve alpha level + * @param decorationsAlpha the decorations alpha level + */ private void drawSliderTicks(Graphics g, int trackPosition, float curveAlpha, float decorationsAlpha) { float tickScale = 0.5f + 0.5f * AnimationEquation.OUT_BACK.calc(decorationsAlpha); Image tick = GameImage.SLIDER_TICK.getImage().getScaledCopy(tickScale); @@ -333,6 +344,7 @@ public class Slider implements GameObject { min = 0; } + // draw ticks for (int i = min; i < max; i++) { Vec2f c = curve.pointAt(ticksT[i]); Colors.WHITE_FADE.a = Math.min(curveAlpha, decorationsAlpha); @@ -484,17 +496,10 @@ public class Slider implements GameObject { mousePressed(mouseX, mouseY, trackPosition); } - if (tickExpand > 0) { - tickExpand -= delta; - if (tickExpand < 0) { - tickExpand = 0; - } - } - // end of slider if (trackPosition > hitObject.getTime() + sliderTimeTotal) { tickIntervals++; - tickExpand = TICKEXPANDTIME; + tickExpandTime = TICK_EXPAND_TIME; // check if cursor pressed and within end circle if (keyPressed || GameMod.RELAX.isActive()) { @@ -517,15 +522,22 @@ public class Slider implements GameObject { return true; } + // update tick expand time + if (tickExpandTime > 0) { + tickExpandTime -= delta; + if (tickExpandTime < 0) + tickExpandTime = 0; + } + // repeats boolean isNewRepeat = false; if (repeatCount - 1 > currentRepeats) { float t = getT(trackPosition, true); if (Math.floor(t) > currentRepeats) { currentRepeats++; - tickExpand = TICKEXPANDTIME; - isNewRepeat = true; tickIndex = 0; + isNewRepeat = true; + tickExpandTime = TICK_EXPAND_TIME; } } @@ -538,8 +550,8 @@ public class Slider implements GameObject { if (t - Math.floor(t) >= ticksT[tickIndex]) { tickIntervals++; tickIndex = (tickIndex + 1) % ticksT.length; - tickExpand = TICKEXPANDTIME; isNewTick = true; + tickExpandTime = TICK_EXPAND_TIME; } } @@ -632,5 +644,6 @@ public class Slider implements GameObject { tickIndex = 0; ticksHit = 0; tickIntervals = 1; + tickExpandTime = 0; } }