mirror of
https://github.com/ppy/osu.git
synced 2025-01-18 05:42:56 +08:00
remove RestorePieceState
function
This commit is contained in:
parent
94f3cf1cbf
commit
a19459bb93
@ -77,8 +77,9 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||
OnNewResult += onNewResult;
|
||||
}
|
||||
|
||||
protected override void RestorePieceState()
|
||||
protected override void OnApply()
|
||||
{
|
||||
base.OnApply();
|
||||
updateColour();
|
||||
Height = HitObject.IsStrong ? TaikoStrongableHitObject.DEFAULT_STRONG_SIZE : TaikoHitObject.DEFAULT_SIZE;
|
||||
}
|
||||
|
@ -43,10 +43,6 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||
base.OnApply();
|
||||
|
||||
IsFirstTick.Value = HitObject.FirstTick;
|
||||
}
|
||||
|
||||
protected override void RestorePieceState()
|
||||
{
|
||||
Size = new Vector2(HitObject.IsStrong ? TaikoStrongableHitObject.DEFAULT_STRONG_SIZE : TaikoHitObject.DEFAULT_SIZE);
|
||||
}
|
||||
|
||||
|
@ -56,15 +56,9 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||
|
||||
protected override void OnApply()
|
||||
{
|
||||
base.OnApply(); // it's empty actually
|
||||
type.BindTo(HitObject.TypeBindable);
|
||||
// this doesn't need to be run inline as RecreatePieces is called by the base call below.
|
||||
type.BindValueChanged(_ => Scheduler.AddOnce(RestorePieceState));
|
||||
|
||||
base.OnApply();
|
||||
}
|
||||
|
||||
protected override void RestorePieceState()
|
||||
{
|
||||
if (editorMode)
|
||||
{
|
||||
// We in Editor Mode so the performance is not critical and we can recreate piece.
|
||||
|
@ -144,8 +144,9 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||
Origin = Anchor.Centre,
|
||||
});
|
||||
|
||||
protected override void RestorePieceState()
|
||||
protected override void OnApply()
|
||||
{
|
||||
base.OnApply();
|
||||
Size = baseSize = new Vector2(TaikoHitObject.DEFAULT_SIZE);
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,6 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||
|
||||
public override bool OnPressed(KeyBindingPressEvent<TaikoAction> e) => false;
|
||||
|
||||
protected override void RestorePieceState() { }
|
||||
protected override SkinnableDrawable OnLoadCreateMainPiece()
|
||||
=> new SkinnableDrawable(new TaikoSkinComponentLookup(TaikoSkinComponents.DrumRollTick), _ => new TickPiece());
|
||||
}
|
||||
|
@ -150,17 +150,6 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||
Content.Add(MainPiece = drawable);
|
||||
}
|
||||
|
||||
protected override void OnApply()
|
||||
{
|
||||
base.OnApply();
|
||||
|
||||
// TODO: now it fixed, yes?
|
||||
// TODO: THIS CANNOT BE HERE, it makes pooling pointless (see https://github.com/ppy/osu/issues/21072).
|
||||
RestorePieceState();
|
||||
}
|
||||
|
||||
protected abstract void RestorePieceState();
|
||||
|
||||
/// <summary>Creates <c>MainPiece</c>. Calls only on <c>load</c> or in EditorMode.</summary>
|
||||
protected abstract SkinnableDrawable OnLoadCreateMainPiece();
|
||||
}
|
||||
|
@ -27,11 +27,8 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||
|
||||
protected override void OnApply()
|
||||
{
|
||||
isStrong.BindTo(HitObject.IsStrongBindable);
|
||||
// this doesn't need to be run inline as RecreatePieces is called by the base call below.
|
||||
isStrong.BindValueChanged(_ => Scheduler.AddOnce(RestorePieceState));
|
||||
|
||||
base.OnApply();
|
||||
isStrong.BindTo(HitObject.IsStrongBindable);
|
||||
}
|
||||
|
||||
protected override void OnFree()
|
||||
|
Loading…
Reference in New Issue
Block a user