mirror of
https://github.com/ppy/osu.git
synced 2026-05-18 06:29:52 +08:00
Change CopyUrlToClipboard to CopyStringToClipboard
This commit is contained in:
@@ -89,7 +89,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
if (Link == null) return;
|
||||
|
||||
game?.CopyUrlToClipboard(Link);
|
||||
game?.CopyStringToClipboard(Link);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,9 +45,9 @@ namespace osu.Game.Localisation
|
||||
public static LocalisableString SkinSaved => new TranslatableString(getKey(@"skin_saved"), @"Skin saved");
|
||||
|
||||
/// <summary>
|
||||
/// "Link copied to clipboard"
|
||||
/// "Copied to clipboard"
|
||||
/// </summary>
|
||||
public static LocalisableString UrlCopied => new TranslatableString(getKey(@"url_copied"), @"Link copied to clipboard");
|
||||
public static LocalisableString StringCopied => new TranslatableString(getKey(@"string_copied"), @"Copied to clipboard");
|
||||
|
||||
/// <summary>
|
||||
/// "Speed changed to {0:N2}x"
|
||||
|
||||
+2
-2
@@ -519,10 +519,10 @@ namespace osu.Game
|
||||
}
|
||||
});
|
||||
|
||||
public void CopyUrlToClipboard(string url) => waitForReady(() => onScreenDisplay, _ =>
|
||||
public void CopyStringToClipboard(string url) => waitForReady(() => onScreenDisplay, _ =>
|
||||
{
|
||||
dependencies.Get<Clipboard>().SetText(url);
|
||||
onScreenDisplay.Display(new CopyUrlToast());
|
||||
onScreenDisplay.Display(new CopyStringToast());
|
||||
});
|
||||
|
||||
public void OpenUrlExternally(string url, LinkWarnMode warnMode = LinkWarnMode.Default) => waitForReady(() => externalLinkOpener, _ => externalLinkOpener.OpenUrlExternally(url, warnMode));
|
||||
|
||||
@@ -420,7 +420,7 @@ namespace osu.Game.Overlays.Comments
|
||||
private void copyUrl()
|
||||
{
|
||||
clipboard.SetText($@"{api.Endpoints.APIUrl}/comments/{Comment.Id}");
|
||||
onScreenDisplay?.Display(new CopyUrlToast());
|
||||
onScreenDisplay?.Display(new CopyStringToast());
|
||||
}
|
||||
|
||||
private void toggleReply()
|
||||
|
||||
@@ -5,10 +5,10 @@ using osu.Game.Localisation;
|
||||
|
||||
namespace osu.Game.Overlays.OSD
|
||||
{
|
||||
public partial class CopyUrlToast : Toast
|
||||
public partial class CopyStringToast : Toast
|
||||
{
|
||||
public CopyUrlToast()
|
||||
: base(CommonStrings.General, ToastStrings.UrlCopied, "")
|
||||
public CopyStringToast()
|
||||
: base(CommonStrings.General, ToastStrings.StringCopied, "")
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -355,7 +355,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
||||
{
|
||||
items.AddRange([
|
||||
new OsuMenuItem("View in browser", MenuItemType.Standard, () => game?.OpenUrlExternally(formatRoomUrl(Room.RoomID.Value))),
|
||||
new OsuMenuItem("Copy link", MenuItemType.Standard, () => game?.CopyUrlToClipboard(formatRoomUrl(Room.RoomID.Value)))
|
||||
new OsuMenuItem("Copy link", MenuItemType.Standard, () => game?.CopyStringToClipboard(formatRoomUrl(Room.RoomID.Value)))
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -301,7 +301,7 @@ namespace osu.Game.Screens.Select.Carousel
|
||||
items.Add(new OsuMenuItem("Collections") { Items = collectionItems });
|
||||
|
||||
if (beatmapInfo.GetOnlineURL(api, ruleset.Value) is string url)
|
||||
items.Add(new OsuMenuItem(CommonStrings.CopyLink, MenuItemType.Standard, () => game?.CopyUrlToClipboard(url)));
|
||||
items.Add(new OsuMenuItem(CommonStrings.CopyLink, MenuItemType.Standard, () => game?.CopyStringToClipboard(url)));
|
||||
|
||||
if (manager != null)
|
||||
items.Add(new OsuMenuItem("Mark as played", MenuItemType.Standard, () => manager.MarkPlayed(beatmapInfo)));
|
||||
|
||||
@@ -301,7 +301,7 @@ namespace osu.Game.Screens.Select.Carousel
|
||||
items.Add(new OsuMenuItem("Restore all hidden", MenuItemType.Standard, () => restoreHiddenRequested(beatmapSet)));
|
||||
|
||||
if (beatmapSet.GetOnlineURL(api, ruleset.Value) is string url)
|
||||
items.Add(new OsuMenuItem(CommonStrings.CopyLink, MenuItemType.Standard, () => game?.CopyUrlToClipboard(url)));
|
||||
items.Add(new OsuMenuItem(CommonStrings.CopyLink, MenuItemType.Standard, () => game?.CopyStringToClipboard(url)));
|
||||
|
||||
if (dialogOverlay != null)
|
||||
items.Add(new OsuMenuItem("Delete...", MenuItemType.Destructive, () => dialogOverlay.Push(new BeatmapDeleteDialog(beatmapSet))));
|
||||
|
||||
Reference in New Issue
Block a user