1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-21 18:02:55 +08:00
osu-lazer/osu.Game/Screens/Edit/EditorScreen.cs

86 lines
2.5 KiB
C#
Raw Normal View History

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