mirror of
https://github.com/ppy/osu
synced 2024-12-28 18:02:53 +00:00
Merge pull request #10794 from smoogipoo/fix-osu-hd-mod
This commit is contained in:
commit
41a1730927
@ -27,17 +27,23 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
public override void ApplyToDrawableHitObjects(IEnumerable<DrawableHitObject> drawables)
|
||||
{
|
||||
foreach (var d in drawables)
|
||||
d.ApplyCustomUpdateState += applyFadeInAdjustment;
|
||||
{
|
||||
d.HitObjectApplied += applyFadeInAdjustment;
|
||||
applyFadeInAdjustment(d);
|
||||
}
|
||||
|
||||
base.ApplyToDrawableHitObjects(drawables);
|
||||
}
|
||||
|
||||
private void applyFadeInAdjustment(DrawableHitObject hitObject, ArmedState state)
|
||||
private void applyFadeInAdjustment(DrawableHitObject hitObject)
|
||||
{
|
||||
if (!(hitObject is DrawableOsuHitObject d))
|
||||
return;
|
||||
|
||||
d.HitObject.TimeFadeIn = d.HitObject.TimePreempt * fade_in_duration_multiplier;
|
||||
|
||||
foreach (var nested in d.NestedHitObjects)
|
||||
applyFadeInAdjustment(nested);
|
||||
}
|
||||
|
||||
private double lastSliderHeadFadeOutStartTime;
|
||||
|
@ -26,8 +26,16 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
[Cached(typeof(DrawableHitObject))]
|
||||
public abstract class DrawableHitObject : SkinReloadableDrawable
|
||||
{
|
||||
/// <summary>
|
||||
/// Invoked after this <see cref="DrawableHitObject"/>'s applied <see cref="HitObject"/> has had its defaults applied.
|
||||
/// </summary>
|
||||
public event Action<DrawableHitObject> DefaultsApplied;
|
||||
|
||||
/// <summary>
|
||||
/// Invoked after a <see cref="HitObject"/> has been applied to this <see cref="DrawableHitObject"/>.
|
||||
/// </summary>
|
||||
public event Action<DrawableHitObject> HitObjectApplied;
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="HitObject"/> currently represented by this <see cref="DrawableHitObject"/>.
|
||||
/// </summary>
|
||||
@ -192,6 +200,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
HitObject.DefaultsApplied += onDefaultsApplied;
|
||||
|
||||
OnApply(hitObject);
|
||||
HitObjectApplied?.Invoke(this);
|
||||
|
||||
// If not loaded, the state update happens in LoadComplete(). Otherwise, the update is scheduled to allow for lifetime updates.
|
||||
if (IsLoaded)
|
||||
|
Loading…
Reference in New Issue
Block a user