Set up flow for switching between hotkey styles

This commit is contained in:
Bartłomiej Dach
2022-06-21 13:10:22 +02:00
parent 5abd8a07d2
commit 658f5341c7
4 changed files with 35 additions and 6 deletions

View File

@ -13,14 +13,16 @@ namespace osu.Game.Overlays.Mods.Input
/// <summary>
/// Creates an appropriate <see cref="IModHotkeyHandler"/> for the given <paramref name="modType"/>.
/// </summary>
public static IModHotkeyHandler Create(ModType modType)
public static IModHotkeyHandler Create(ModType modType, ModSelectHotkeyStyle style)
{
switch (modType)
{
case ModType.DifficultyReduction:
case ModType.DifficultyIncrease:
case ModType.Automation:
return SequentialModHotkeyHandler.Create(modType);
return style == ModSelectHotkeyStyle.Sequential
? (IModHotkeyHandler)SequentialModHotkeyHandler.Create(modType)
: new ClassicModHotkeyHandler();
default:
return new NoopModHotkeyHandler();