mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 21:43:21 +08:00
Merge pull request #10204 from peppy/add-editor-keybindings
Add editor key bindings to switch between screens
This commit is contained in:
commit
8562020eba
@ -21,7 +21,7 @@ namespace osu.Game.Input.Bindings
|
|||||||
handler = game;
|
handler = game;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override IEnumerable<KeyBinding> DefaultKeyBindings => GlobalKeyBindings.Concat(InGameKeyBindings).Concat(AudioControlKeyBindings);
|
public override IEnumerable<KeyBinding> DefaultKeyBindings => GlobalKeyBindings.Concat(InGameKeyBindings).Concat(AudioControlKeyBindings).Concat(EditorKeyBindings);
|
||||||
|
|
||||||
public IEnumerable<KeyBinding> GlobalKeyBindings => new[]
|
public IEnumerable<KeyBinding> GlobalKeyBindings => new[]
|
||||||
{
|
{
|
||||||
@ -50,6 +50,14 @@ namespace osu.Game.Input.Bindings
|
|||||||
new KeyBinding(InputKey.KeypadEnter, GlobalAction.Select),
|
new KeyBinding(InputKey.KeypadEnter, GlobalAction.Select),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public IEnumerable<KeyBinding> EditorKeyBindings => new[]
|
||||||
|
{
|
||||||
|
new KeyBinding(new[] { InputKey.F1 }, GlobalAction.EditorComposeMode),
|
||||||
|
new KeyBinding(new[] { InputKey.F2 }, GlobalAction.EditorDesignMode),
|
||||||
|
new KeyBinding(new[] { InputKey.F3 }, GlobalAction.EditorTimingMode),
|
||||||
|
new KeyBinding(new[] { InputKey.F4 }, GlobalAction.EditorSetupMode),
|
||||||
|
};
|
||||||
|
|
||||||
public IEnumerable<KeyBinding> InGameKeyBindings => new[]
|
public IEnumerable<KeyBinding> InGameKeyBindings => new[]
|
||||||
{
|
{
|
||||||
new KeyBinding(InputKey.Space, GlobalAction.SkipCutscene),
|
new KeyBinding(InputKey.Space, GlobalAction.SkipCutscene),
|
||||||
@ -68,7 +76,7 @@ namespace osu.Game.Input.Bindings
|
|||||||
new KeyBinding(new[] { InputKey.Alt, InputKey.Down }, GlobalAction.DecreaseVolume),
|
new KeyBinding(new[] { InputKey.Alt, InputKey.Down }, GlobalAction.DecreaseVolume),
|
||||||
new KeyBinding(new[] { InputKey.Alt, InputKey.MouseWheelDown }, GlobalAction.DecreaseVolume),
|
new KeyBinding(new[] { InputKey.Alt, InputKey.MouseWheelDown }, GlobalAction.DecreaseVolume),
|
||||||
|
|
||||||
new KeyBinding(InputKey.F4, GlobalAction.ToggleMute),
|
new KeyBinding(new[] { InputKey.Control, InputKey.F4 }, GlobalAction.ToggleMute),
|
||||||
|
|
||||||
new KeyBinding(InputKey.TrackPrevious, GlobalAction.MusicPrev),
|
new KeyBinding(InputKey.TrackPrevious, GlobalAction.MusicPrev),
|
||||||
new KeyBinding(InputKey.F1, GlobalAction.MusicPrev),
|
new KeyBinding(InputKey.F1, GlobalAction.MusicPrev),
|
||||||
@ -139,7 +147,7 @@ namespace osu.Game.Input.Bindings
|
|||||||
[Description("Quick exit (Hold)")]
|
[Description("Quick exit (Hold)")]
|
||||||
QuickExit,
|
QuickExit,
|
||||||
|
|
||||||
// Game-wide beatmap msi ccotolle keybindings
|
// Game-wide beatmap music controller keybindings
|
||||||
[Description("Next track")]
|
[Description("Next track")]
|
||||||
MusicNext,
|
MusicNext,
|
||||||
|
|
||||||
@ -166,5 +174,18 @@ namespace osu.Game.Input.Bindings
|
|||||||
|
|
||||||
[Description("Pause")]
|
[Description("Pause")]
|
||||||
PauseGameplay,
|
PauseGameplay,
|
||||||
|
|
||||||
|
// Editor
|
||||||
|
[Description("Setup Mode")]
|
||||||
|
EditorSetupMode,
|
||||||
|
|
||||||
|
[Description("Compose Mode")]
|
||||||
|
EditorComposeMode,
|
||||||
|
|
||||||
|
[Description("Design Mode")]
|
||||||
|
EditorDesignMode,
|
||||||
|
|
||||||
|
[Description("Timing Mode")]
|
||||||
|
EditorTimingMode,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@ namespace osu.Game.Overlays.KeyBinding
|
|||||||
Add(new DefaultBindingsSubsection(manager));
|
Add(new DefaultBindingsSubsection(manager));
|
||||||
Add(new AudioControlKeyBindingsSubsection(manager));
|
Add(new AudioControlKeyBindingsSubsection(manager));
|
||||||
Add(new InGameKeyBindingsSubsection(manager));
|
Add(new InGameKeyBindingsSubsection(manager));
|
||||||
|
Add(new EditorKeyBindingsSubsection(manager));
|
||||||
}
|
}
|
||||||
|
|
||||||
private class DefaultBindingsSubsection : KeyBindingsSubsection
|
private class DefaultBindingsSubsection : KeyBindingsSubsection
|
||||||
@ -56,5 +57,16 @@ namespace osu.Game.Overlays.KeyBinding
|
|||||||
Defaults = manager.AudioControlKeyBindings;
|
Defaults = manager.AudioControlKeyBindings;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class EditorKeyBindingsSubsection : KeyBindingsSubsection
|
||||||
|
{
|
||||||
|
protected override string Header => "Editor";
|
||||||
|
|
||||||
|
public EditorKeyBindingsSubsection(GlobalActionContainer manager)
|
||||||
|
: base(null)
|
||||||
|
{
|
||||||
|
Defaults = manager.EditorKeyBindings;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,6 +79,8 @@ namespace osu.Game.Screens.Edit
|
|||||||
private EditorBeatmap editorBeatmap;
|
private EditorBeatmap editorBeatmap;
|
||||||
private EditorChangeHandler changeHandler;
|
private EditorChangeHandler changeHandler;
|
||||||
|
|
||||||
|
private EditorMenuBar menuBar;
|
||||||
|
|
||||||
private DependencyContainer dependencies;
|
private DependencyContainer dependencies;
|
||||||
|
|
||||||
protected override UserActivity InitialActivity => new UserActivity.Editing(Beatmap.Value.BeatmapInfo);
|
protected override UserActivity InitialActivity => new UserActivity.Editing(Beatmap.Value.BeatmapInfo);
|
||||||
@ -133,8 +135,6 @@ namespace osu.Game.Screens.Edit
|
|||||||
|
|
||||||
updateLastSavedHash();
|
updateLastSavedHash();
|
||||||
|
|
||||||
EditorMenuBar menuBar;
|
|
||||||
|
|
||||||
OsuMenuItem undoMenuItem;
|
OsuMenuItem undoMenuItem;
|
||||||
OsuMenuItem redoMenuItem;
|
OsuMenuItem redoMenuItem;
|
||||||
|
|
||||||
@ -374,14 +374,32 @@ namespace osu.Game.Screens.Edit
|
|||||||
|
|
||||||
public bool OnPressed(GlobalAction action)
|
public bool OnPressed(GlobalAction action)
|
||||||
{
|
{
|
||||||
if (action == GlobalAction.Back)
|
switch (action)
|
||||||
{
|
{
|
||||||
// as we don't want to display the back button, manual handling of exit action is required.
|
case GlobalAction.Back:
|
||||||
this.Exit();
|
// as we don't want to display the back button, manual handling of exit action is required.
|
||||||
return true;
|
this.Exit();
|
||||||
}
|
return true;
|
||||||
|
|
||||||
return false;
|
case GlobalAction.EditorComposeMode:
|
||||||
|
menuBar.Mode.Value = EditorScreenMode.Compose;
|
||||||
|
return true;
|
||||||
|
|
||||||
|
case GlobalAction.EditorDesignMode:
|
||||||
|
menuBar.Mode.Value = EditorScreenMode.Design;
|
||||||
|
return true;
|
||||||
|
|
||||||
|
case GlobalAction.EditorTimingMode:
|
||||||
|
menuBar.Mode.Value = EditorScreenMode.Timing;
|
||||||
|
return true;
|
||||||
|
|
||||||
|
case GlobalAction.EditorSetupMode:
|
||||||
|
menuBar.Mode.Value = EditorScreenMode.SongSetup;
|
||||||
|
return true;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnReleased(GlobalAction action)
|
public void OnReleased(GlobalAction action)
|
||||||
|
Loading…
Reference in New Issue
Block a user