mirror of
https://github.com/osukey/osukey.git
synced 2025-06-05 12:57:39 +09:00
created option to override values before UpdateState is called
This commit is contained in:
parent
a58b5ff5f2
commit
f547c7986d
@ -44,6 +44,14 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
d.ApplyCustomUpdateState += ApplyHiddenState;
|
d.ApplyCustomUpdateState += ApplyHiddenState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void ApplyHiddenValues(DrawableHitObject drawable)
|
||||||
|
{
|
||||||
|
if (!(drawable is DrawableOsuHitObject d))
|
||||||
|
return;
|
||||||
|
|
||||||
|
d.FadeIn = preEmpt * fade_in_duration_multiplier;
|
||||||
|
}
|
||||||
|
|
||||||
protected void ApplyHiddenState(DrawableHitObject drawable, ArmedState state)
|
protected void ApplyHiddenState(DrawableHitObject drawable, ArmedState state)
|
||||||
{
|
{
|
||||||
if (!(drawable is DrawableOsuHitObject d))
|
if (!(drawable is DrawableOsuHitObject d))
|
||||||
@ -58,8 +66,6 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
// new duration from completed fade in to end (before fading out)
|
// new duration from completed fade in to end (before fading out)
|
||||||
var longFadeDuration = ((d.HitObject as IHasEndTime)?.EndTime ?? d.HitObject.StartTime) - fadeOutStartTime;
|
var longFadeDuration = ((d.HitObject as IHasEndTime)?.EndTime ?? d.HitObject.StartTime) - fadeOutStartTime;
|
||||||
|
|
||||||
d.FadeIn = fadeInDuration;
|
|
||||||
|
|
||||||
switch (drawable)
|
switch (drawable)
|
||||||
{
|
{
|
||||||
case DrawableHitCircle circle:
|
case DrawableHitCircle circle:
|
||||||
|
@ -120,6 +120,9 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
|||||||
|
|
||||||
State.ValueChanged += state =>
|
State.ValueChanged += state =>
|
||||||
{
|
{
|
||||||
|
// apply any custom values
|
||||||
|
ApplyCustomValues?.Invoke(this);
|
||||||
|
|
||||||
UpdateState(state);
|
UpdateState(state);
|
||||||
|
|
||||||
// apply any custom state overrides
|
// apply any custom state overrides
|
||||||
@ -250,6 +253,11 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
|||||||
nestedHitObjects.Add(h);
|
nestedHitObjects.Add(h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Bind to apply custom values.
|
||||||
|
/// </summary>
|
||||||
|
public event Action<DrawableHitObject> ApplyCustomValues;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Bind to apply a custom state which can override the default implementation.
|
/// Bind to apply a custom state which can override the default implementation.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user