From 3c6b20f4c812903ebcff1b1a0ec4c97c7afe4ce0 Mon Sep 17 00:00:00 2001 From: yugecin Date: Sun, 18 Dec 2016 14:46:02 +0100 Subject: [PATCH] adjust the animations on the first circle of the slider --- src/itdelatrisu/opsu/GameData.java | 7 +++- src/itdelatrisu/opsu/objects/Slider.java | 42 +++++++++++++++--------- 2 files changed, 32 insertions(+), 17 deletions(-) diff --git a/src/itdelatrisu/opsu/GameData.java b/src/itdelatrisu/opsu/GameData.java index d4ce3272..92255902 100644 --- a/src/itdelatrisu/opsu/GameData.java +++ b/src/itdelatrisu/opsu/GameData.java @@ -150,7 +150,8 @@ public class GameData { HIT_SLIDER10 = 7, HIT_SLIDER30 = 8, HIT_MAX = 9, // not a hit result - HIT_SLIDER_REPEAT = 10; // not a hit result + HIT_SLIDER_REPEAT = 10, // not a hit result + HIT_ANIMATION_RESULT = 11; // not a hit result /** Hit result-related images (indexed by HIT_* constants). */ private Image[] hitResults; @@ -1211,6 +1212,10 @@ public class GameData { hitResultList.add(new HitObjectResult(time, HIT_SLIDER_REPEAT, 0f, 0f, color, HitObjectType.SLIDER_CURVE, curve, true, true)); } + public void sendAnimationResult(int time, float x, float y, Color color, boolean expand) { + hitResultList.add(new HitObjectResult(time, HIT_ANIMATION_RESULT, x, y, color, HitObjectType.CIRCLE, null, expand, true)); + } + /** * Handles a slider tick result. * @param time the tick start time diff --git a/src/itdelatrisu/opsu/objects/Slider.java b/src/itdelatrisu/opsu/objects/Slider.java index f8d9a3ea..062d8f16 100644 --- a/src/itdelatrisu/opsu/objects/Slider.java +++ b/src/itdelatrisu/opsu/objects/Slider.java @@ -210,10 +210,12 @@ public class Slider implements GameObject { hitCircle.drawCentered(endCircPos.x, endCircPos.y, color); hitCircleOverlay.drawCentered(endCircPos.x, endCircPos.y, Colors.WHITE_FADE); - // start circle - hitCircle.drawCentered(x, y, color); - if (!overlayAboveNumber) - hitCircleOverlay.drawCentered(x, y, Colors.WHITE_FADE); + // draw start circle when not clicked yet + if (!sliderClickedInitial) { + hitCircle.drawCentered(x, y, color); + if (!overlayAboveNumber) + hitCircleOverlay.drawCentered(x, y, Colors.WHITE_FADE); + } color.a = alpha; @@ -231,17 +233,18 @@ public class Slider implements GameObject { alpha = Math.min(alpha, hiddenAlpha); } } - if (sliderClickedInitial) - ; // don't draw current combo number if already clicked - else - data.drawSymbolNumber(hitObject.getComboNumber(), x, y, - hitCircle.getWidth() * 0.40f / data.getDefaultSymbolImage(0).getHeight(), alpha); - if (overlayAboveNumber) { - oldWhiteFadeAlpha = Colors.WHITE_FADE.a; - Colors.WHITE_FADE.a = sliderAlpha; - hitCircleOverlay.drawCentered(x, y, Colors.WHITE_FADE); - Colors.WHITE_FADE.a = oldWhiteFadeAlpha; + // draw combonumber and overlay if not initially clicked + if (!sliderClickedInitial) { + data.drawSymbolNumber(hitObject.getComboNumber(), x, y, + hitCircle.getWidth() * 0.40f / data.getDefaultSymbolImage(0).getHeight(), alpha); + + if (overlayAboveNumber) { + oldWhiteFadeAlpha = Colors.WHITE_FADE.a; + Colors.WHITE_FADE.a = sliderAlpha; + hitCircleOverlay.drawCentered(x, y, Colors.WHITE_FADE); + Colors.WHITE_FADE.a = oldWhiteFadeAlpha; + } } // repeats @@ -460,8 +463,11 @@ public class Slider implements GameObject { if (timeDiff < hitResultOffset[GameData.HIT_50]) { result = GameData.HIT_SLIDER30; ticksHit++; - } else if (timeDiff < hitResultOffset[GameData.HIT_MISS]) + data.sendAnimationResult(trackPosition, x, y, color, true); + } else if (timeDiff < hitResultOffset[GameData.HIT_MISS]) { result = GameData.HIT_MISS; + data.sendAnimationResult(trackPosition, x, y, color, false); + } //else not a hit if (result > -1) { @@ -489,8 +495,11 @@ public class Slider implements GameObject { if (isAutoMod) { // "auto" mod: catch any missed notes due to lag ticksHit++; data.sliderTickResult(time, GameData.HIT_SLIDER30, x, y, hitObject, currentRepeats); - } else + data.sendAnimationResult(time, x, y, color, true); + } else { data.sliderTickResult(time, GameData.HIT_MISS, x, y, hitObject, currentRepeats); + data.sendAnimationResult(trackPosition, x, y, color, false); + } } // "auto" mod: send a perfect hit result @@ -499,6 +508,7 @@ public class Slider implements GameObject { ticksHit++; sliderClickedInitial = true; data.sliderTickResult(time, GameData.HIT_SLIDER30, x, y, hitObject, currentRepeats); + data.sendAnimationResult(time, x, y, color, true); } }