From 7a45e1abbb2181966f8a8078991e055bfe733387 Mon Sep 17 00:00:00 2001 From: yugecin Date: Sat, 10 Dec 2016 01:54:29 +0100 Subject: [PATCH 1/6] fade out sliders when hidden is enabled --- src/itdelatrisu/opsu/objects/Slider.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/itdelatrisu/opsu/objects/Slider.java b/src/itdelatrisu/opsu/objects/Slider.java index 888bdaec..d1ebc549 100644 --- a/src/itdelatrisu/opsu/objects/Slider.java +++ b/src/itdelatrisu/opsu/objects/Slider.java @@ -188,9 +188,14 @@ public class Slider implements GameObject { Image hitCircle = GameImage.HITCIRCLE.getImage(); Vec2f endPos = curve.pointAt(1); + float oldWHITE_FADEalpha = 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); + } + float curveInterval = Options.isSliderSnaking() ? alpha : 1f; curve.draw(color,curveInterval); - color.a = alpha; // end circle Vec2f endCircPos = curve.pointAt(curveInterval); @@ -202,6 +207,9 @@ public class Slider implements GameObject { if (!overlayAboveNumber) hitCircleOverlay.drawCentered(x, y, Colors.WHITE_FADE); + Colors.WHITE_FADE.a = oldWHITE_FADEalpha; + color.a = alpha; + // ticks if (ticksT != null) { float tickScale = 0.5f + 0.5f * AnimationEquation.OUT_BACK.calc(decorationsAlpha); @@ -226,8 +234,13 @@ public class Slider implements GameObject { else data.drawSymbolNumber(hitObject.getComboNumber(), x, y, hitCircle.getWidth() * 0.40f / data.getDefaultSymbolImage(0).getHeight(), alpha); - if (overlayAboveNumber) + + if (overlayAboveNumber) { + oldWHITE_FADEalpha = Colors.WHITE_FADE.a; + Colors.WHITE_FADE.a = sliderAlpha; hitCircleOverlay.drawCentered(x, y, Colors.WHITE_FADE); + Colors.WHITE_FADE.a = oldWHITE_FADEalpha; + } // repeats if (curveInterval == 1.0f) { From c87c5a8d7a1eded283fb7c1ab67ad08d9df40cb6 Mon Sep 17 00:00:00 2001 From: yugecin Date: Sat, 10 Dec 2016 02:01:53 +0100 Subject: [PATCH 2/6] don't show hitresult fades for sliders when hidden is enabled --- src/itdelatrisu/opsu/GameData.java | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/itdelatrisu/opsu/GameData.java b/src/itdelatrisu/opsu/GameData.java index 98db996d..f9e058c0 100644 --- a/src/itdelatrisu/opsu/GameData.java +++ b/src/itdelatrisu/opsu/GameData.java @@ -901,20 +901,19 @@ public class GameData { float scale = (!hitResult.expand) ? 1f : 1f + (HITCIRCLE_ANIM_SCALE - 1f) * progress; float alpha = 1f - progress; - // slider curve - if (hitResult.curve != null) { - float oldWhiteAlpha = Colors.WHITE_FADE.a; - float oldColorAlpha = hitResult.color.a; - Colors.WHITE_FADE.a = alpha; - hitResult.color.a = alpha; - hitResult.curve.draw(hitResult.color); - Colors.WHITE_FADE.a = oldWhiteAlpha; - hitResult.color.a = oldColorAlpha; - } + if (!GameMod.HIDDEN.isActive()) { + // slider curve + if (hitResult.curve != null) { + float oldWhiteAlpha = Colors.WHITE_FADE.a; + float oldColorAlpha = hitResult.color.a; + Colors.WHITE_FADE.a = alpha; + hitResult.color.a = alpha; + hitResult.curve.draw(hitResult.color); + Colors.WHITE_FADE.a = oldWhiteAlpha; + hitResult.color.a = oldColorAlpha; + } - // hit circles - if (!(hitResult.hitResultType == HitObjectType.CIRCLE && GameMod.HIDDEN.isActive())) { - // "hidden" mod: expanding animation for only circles not drawn + // hit circles Image scaledHitCircle = GameImage.HITCIRCLE.getImage().getScaledCopy(scale); Image scaledHitCircleOverlay = GameImage.HITCIRCLE_OVERLAY.getImage().getScaledCopy(scale); scaledHitCircle.setAlpha(alpha); From ffd1a577555fd48cd17dc894e7d2b29fe58412c5 Mon Sep 17 00:00:00 2001 From: yugecin Date: Sat, 10 Dec 2016 02:04:37 +0100 Subject: [PATCH 3/6] don't draw sliderticks that the sliderball already passed --- src/itdelatrisu/opsu/objects/Slider.java | 39 ++++++++++++++++++------ 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/src/itdelatrisu/opsu/objects/Slider.java b/src/itdelatrisu/opsu/objects/Slider.java index d1ebc549..da84daef 100644 --- a/src/itdelatrisu/opsu/objects/Slider.java +++ b/src/itdelatrisu/opsu/objects/Slider.java @@ -207,20 +207,14 @@ public class Slider implements GameObject { if (!overlayAboveNumber) hitCircleOverlay.drawCentered(x, y, Colors.WHITE_FADE); - Colors.WHITE_FADE.a = oldWHITE_FADEalpha; color.a = alpha; // ticks if (ticksT != null) { - float tickScale = 0.5f + 0.5f * AnimationEquation.OUT_BACK.calc(decorationsAlpha); - Image tick = GameImage.SLIDER_TICK.getImage().getScaledCopy(tickScale); - for (int i = 0; i < ticksT.length; i++) { - Vec2f c = curve.pointAt(ticksT[i]); - Colors.WHITE_FADE.a = decorationsAlpha; - tick.drawCentered(c.x, c.y, Colors.WHITE_FADE); - Colors.WHITE_FADE.a = alpha; - } + drawSliderTicks(g, trackPosition, sliderAlpha, decorationsAlpha); + Colors.WHITE_FADE.a = oldWHITE_FADEalpha; } + if (GameMod.HIDDEN.isActive()) { final int hiddenDecayTime = game.getHiddenDecayTime(); final int hiddenTimeDiff = game.getHiddenTimeDiff(); @@ -312,6 +306,33 @@ public class Slider implements GameObject { Colors.WHITE_FADE.a = oldAlpha; } + 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); + + // calculate which ticks need to be drawn (don't draw if sliderball crossed it) + int min = 0; + int max = ticksT.length; + if (trackPosition > hitObject.getTime()) { + for (int i = 0; i < ticksT.length; ) { + if (((trackPosition - hitObject.getTime()) % sliderTime) / sliderTime < ticksT[i]) { + break; + } + min = ++i; + } + } + if (currentRepeats % 2 == 1) { + max -= min; + min = 0; + } + + for (int i = min; i < max; i++) { + Vec2f c = curve.pointAt(ticksT[i]); + Colors.WHITE_FADE.a = Math.min(curveAlpha, decorationsAlpha); + tick.drawCentered(c.x, c.y, Colors.WHITE_FADE); + } + } + /** * Calculates the slider hit result. * @return the hit result (GameData.HIT_* constants) From 5657290abff739cfb6ebaac4b97010d8ab748095 Mon Sep 17 00:00:00 2001 From: yugecin Date: Sat, 10 Dec 2016 02:08:37 +0100 Subject: [PATCH 4/6] fix first tick after repeat being ignored --- src/itdelatrisu/opsu/objects/Slider.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/itdelatrisu/opsu/objects/Slider.java b/src/itdelatrisu/opsu/objects/Slider.java index da84daef..54fb899f 100644 --- a/src/itdelatrisu/opsu/objects/Slider.java +++ b/src/itdelatrisu/opsu/objects/Slider.java @@ -508,8 +508,8 @@ public class Slider implements GameObject { float t = getT(trackPosition, true); if (Math.floor(t) > currentRepeats) { currentRepeats++; - tickIntervals++; isNewRepeat = true; + tickIndex = 0; } } From 8ea4bcf7de2a8c56e3573b3afc487a9de19c663c Mon Sep 17 00:00:00 2001 From: yugecin Date: Sat, 10 Dec 2016 02:13:56 +0100 Subject: [PATCH 5/6] expand followcircle on sliderticks --- src/itdelatrisu/opsu/objects/Slider.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/itdelatrisu/opsu/objects/Slider.java b/src/itdelatrisu/opsu/objects/Slider.java index 54fb899f..03cb7770 100644 --- a/src/itdelatrisu/opsu/objects/Slider.java +++ b/src/itdelatrisu/opsu/objects/Slider.java @@ -104,6 +104,12 @@ 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 duration of the tick expand */ + private final int TICKEXPANDTIME = 200; + /** Container dimensions. */ private static int containerWidth, containerHeight; @@ -290,7 +296,7 @@ public class Slider implements GameObject { // follow circle if (followCircleActive) { - GameImage.SLIDER_FOLLOWCIRCLE.getImage().drawCentered(c.x, c.y); + GameImage.SLIDER_FOLLOWCIRCLE.getImage().getScaledCopy(1f + (tickExpand / (float) TICKEXPANDTIME) * 0.1f).drawCentered(c.x, c.y); // "flashlight" mod: dim the screen if (GameMod.FLASHLIGHT.isActive()) { @@ -477,9 +483,17 @@ 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; // check if cursor pressed and within end circle if (keyPressed || GameMod.RELAX.isActive()) { @@ -508,6 +522,7 @@ public class Slider implements GameObject { float t = getT(trackPosition, true); if (Math.floor(t) > currentRepeats) { currentRepeats++; + tickExpand = TICKEXPANDTIME; isNewRepeat = true; tickIndex = 0; } @@ -522,6 +537,7 @@ public class Slider implements GameObject { if (t - Math.floor(t) >= ticksT[tickIndex]) { tickIntervals++; tickIndex = (tickIndex + 1) % ticksT.length; + tickExpand = TICKEXPANDTIME; isNewTick = true; } } From 452daee4d80cac8479c461543fbdb9a0429aaf73 Mon Sep 17 00:00:00 2001 From: yugecin Date: Sat, 10 Dec 2016 02:16:58 +0100 Subject: [PATCH 6/6] bouncy reversearrow --- src/itdelatrisu/opsu/objects/Slider.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/itdelatrisu/opsu/objects/Slider.java b/src/itdelatrisu/opsu/objects/Slider.java index 03cb7770..1f79dbfe 100644 --- a/src/itdelatrisu/opsu/objects/Slider.java +++ b/src/itdelatrisu/opsu/objects/Slider.java @@ -247,6 +247,7 @@ 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)); 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) {