mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Fix volume meter requesting focus for any action
This commit is contained in:
@ -27,8 +27,6 @@ namespace osu.Game.Overlays.Volume
|
|||||||
{
|
{
|
||||||
public class VolumeMeter : Container, IKeyBindingHandler<GlobalAction>
|
public class VolumeMeter : Container, IKeyBindingHandler<GlobalAction>
|
||||||
{
|
{
|
||||||
private bool isFocused = true;
|
|
||||||
|
|
||||||
private CircularProgress volumeCircle;
|
private CircularProgress volumeCircle;
|
||||||
private CircularProgress volumeCircleGlow;
|
private CircularProgress volumeCircleGlow;
|
||||||
|
|
||||||
@ -316,13 +314,11 @@ namespace osu.Game.Overlays.Volume
|
|||||||
|
|
||||||
public void Focus()
|
public void Focus()
|
||||||
{
|
{
|
||||||
isFocused = true;
|
|
||||||
this.ScaleTo(1.04f, transition_length, Easing.OutExpo);
|
this.ScaleTo(1.04f, transition_length, Easing.OutExpo);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Unfocus()
|
public void Unfocus()
|
||||||
{
|
{
|
||||||
isFocused = false;
|
|
||||||
this.ScaleTo(1f, transition_length, Easing.OutExpo);
|
this.ScaleTo(1f, transition_length, Easing.OutExpo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -341,17 +337,15 @@ namespace osu.Game.Overlays.Volume
|
|||||||
if (!IsHovered)
|
if (!IsHovered)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Grab back focus is UP/DOWN input is directed at this meter
|
|
||||||
if (!isFocused)
|
|
||||||
RequestFocus?.Invoke(this);
|
|
||||||
|
|
||||||
switch (action)
|
switch (action)
|
||||||
{
|
{
|
||||||
case GlobalAction.SelectPrevious:
|
case GlobalAction.SelectPrevious:
|
||||||
|
RequestFocus?.Invoke(this);
|
||||||
adjust(1, false);
|
adjust(1, false);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case GlobalAction.SelectNext:
|
case GlobalAction.SelectNext:
|
||||||
|
RequestFocus?.Invoke(this);
|
||||||
adjust(-1, false);
|
adjust(-1, false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user