mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
Make notification only show up once per session
This commit is contained in:
@ -66,6 +66,8 @@ namespace osu.Game.Screens.Play
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private VolumeOverlay volumeOverlay { get; set; }
|
private VolumeOverlay volumeOverlay { get; set; }
|
||||||
|
|
||||||
|
private bool muteWarningShownOnce = false;
|
||||||
|
|
||||||
public PlayerLoader(Func<Player> createPlayer)
|
public PlayerLoader(Func<Player> createPlayer)
|
||||||
{
|
{
|
||||||
this.createPlayer = createPlayer;
|
this.createPlayer = createPlayer;
|
||||||
@ -159,8 +161,12 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
private void checkVolume(AudioManager audio)
|
private void checkVolume(AudioManager audio)
|
||||||
{
|
{
|
||||||
if (volumeOverlay.IsMuted.Value || audio.Volume.Value <= audio.Volume.MinValue || audio.VolumeTrack.Value <= audio.VolumeTrack.MinValue)
|
//Checks if the notification has not been shown yet and also if master volume is muted, track/music volume is muted or if the whole game is muted.
|
||||||
|
if (!muteWarningShownOnce && (volumeOverlay.IsMuted.Value || audio.Volume.Value <= audio.Volume.MinValue || audio.VolumeTrack.Value <= audio.VolumeTrack.MinValue))
|
||||||
|
{
|
||||||
notificationOverlay.Post(new MutedNotification());
|
notificationOverlay.Post(new MutedNotification());
|
||||||
|
muteWarningShownOnce = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnEntering(IScreen last)
|
public override void OnEntering(IScreen last)
|
||||||
|
Reference in New Issue
Block a user