Skip to content

Commit

Permalink
Fix volume adjust key repeat not working as expected
Browse files Browse the repository at this point in the history
Regressed in ppy#31146.

Closes part of ppy#31267.
  • Loading branch information
peppy committed Dec 26, 2024
1 parent 62e536b commit e752531
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions osu.Game/OsuGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1428,9 +1428,18 @@ private T loadComponentSingleFile<T>(T component, Action<Drawable> loadCompleteA

public bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
{
switch (e.Action)
{
case GlobalAction.DecreaseVolume:
case GlobalAction.IncreaseVolume:
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)
Expand All @@ -1442,10 +1451,6 @@ public bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
case GlobalAction.ToggleMute:
case GlobalAction.NextVolumeMeter:
case GlobalAction.PreviousVolumeMeter:

if (e.Repeat)
return true;

return volume.Adjust(e.Action);

case GlobalAction.ToggleFPSDisplay:
Expand Down

0 comments on commit e752531

Please sign in to comment.