mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 00:09:55 +09:00
Update volume control logic to use key bindings
Fixes them not working at all, too.
This commit is contained in:
@ -3,11 +3,11 @@
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Input;
|
||||
using osu.Framework.Threading;
|
||||
using OpenTK;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Input.Bindings;
|
||||
|
||||
namespace osu.Game.Graphics.UserInterface.Volume
|
||||
{
|
||||
@ -64,15 +64,25 @@ namespace osu.Game.Graphics.UserInterface.Volume
|
||||
volumeMeterMusic.Bindable.ValueChanged -= volumeChanged;
|
||||
}
|
||||
|
||||
public void Adjust(InputState state)
|
||||
public bool Adjust(GlobalAction action)
|
||||
{
|
||||
if (State == Visibility.Hidden)
|
||||
switch (action)
|
||||
{
|
||||
Show();
|
||||
return;
|
||||
case GlobalAction.DecreaseVolume:
|
||||
if (State == Visibility.Hidden)
|
||||
Show();
|
||||
else
|
||||
volumeMeterMaster.Decrease();
|
||||
return true;
|
||||
case GlobalAction.IncreaseVolume:
|
||||
if (State == Visibility.Hidden)
|
||||
Show();
|
||||
else
|
||||
volumeMeterMaster.Increase();
|
||||
return true;
|
||||
}
|
||||
|
||||
volumeMeterMaster.TriggerOnWheel(state);
|
||||
return false;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
|
Reference in New Issue
Block a user