1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-12 22:17:18 +08:00

Merge pull request #8235 from peppy/disable-global-volume-via-select-bindings

Disable adjusting volume via "select next" and "select previous" as fallbacks
This commit is contained in:
Dan Balasescu 2020-03-12 18:02:28 +09:00 committed by GitHub
commit 869ea724f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,22 +14,8 @@ namespace osu.Game.Overlays.Volume
public Func<GlobalAction, bool> ActionRequested;
public Func<GlobalAction, float, bool, bool> ScrollActionRequested;
public bool OnPressed(GlobalAction action)
{
// if nothing else handles selection actions in the game, it's safe to let volume be adjusted.
switch (action)
{
case GlobalAction.SelectPrevious:
action = GlobalAction.IncreaseVolume;
break;
case GlobalAction.SelectNext:
action = GlobalAction.DecreaseVolume;
break;
}
return ActionRequested?.Invoke(action) ?? false;
}
public bool OnPressed(GlobalAction action) =>
ActionRequested?.Invoke(action) ?? false;
public bool OnScroll(GlobalAction action, float amount, bool isPrecise) =>
ScrollActionRequested?.Invoke(action, amount, isPrecise) ?? false;