mirror of
https://github.com/osukey/osukey.git
synced 2025-05-21 21:47:31 +09:00
Make SelectionHandler
abstract to ensure things get implemented
This commit is contained in:
parent
f586bc46e6
commit
dd3d8e5d03
@ -182,8 +182,7 @@ namespace osu.Game.Rulesets.Edit
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Construct a relevant blueprint container. This will manage hitobject selection/placement input handling and display logic.
|
/// Construct a relevant blueprint container. This will manage hitobject selection/placement input handling and display logic.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected virtual ComposeBlueprintContainer CreateBlueprintContainer()
|
protected virtual ComposeBlueprintContainer CreateBlueprintContainer() => new ComposeBlueprintContainer(this);
|
||||||
=> new ComposeBlueprintContainer(this);
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Construct a drawable ruleset for the provided ruleset.
|
/// Construct a drawable ruleset for the provided ruleset.
|
||||||
|
@ -67,7 +67,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a <see cref="Components.SelectionHandler{T}"/> which outlines <see cref="DrawableHitObject"/>s and handles movement of selections.
|
/// Creates a <see cref="Components.SelectionHandler{T}"/> which outlines <see cref="DrawableHitObject"/>s and handles movement of selections.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected virtual SelectionHandler<T> CreateSelectionHandler() => new SelectionHandler<T>();
|
protected abstract SelectionHandler<T> CreateSelectionHandler();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a <see cref="SelectionBlueprint{T}"/> for a specific <see cref="DrawableHitObject"/>.
|
/// Creates a <see cref="SelectionBlueprint{T}"/> for a specific <see cref="DrawableHitObject"/>.
|
||||||
|
@ -135,6 +135,8 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
|
|
||||||
protected override Container<SelectionBlueprint<HitObject>> CreateSelectionBlueprintContainer() => new HitObjectOrderedSelectionContainer { RelativeSizeAxes = Axes.Both };
|
protected override Container<SelectionBlueprint<HitObject>> CreateSelectionBlueprintContainer() => new HitObjectOrderedSelectionContainer { RelativeSizeAxes = Axes.Both };
|
||||||
|
|
||||||
|
protected override SelectionHandler<HitObject> CreateSelectionHandler() => new EditorSelectionHandler();
|
||||||
|
|
||||||
protected override void SelectAll()
|
protected override void SelectAll()
|
||||||
{
|
{
|
||||||
Composer.Playfield.KeepAllAlive();
|
Composer.Playfield.KeepAllAlive();
|
||||||
|
@ -101,11 +101,11 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
protected virtual void UpdateTernaryStates()
|
protected virtual void UpdateTernaryStates()
|
||||||
{
|
{
|
||||||
SelectionNewComboState.Value = GetStateFromSelection(EditorBeatmap.SelectedHitObjects.OfType<IHasComboInformation>(), h => h.NewCombo);
|
SelectionNewComboState.Value = GetStateFromSelection(SelectedItems.OfType<IHasComboInformation>(), h => h.NewCombo);
|
||||||
|
|
||||||
foreach (var (sampleName, bindable) in SelectionSampleStates)
|
foreach (var (sampleName, bindable) in SelectionSampleStates)
|
||||||
{
|
{
|
||||||
bindable.Value = GetStateFromSelection(EditorBeatmap.SelectedHitObjects, h => h.Samples.Any(s => s.Name == sampleName));
|
bindable.Value = GetStateFromSelection(SelectedItems, h => h.Samples.Any(s => s.Name == sampleName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A component which outlines <see cref="DrawableHitObject"/>s and handles movement of selections.
|
/// A component which outlines <see cref="DrawableHitObject"/>s and handles movement of selections.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class SelectionHandler<T> : CompositeDrawable, IKeyBindingHandler<PlatformAction>
|
public abstract class SelectionHandler<T> : CompositeDrawable, IKeyBindingHandler<PlatformAction>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The currently selected blueprints.
|
/// The currently selected blueprints.
|
||||||
@ -47,7 +47,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
[Resolved(CanBeNull = true)]
|
[Resolved(CanBeNull = true)]
|
||||||
protected IEditorChangeHandler ChangeHandler { get; private set; }
|
protected IEditorChangeHandler ChangeHandler { get; private set; }
|
||||||
|
|
||||||
public SelectionHandler()
|
protected SelectionHandler()
|
||||||
{
|
{
|
||||||
selectedBlueprints = new List<SelectionBlueprint<T>>();
|
selectedBlueprints = new List<SelectionBlueprint<T>>();
|
||||||
|
|
||||||
@ -265,9 +265,11 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
DeleteSelected();
|
DeleteSelected();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void DeleteItems(IEnumerable<T> items)
|
/// <summary>
|
||||||
{
|
/// Called whenever the deletion of items has been requested.
|
||||||
}
|
/// </summary>
|
||||||
|
/// <param name="items">The items to be deleted.</param>
|
||||||
|
protected abstract void DeleteItems(IEnumerable<T> items);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Ensure the blueprint is in a selected state.
|
/// Ensure the blueprint is in a selected state.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user