mirror of
https://github.com/osukey/osukey.git
synced 2025-05-19 12:37:38 +09:00
Move early fade effect to classic mod setting
This commit is contained in:
parent
d027d69913
commit
7bad0113cd
@ -4,6 +4,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
@ -11,6 +12,7 @@ using osu.Game.Rulesets.Objects.Drawables;
|
|||||||
using osu.Game.Rulesets.Osu.Objects;
|
using osu.Game.Rulesets.Osu.Objects;
|
||||||
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Osu.UI;
|
using osu.Game.Rulesets.Osu.UI;
|
||||||
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Mods
|
namespace osu.Game.Rulesets.Osu.Mods
|
||||||
@ -31,6 +33,9 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
[SettingSource("Always play a slider's tail sample", "Always plays a slider's tail sample regardless of whether it was hit or not.")]
|
[SettingSource("Always play a slider's tail sample", "Always plays a slider's tail sample regardless of whether it was hit or not.")]
|
||||||
public Bindable<bool> AlwaysPlayTailSample { get; } = new BindableBool(true);
|
public Bindable<bool> AlwaysPlayTailSample { get; } = new BindableBool(true);
|
||||||
|
|
||||||
|
[SettingSource("Fade out hit circles earlier", "Make hit circles fade out into a miss, rather than after it.")]
|
||||||
|
public Bindable<bool> FadeHitCircleEarly { get; } = new Bindable<bool>(true);
|
||||||
|
|
||||||
public void ApplyToHitObject(HitObject hitObject)
|
public void ApplyToHitObject(HitObject hitObject)
|
||||||
{
|
{
|
||||||
switch (hitObject)
|
switch (hitObject)
|
||||||
@ -59,12 +64,32 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
{
|
{
|
||||||
case DrawableSliderHead head:
|
case DrawableSliderHead head:
|
||||||
head.TrackFollowCircle = !NoSliderHeadMovement.Value;
|
head.TrackFollowCircle = !NoSliderHeadMovement.Value;
|
||||||
|
if (FadeHitCircleEarly.Value)
|
||||||
|
applyEarlyFading(head);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DrawableSliderTail tail:
|
case DrawableSliderTail tail:
|
||||||
tail.SamplePlaysOnlyOnHit = !AlwaysPlayTailSample.Value;
|
tail.SamplePlaysOnlyOnHit = !AlwaysPlayTailSample.Value;
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
case DrawableHitCircle circle:
|
||||||
|
if (FadeHitCircleEarly.Value)
|
||||||
|
applyEarlyFading(circle);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void applyEarlyFading(DrawableHitCircle circle)
|
||||||
|
{
|
||||||
|
circle.ApplyCustomUpdateState += (o, _) =>
|
||||||
|
{
|
||||||
|
using (o.BeginAbsoluteSequence(o.StateUpdateTime))
|
||||||
|
{
|
||||||
|
double mehWindow = o.HitObject.HitWindows.WindowFor(HitResult.Meh);
|
||||||
|
double lateMissFadeTime = mehWindow / 4 + 15;
|
||||||
|
o.Delay(mehWindow - lateMissFadeTime).FadeOut(lateMissFadeTime);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -200,10 +200,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
|
|
||||||
// always fade out at the circle's start time (to match user expectations).
|
// always fade out at the circle's start time (to match user expectations).
|
||||||
ApproachCircle.FadeOut(50);
|
ApproachCircle.FadeOut(50);
|
||||||
|
|
||||||
double mehWindow = HitObject.HitWindows.WindowFor(HitResult.Meh);
|
|
||||||
double lateMissFadeTime = mehWindow / 4 + 15;
|
|
||||||
this.Delay(mehWindow - lateMissFadeTime).FadeOut(lateMissFadeTime);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdateHitStateTransforms(ArmedState state)
|
protected override void UpdateHitStateTransforms(ArmedState state)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user