mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Change volume control mouse wheel behaviour to not gain full-screen focus.
This commit is contained in:
@ -22,8 +22,6 @@ namespace osu.Game.Graphics.UserInterface.Volume
|
|||||||
private FlowContainer content;
|
private FlowContainer content;
|
||||||
protected override Container<Drawable> Content => content;
|
protected override Container<Drawable> Content => content;
|
||||||
|
|
||||||
public override bool Contains(Vector2 screenSpacePos) => true;
|
|
||||||
|
|
||||||
private void volumeChanged(object sender, EventArgs e)
|
private void volumeChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Show();
|
Show();
|
||||||
@ -70,13 +68,15 @@ namespace osu.Game.Graphics.UserInterface.Volume
|
|||||||
base.Dispose(isDisposing);
|
base.Dispose(isDisposing);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnWheel(InputState state)
|
public void Adjust(InputState state)
|
||||||
{
|
{
|
||||||
if (!IsVisible)
|
if (!IsVisible)
|
||||||
return false;
|
{
|
||||||
|
Show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
volumeMeterMaster.TriggerWheel(state);
|
volumeMeterMaster.TriggerWheel(state);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ScheduledDelegate popOutDelegate;
|
ScheduledDelegate popOutDelegate;
|
||||||
|
@ -12,11 +12,11 @@ namespace osu.Game.Graphics.UserInterface.Volume
|
|||||||
{
|
{
|
||||||
class VolumeControlReceptor : Container
|
class VolumeControlReceptor : Container
|
||||||
{
|
{
|
||||||
public Action ActivateRequested;
|
public Action<InputState> ActionRequested;
|
||||||
|
|
||||||
protected override bool OnWheel(InputState state)
|
protected override bool OnWheel(InputState state)
|
||||||
{
|
{
|
||||||
ActivateRequested?.Invoke();
|
ActionRequested?.Invoke(state);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ namespace osu.Game.Graphics.UserInterface.Volume
|
|||||||
{
|
{
|
||||||
case Key.Up:
|
case Key.Up:
|
||||||
case Key.Down:
|
case Key.Down:
|
||||||
ActivateRequested?.Invoke();
|
ActionRequested?.Invoke(state);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ namespace osu.Game
|
|||||||
new VolumeControlReceptor
|
new VolumeControlReceptor
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
ActivateRequested = delegate { volume.Show(); }
|
ActionRequested = delegate(InputState state) { volume.Adjust(state); }
|
||||||
},
|
},
|
||||||
mainContent = new Container
|
mainContent = new Container
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user