mirror of
https://github.com/ppy/osu.git
synced 2025-03-13 08:57:24 +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:
commit
869ea724f0
@ -14,22 +14,8 @@ namespace osu.Game.Overlays.Volume
|
|||||||
public Func<GlobalAction, bool> ActionRequested;
|
public Func<GlobalAction, bool> ActionRequested;
|
||||||
public Func<GlobalAction, float, bool, bool> ScrollActionRequested;
|
public Func<GlobalAction, float, bool, bool> ScrollActionRequested;
|
||||||
|
|
||||||
public bool OnPressed(GlobalAction action)
|
public bool OnPressed(GlobalAction action) =>
|
||||||
{
|
ActionRequested?.Invoke(action) ?? false;
|
||||||
// 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 OnScroll(GlobalAction action, float amount, bool isPrecise) =>
|
public bool OnScroll(GlobalAction action, float amount, bool isPrecise) =>
|
||||||
ScrollActionRequested?.Invoke(action, amount, isPrecise) ?? false;
|
ScrollActionRequested?.Invoke(action, amount, isPrecise) ?? false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user