mirror of
https://github.com/osukey/osukey.git
synced 2025-05-31 02:17:34 +09:00
set text to platform clipboard on copy
This commit is contained in:
parent
891e7aadb6
commit
8046b5a818
@ -21,6 +21,7 @@ using osu.Framework.Screens;
|
|||||||
using osu.Framework.Timing;
|
using osu.Framework.Timing;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
|
using osu.Game.Extensions;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Cursor;
|
using osu.Game.Graphics.Cursor;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
@ -29,6 +30,7 @@ using osu.Game.IO.Serialization;
|
|||||||
using osu.Game.Online.API;
|
using osu.Game.Online.API;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
using osu.Game.Rulesets.Edit;
|
using osu.Game.Rulesets.Edit;
|
||||||
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
using osu.Game.Screens.Edit.Components;
|
using osu.Game.Screens.Edit.Components;
|
||||||
using osu.Game.Screens.Edit.Components.Menus;
|
using osu.Game.Screens.Edit.Components.Menus;
|
||||||
using osu.Game.Screens.Edit.Components.Timelines.Summary;
|
using osu.Game.Screens.Edit.Components.Timelines.Summary;
|
||||||
@ -60,6 +62,9 @@ namespace osu.Game.Screens.Edit
|
|||||||
|
|
||||||
protected bool HasUnsavedChanges => lastSavedHash != changeHandler.CurrentStateHash;
|
protected bool HasUnsavedChanges => lastSavedHash != changeHandler.CurrentStateHash;
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private GameHost host { get; set; }
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private BeatmapManager beatmapManager { get; set; }
|
private BeatmapManager beatmapManager { get; set; }
|
||||||
|
|
||||||
@ -104,7 +109,7 @@ namespace osu.Game.Screens.Edit
|
|||||||
private MusicController music { get; set; }
|
private MusicController music { get; set; }
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours, GameHost host, OsuConfigManager config)
|
private void load(OsuColour colours, OsuConfigManager config)
|
||||||
{
|
{
|
||||||
if (Beatmap.Value is DummyWorkingBeatmap)
|
if (Beatmap.Value is DummyWorkingBeatmap)
|
||||||
{
|
{
|
||||||
@ -542,8 +547,12 @@ namespace osu.Game.Screens.Edit
|
|||||||
protected void Copy()
|
protected void Copy()
|
||||||
{
|
{
|
||||||
if (editorBeatmap.SelectedHitObjects.Count == 0)
|
if (editorBeatmap.SelectedHitObjects.Count == 0)
|
||||||
|
{
|
||||||
|
host.GetClipboard()?.SetText($"{clock.CurrentTime.ToEditorFormattedString()} - ");
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
host.GetClipboard()?.SetText($"{editorBeatmap.SelectedHitObjects.FirstOrDefault().StartTime.ToEditorFormattedString()} ({string.Join(',', editorBeatmap.SelectedHitObjects.Select(h => ((h as IHasComboInformation)?.IndexInCurrentCombo + 1 ?? 0).ToString()))}) - ");
|
||||||
clipboard.Value = new ClipboardContent(editorBeatmap).Serialize();
|
clipboard.Value = new ClipboardContent(editorBeatmap).Serialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user