mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 08:32:57 +08:00
Adapt to PlatformAction
type change
This commit is contained in:
parent
747c475b95
commit
1bac471b49
@ -129,9 +129,9 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
|
||||
|
||||
public bool OnPressed(PlatformAction action)
|
||||
{
|
||||
switch (action.ActionMethod)
|
||||
switch (action)
|
||||
{
|
||||
case PlatformActionMethod.Delete:
|
||||
case PlatformAction.Delete:
|
||||
return DeleteSelected();
|
||||
}
|
||||
|
||||
|
@ -330,15 +330,15 @@ namespace osu.Game.Tests.Visual.Online
|
||||
InputManager.ReleaseKey(Key.AltLeft);
|
||||
}
|
||||
|
||||
private void pressCloseDocumentKeys() => pressKeysFor(PlatformActionType.DocumentClose);
|
||||
private void pressCloseDocumentKeys() => pressKeysFor(PlatformAction.DocumentClose);
|
||||
|
||||
private void pressNewTabKeys() => pressKeysFor(PlatformActionType.TabNew);
|
||||
private void pressNewTabKeys() => pressKeysFor(PlatformAction.TabNew);
|
||||
|
||||
private void pressRestoreTabKeys() => pressKeysFor(PlatformActionType.TabRestore);
|
||||
private void pressRestoreTabKeys() => pressKeysFor(PlatformAction.TabRestore);
|
||||
|
||||
private void pressKeysFor(PlatformActionType type)
|
||||
private void pressKeysFor(PlatformAction type)
|
||||
{
|
||||
var binding = host.PlatformKeyBindings.First(b => ((PlatformAction)b.Action).ActionType == type);
|
||||
var binding = host.PlatformKeyBindings.First(b => (PlatformAction)b.Action == type);
|
||||
|
||||
foreach (var k in binding.KeyCombination.Keys)
|
||||
InputManager.PressKey((Key)k);
|
||||
|
@ -32,20 +32,15 @@ namespace osu.Game.Graphics.UserInterface
|
||||
|
||||
public override bool OnPressed(PlatformAction action)
|
||||
{
|
||||
switch (action.ActionType)
|
||||
switch (action)
|
||||
{
|
||||
case PlatformActionType.LineEnd:
|
||||
case PlatformActionType.LineStart:
|
||||
return false;
|
||||
|
||||
case PlatformAction.MoveBackwardLine:
|
||||
case PlatformAction.MoveForwardLine:
|
||||
// Shift+delete is handled via PlatformAction on macOS. this is not so useful in the context of a SearchTextBox
|
||||
// as we do not allow arrow key navigation in the first place (ie. the caret should always be at the end of text)
|
||||
// Avoid handling it here to allow other components to potentially consume the shortcut.
|
||||
case PlatformActionType.CharNext:
|
||||
if (action.ActionMethod == PlatformActionMethod.Delete)
|
||||
return false;
|
||||
|
||||
break;
|
||||
case PlatformAction.DeleteForwardChar:
|
||||
return false;
|
||||
}
|
||||
|
||||
return base.OnPressed(action);
|
||||
|
@ -374,17 +374,17 @@ namespace osu.Game.Overlays
|
||||
|
||||
public bool OnPressed(PlatformAction action)
|
||||
{
|
||||
switch (action.ActionType)
|
||||
switch (action)
|
||||
{
|
||||
case PlatformActionType.TabNew:
|
||||
case PlatformAction.TabNew:
|
||||
ChannelTabControl.SelectChannelSelectorTab();
|
||||
return true;
|
||||
|
||||
case PlatformActionType.TabRestore:
|
||||
case PlatformAction.TabRestore:
|
||||
channelManager.JoinLastClosedChannel();
|
||||
return true;
|
||||
|
||||
case PlatformActionType.DocumentClose:
|
||||
case PlatformAction.DocumentClose:
|
||||
channelManager.LeaveChannel(channelManager.CurrentChannel.Value);
|
||||
return true;
|
||||
}
|
||||
|
@ -230,9 +230,9 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
|
||||
public bool OnPressed(PlatformAction action)
|
||||
{
|
||||
switch (action.ActionType)
|
||||
switch (action)
|
||||
{
|
||||
case PlatformActionType.SelectAll:
|
||||
case PlatformAction.SelectAll:
|
||||
SelectAll();
|
||||
return true;
|
||||
}
|
||||
|
@ -139,9 +139,9 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
|
||||
public bool OnPressed(PlatformAction action)
|
||||
{
|
||||
switch (action.ActionMethod)
|
||||
switch (action)
|
||||
{
|
||||
case PlatformActionMethod.Delete:
|
||||
case PlatformAction.Delete:
|
||||
DeleteSelected();
|
||||
return true;
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ namespace osu.Game.Screens.Edit.Compose
|
||||
|
||||
public bool OnPressed(PlatformAction action)
|
||||
{
|
||||
if (action.ActionType == PlatformActionType.Copy)
|
||||
if (action == PlatformAction.Copy)
|
||||
host.GetClipboard().SetText(formatSelectionAsString());
|
||||
|
||||
return false;
|
||||
|
@ -330,29 +330,29 @@ namespace osu.Game.Screens.Edit
|
||||
|
||||
public bool OnPressed(PlatformAction action)
|
||||
{
|
||||
switch (action.ActionType)
|
||||
switch (action)
|
||||
{
|
||||
case PlatformActionType.Cut:
|
||||
case PlatformAction.Cut:
|
||||
Cut();
|
||||
return true;
|
||||
|
||||
case PlatformActionType.Copy:
|
||||
case PlatformAction.Copy:
|
||||
Copy();
|
||||
return true;
|
||||
|
||||
case PlatformActionType.Paste:
|
||||
case PlatformAction.Paste:
|
||||
Paste();
|
||||
return true;
|
||||
|
||||
case PlatformActionType.Undo:
|
||||
case PlatformAction.Undo:
|
||||
Undo();
|
||||
return true;
|
||||
|
||||
case PlatformActionType.Redo:
|
||||
case PlatformAction.Redo:
|
||||
Redo();
|
||||
return true;
|
||||
|
||||
case PlatformActionType.Save:
|
||||
case PlatformAction.Save:
|
||||
Save();
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user