Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix volume adjust key repeat not working as expected #31282

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
Comment on lines +1433 to +1435
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this block duplicated now? another copy of it is still there lower down

osu/osu.Game/OsuGame.cs

Lines 1447 to 1449 in e752531

case GlobalAction.DecreaseVolume:
case GlobalAction.IncreaseVolume:
return volume.Adjust(e.Action);

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oversight from lack of self checks for sure

}

// 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
Loading