mirror of
https://github.com/ppy/osu
synced 2025-01-08 07:10:01 +00:00
Make skin editor clipboard shared between screens and skins to allow moving elements over
This commit is contained in:
parent
bc83b0c264
commit
925deb7ca5
@ -49,9 +49,6 @@ namespace osu.Game.Overlays.SkinEditor
|
|||||||
|
|
||||||
private Bindable<Skin> currentSkin = null!;
|
private Bindable<Skin> currentSkin = null!;
|
||||||
|
|
||||||
[Cached]
|
|
||||||
public readonly EditorClipboard Clipboard = new EditorClipboard();
|
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private OsuGame? game { get; set; }
|
private OsuGame? game { get; set; }
|
||||||
|
|
||||||
@ -64,6 +61,9 @@ namespace osu.Game.Overlays.SkinEditor
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private RealmAccess realm { get; set; } = null!;
|
private RealmAccess realm { get; set; } = null!;
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private EditorClipboard clipboard { get; set; } = null!;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private SkinEditorOverlay? skinEditorOverlay { get; set; }
|
private SkinEditorOverlay? skinEditorOverlay { get; set; }
|
||||||
|
|
||||||
@ -232,7 +232,7 @@ namespace osu.Game.Overlays.SkinEditor
|
|||||||
canCopy.Value = canCut.Value = SelectedComponents.Any();
|
canCopy.Value = canCut.Value = SelectedComponents.Any();
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
Clipboard.Content.BindValueChanged(content => canPaste.Value = !string.IsNullOrEmpty(content.NewValue), true);
|
clipboard.Content.BindValueChanged(content => canPaste.Value = !string.IsNullOrEmpty(content.NewValue), true);
|
||||||
|
|
||||||
Show();
|
Show();
|
||||||
|
|
||||||
@ -414,7 +414,7 @@ namespace osu.Game.Overlays.SkinEditor
|
|||||||
|
|
||||||
protected void Copy()
|
protected void Copy()
|
||||||
{
|
{
|
||||||
Clipboard.Content.Value = JsonConvert.SerializeObject(SelectedComponents.Cast<Drawable>().Select(s => s.CreateSerialisedInfo()).ToArray());
|
clipboard.Content.Value = JsonConvert.SerializeObject(SelectedComponents.Cast<Drawable>().Select(s => s.CreateSerialisedInfo()).ToArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void Clone()
|
protected void Clone()
|
||||||
|
@ -11,6 +11,7 @@ using osu.Framework.Input.Events;
|
|||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Input.Bindings;
|
using osu.Game.Input.Bindings;
|
||||||
using osu.Game.Screens;
|
using osu.Game.Screens;
|
||||||
|
using osu.Game.Screens.Edit;
|
||||||
using osu.Game.Screens.Edit.Components;
|
using osu.Game.Screens.Edit.Components;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
@ -28,6 +29,9 @@ namespace osu.Game.Overlays.SkinEditor
|
|||||||
|
|
||||||
private SkinEditor? skinEditor;
|
private SkinEditor? skinEditor;
|
||||||
|
|
||||||
|
[Cached]
|
||||||
|
public readonly EditorClipboard Clipboard = new EditorClipboard();
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private OsuGame game { get; set; } = null!;
|
private OsuGame game { get; set; } = null!;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user