mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 05:07:28 +08:00
Make selected mania hitobjects always alive
This commit is contained in:
parent
7229559cf7
commit
5d6a438f98
@ -6,6 +6,7 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
using osu.Framework.Timing;
|
using osu.Framework.Timing;
|
||||||
using osu.Game.Rulesets.Edit;
|
using osu.Game.Rulesets.Edit;
|
||||||
|
using osu.Game.Rulesets.Mania.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.UI.Scrolling;
|
using osu.Game.Rulesets.UI.Scrolling;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
@ -14,6 +15,8 @@ namespace osu.Game.Rulesets.Mania.Edit.Blueprints
|
|||||||
{
|
{
|
||||||
public class ManiaSelectionBlueprint : SelectionBlueprint
|
public class ManiaSelectionBlueprint : SelectionBlueprint
|
||||||
{
|
{
|
||||||
|
protected new DrawableManiaHitObject HitObject => (DrawableManiaHitObject)base.HitObject;
|
||||||
|
|
||||||
protected IClock EditorClock { get; private set; }
|
protected IClock EditorClock { get; private set; }
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
@ -60,5 +63,17 @@ namespace osu.Game.Rulesets.Mania.Edit.Blueprints
|
|||||||
scrollingInfo.TimeRange.Value,
|
scrollingInfo.TimeRange.Value,
|
||||||
objectParent.DrawHeight);
|
objectParent.DrawHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void Show()
|
||||||
|
{
|
||||||
|
HitObject.AlwaysAlive = true;
|
||||||
|
base.Show();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Hide()
|
||||||
|
{
|
||||||
|
HitObject.AlwaysAlive = false;
|
||||||
|
base.Hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,11 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
|||||||
{
|
{
|
||||||
public abstract class DrawableManiaHitObject : DrawableHitObject<ManiaHitObject>
|
public abstract class DrawableManiaHitObject : DrawableHitObject<ManiaHitObject>
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Whether this <see cref="DrawableManiaHitObject"/> should always remain alive.
|
||||||
|
/// </summary>
|
||||||
|
internal bool AlwaysAlive;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The <see cref="ManiaAction"/> which causes this <see cref="DrawableManiaHitObject{TObject}"/> to be hit.
|
/// The <see cref="ManiaAction"/> which causes this <see cref="DrawableManiaHitObject{TObject}"/> to be hit.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -34,6 +39,8 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
|||||||
Direction.BindValueChanged(OnDirectionChanged, true);
|
Direction.BindValueChanged(OnDirectionChanged, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override bool ShouldBeAlive => AlwaysAlive || base.ShouldBeAlive;
|
||||||
|
|
||||||
protected virtual void OnDirectionChanged(ScrollingDirection direction)
|
protected virtual void OnDirectionChanged(ScrollingDirection direction)
|
||||||
{
|
{
|
||||||
Anchor = Origin = direction == ScrollingDirection.Up ? Anchor.TopCentre : Anchor.BottomCentre;
|
Anchor = Origin = direction == ScrollingDirection.Up ? Anchor.TopCentre : Anchor.BottomCentre;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user