2023-06-23 01:37:25 +09:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
2019-01-24 17:43:03 +09:00
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2018-05-23 17:37:39 +09:00
|
|
|
|
using osu.Framework.Allocation;
|
2021-11-08 14:54:31 +01:00
|
|
|
|
using osu.Framework.Bindables;
|
2018-04-13 18:19:50 +09:00
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2021-08-28 18:49:24 +02:00
|
|
|
|
using osu.Framework.Graphics.Cursor;
|
2024-05-24 10:24:50 +02:00
|
|
|
|
using osu.Framework.Screens;
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2018-11-06 18:28:22 +09:00
|
|
|
|
namespace osu.Game.Screens.Edit
|
2018-04-13 18:19:50 +09:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2019-10-09 16:04:58 +09:00
|
|
|
|
/// TODO: eventually make this inherit Screen and add a local screen stack inside the Editor.
|
2018-04-13 18:19:50 +09:00
|
|
|
|
/// </summary>
|
2022-11-24 14:32:20 +09:00
|
|
|
|
public abstract partial class EditorScreen : VisibilityContainer
|
2018-04-13 18:19:50 +09:00
|
|
|
|
{
|
2019-12-27 19:46:33 +09:00
|
|
|
|
[Resolved]
|
2023-06-23 01:37:25 +09:00
|
|
|
|
protected EditorBeatmap EditorBeatmap { get; private set; } = null!;
|
2019-12-27 19:46:33 +09:00
|
|
|
|
|
2018-04-13 18:19:50 +09:00
|
|
|
|
protected override Container<Drawable> Content => content;
|
|
|
|
|
private readonly Container content;
|
|
|
|
|
|
2020-09-24 17:03:54 +09:00
|
|
|
|
public readonly EditorScreenMode Type;
|
|
|
|
|
|
|
|
|
|
protected EditorScreen(EditorScreenMode type)
|
2018-04-13 18:19:50 +09:00
|
|
|
|
{
|
2020-09-24 17:03:54 +09:00
|
|
|
|
Type = type;
|
|
|
|
|
|
2018-04-13 18:19:50 +09:00
|
|
|
|
Anchor = Anchor.Centre;
|
|
|
|
|
Origin = Anchor.Centre;
|
|
|
|
|
RelativeSizeAxes = Axes.Both;
|
|
|
|
|
|
2021-08-28 18:49:24 +02:00
|
|
|
|
InternalChild = content = new PopoverContainer { RelativeSizeAxes = Axes.Both };
|
2018-04-13 18:19:50 +09:00
|
|
|
|
}
|
|
|
|
|
|
2022-05-24 17:23:42 +09:00
|
|
|
|
protected override void PopIn() => this.FadeIn();
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2022-05-24 17:23:42 +09:00
|
|
|
|
protected override void PopOut() => this.FadeOut();
|
2021-11-08 14:24:39 +01:00
|
|
|
|
|
2024-05-24 10:24:50 +02:00
|
|
|
|
public virtual void OnExiting(ScreenExitEvent e)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-08 14:24:39 +01:00
|
|
|
|
#region Clipboard operations
|
|
|
|
|
|
2021-11-08 14:54:31 +01:00
|
|
|
|
public BindableBool CanCut { get; } = new BindableBool();
|
|
|
|
|
|
2021-11-08 14:24:39 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Performs a "cut to clipboard" operation appropriate for the given screen.
|
|
|
|
|
/// </summary>
|
2023-07-09 18:21:43 +02:00
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Implementors are responsible for checking <see cref="CanCut"/> themselves.
|
|
|
|
|
/// </remarks>
|
|
|
|
|
public virtual void Cut()
|
2021-11-08 14:54:31 +01:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public BindableBool CanCopy { get; } = new BindableBool();
|
|
|
|
|
|
2021-11-08 14:24:39 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Performs a "copy to clipboard" operation appropriate for the given screen.
|
|
|
|
|
/// </summary>
|
2023-07-09 18:21:43 +02:00
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Implementors are responsible for checking <see cref="CanCopy"/> themselves.
|
|
|
|
|
/// </remarks>
|
2021-11-08 14:24:39 +01:00
|
|
|
|
public virtual void Copy()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-08 14:54:31 +01:00
|
|
|
|
public BindableBool CanPaste { get; } = new BindableBool();
|
|
|
|
|
|
2021-11-08 14:24:39 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Performs a "paste from clipboard" operation appropriate for the given screen.
|
|
|
|
|
/// </summary>
|
2023-07-09 18:21:43 +02:00
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Implementors are responsible for checking <see cref="CanPaste"/> themselves.
|
|
|
|
|
/// </remarks>
|
2021-11-08 14:24:39 +01:00
|
|
|
|
public virtual void Paste()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
2018-04-13 18:19:50 +09:00
|
|
|
|
}
|
|
|
|
|
}
|