mirror of
https://github.com/ppy/osu.git
synced 2025-02-22 14:02:55 +08:00
Merge pull request #31282 from peppy/fix-volume-key-repeat
Fix volume adjust key repeat not working as expected
This commit is contained in:
commit
f18114d2fb
@ -1428,24 +1428,25 @@ namespace osu.Game
|
|||||||
|
|
||||||
public bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
|
public bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
|
||||||
{
|
{
|
||||||
if (e.Repeat)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (introScreen == null) return false;
|
|
||||||
|
|
||||||
switch (e.Action)
|
switch (e.Action)
|
||||||
{
|
{
|
||||||
case GlobalAction.DecreaseVolume:
|
case GlobalAction.DecreaseVolume:
|
||||||
case GlobalAction.IncreaseVolume:
|
case GlobalAction.IncreaseVolume:
|
||||||
return volume.Adjust(e.Action);
|
return volume.Adjust(e.Action);
|
||||||
|
}
|
||||||
|
|
||||||
|
// All actions below this point don't allow key repeat.
|
||||||
|
if (e.Repeat)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Wait until we're loaded at least to the intro before allowing various interactions.
|
||||||
|
if (introScreen == null) return false;
|
||||||
|
|
||||||
|
switch (e.Action)
|
||||||
|
{
|
||||||
case GlobalAction.ToggleMute:
|
case GlobalAction.ToggleMute:
|
||||||
case GlobalAction.NextVolumeMeter:
|
case GlobalAction.NextVolumeMeter:
|
||||||
case GlobalAction.PreviousVolumeMeter:
|
case GlobalAction.PreviousVolumeMeter:
|
||||||
|
|
||||||
if (e.Repeat)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return volume.Adjust(e.Action);
|
return volume.Adjust(e.Action);
|
||||||
|
|
||||||
case GlobalAction.ToggleFPSDisplay:
|
case GlobalAction.ToggleFPSDisplay:
|
||||||
|
Loading…
Reference in New Issue
Block a user