mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Update in-line with framework IsActive changes
This commit is contained in:
@ -120,6 +120,8 @@ namespace osu.Game
|
|||||||
forwardLoggedErrorsToNotifications();
|
forwardLoggedErrorsToNotifications();
|
||||||
|
|
||||||
RavenLogger = new RavenLogger(this);
|
RavenLogger = new RavenLogger(this);
|
||||||
|
|
||||||
|
IsActive.BindValueChanged(updateActiveState);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ToggleSettings() => settings.ToggleVisibility();
|
public void ToggleSettings() => settings.ToggleVisibility();
|
||||||
@ -674,16 +676,12 @@ namespace osu.Game
|
|||||||
|
|
||||||
private readonly BindableDouble inactiveVolumeAdjust = new BindableDouble();
|
private readonly BindableDouble inactiveVolumeAdjust = new BindableDouble();
|
||||||
|
|
||||||
protected override void OnDeactivated()
|
private void updateActiveState(bool isActive)
|
||||||
{
|
{
|
||||||
base.OnDeactivated();
|
if (isActive)
|
||||||
Audio.AddAdjustment(AdjustableProperty.Volume, inactiveVolumeAdjust);
|
Audio.RemoveAdjustment(AdjustableProperty.Volume, inactiveVolumeAdjust);
|
||||||
}
|
else
|
||||||
|
Audio.AddAdjustment(AdjustableProperty.Volume, inactiveVolumeAdjust);
|
||||||
protected override void OnActivated()
|
|
||||||
{
|
|
||||||
base.OnActivated();
|
|
||||||
Audio.RemoveAdjustment(AdjustableProperty.Volume, inactiveVolumeAdjust);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool OnReleased(GlobalAction action) => false;
|
public bool OnReleased(GlobalAction action) => false;
|
||||||
|
@ -116,7 +116,7 @@ namespace osu.Game.Screens.Play
|
|||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
// eagerly pause when we lose window focus (if we are locally playing).
|
// eagerly pause when we lose window focus (if we are locally playing).
|
||||||
if (!game.IsActive && CanPause)
|
if (!game.IsActive.Value && CanPause)
|
||||||
Pause();
|
Pause();
|
||||||
|
|
||||||
if (!IsPaused)
|
if (!IsPaused)
|
||||||
|
Reference in New Issue
Block a user