mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Event -> virtual method
This commit is contained in:
@ -58,7 +58,11 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
|
|
||||||
NewResult += onNewResult;
|
NewResult += onNewResult;
|
||||||
RevertResult += onRevertResult;
|
RevertResult += onRevertResult;
|
||||||
OnNewDrawableHitObject += d => ((DrawableCatchHitObject)d).CheckPosition = CheckIfWeCanCatch;
|
}
|
||||||
|
|
||||||
|
protected override void OnNewDrawableHitObject(DrawableHitObject d)
|
||||||
|
{
|
||||||
|
((DrawableCatchHitObject)d).CheckPosition = CheckIfWeCanCatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CheckIfWeCanCatch(CatchHitObject obj) => CatcherArea.AttemptCatch(obj);
|
public bool CheckIfWeCanCatch(CatchHitObject obj) => CatcherArea.AttemptCatch(obj);
|
||||||
|
@ -29,9 +29,9 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
{
|
{
|
||||||
protected override GameplayCursorContainer CreateCursor() => null;
|
protected override GameplayCursorContainer CreateCursor() => null;
|
||||||
|
|
||||||
public OsuEditPlayfield()
|
protected override void OnNewDrawableHitObject(DrawableHitObject d)
|
||||||
{
|
{
|
||||||
OnNewDrawableHitObject += d => d.ApplyCustomUpdateState += updateState;
|
d.ApplyCustomUpdateState += updateState;
|
||||||
}
|
}
|
||||||
|
|
||||||
private const double editor_hit_object_fade_out_extension = 700;
|
private const double editor_hit_object_fade_out_extension = 700;
|
||||||
|
@ -92,10 +92,9 @@ namespace osu.Game.Rulesets.Osu.UI
|
|||||||
AddRangeInternal(poolDictionary.Values);
|
AddRangeInternal(poolDictionary.Values);
|
||||||
|
|
||||||
NewResult += onNewResult;
|
NewResult += onNewResult;
|
||||||
OnNewDrawableHitObject += onDrawableHitObjectAdded;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onDrawableHitObjectAdded(DrawableHitObject drawable)
|
protected override void OnNewDrawableHitObject(DrawableHitObject drawable)
|
||||||
{
|
{
|
||||||
((DrawableOsuHitObject)drawable).CheckHittable = CheckHittable;
|
((DrawableOsuHitObject)drawable).CheckHittable = CheckHittable;
|
||||||
|
|
||||||
|
@ -33,16 +33,6 @@ namespace osu.Game.Rulesets.UI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public event Action<DrawableHitObject, JudgementResult> RevertResult;
|
public event Action<DrawableHitObject, JudgementResult> RevertResult;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Invoked before a new <see cref="DrawableHitObject"/> is added.
|
|
||||||
/// This event is invoked only once for each <see cref="DrawableHitObject"/>
|
|
||||||
/// even the drawable is pooled and used multiple times for different <see cref="HitObject"/>s.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// This event is also called for nested <see cref="DrawableHitObject"/>s.
|
|
||||||
/// </remarks>
|
|
||||||
public event Action<DrawableHitObject> OnNewDrawableHitObject;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The <see cref="DrawableHitObject"/> contained in this Playfield.
|
/// The <see cref="DrawableHitObject"/> contained in this Playfield.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -128,7 +118,7 @@ namespace osu.Game.Rulesets.UI
|
|||||||
{
|
{
|
||||||
d.OnNestedDrawableCreated += onNewDrawableHitObject;
|
d.OnNestedDrawableCreated += onNewDrawableHitObject;
|
||||||
|
|
||||||
OnNewDrawableHitObject?.Invoke(d);
|
OnNewDrawableHitObject(d);
|
||||||
|
|
||||||
Debug.Assert(!d.HasInitialized);
|
Debug.Assert(!d.HasInitialized);
|
||||||
d.HasInitialized = true;
|
d.HasInitialized = true;
|
||||||
@ -183,6 +173,17 @@ namespace osu.Game.Rulesets.UI
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Invoked before a new <see cref="DrawableHitObject"/> is added to this <see cref="Playfield"/>.
|
||||||
|
/// It is invoked only once even the drawable is pooled and used multiple times for different <see cref="HitObject"/>s.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This is also invoked for nested <see cref="DrawableHitObject"/>s.
|
||||||
|
/// </remarks>
|
||||||
|
protected virtual void OnNewDrawableHitObject(DrawableHitObject drawableHitObject)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The cursor currently being used by this <see cref="Playfield"/>. May be null if no cursor is provided.
|
/// The cursor currently being used by this <see cref="Playfield"/>. May be null if no cursor is provided.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Reference in New Issue
Block a user