mirror of
https://github.com/ppy/osu
synced 2025-02-15 09:37:07 +00:00
Move posting notification in HudOverlay
This commit is contained in:
parent
9d027a61cd
commit
ed476a79f8
@ -12,6 +12,8 @@ using System;
|
||||
using osu.Game.Modes.Scoring;
|
||||
using osu.Framework.Input;
|
||||
using OpenTK.Input;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Notifications;
|
||||
|
||||
namespace osu.Game.Modes.UI
|
||||
{
|
||||
@ -26,8 +28,6 @@ namespace osu.Game.Modes.UI
|
||||
private Bindable<bool> showKeyCounter;
|
||||
private Bindable<bool> showHud;
|
||||
|
||||
public bool IsVisible => showHud;
|
||||
|
||||
protected abstract KeyCounterCollection CreateKeyCounter();
|
||||
protected abstract ComboCounter CreateComboCounter();
|
||||
protected abstract PercentageCounter CreateAccuracyCounter();
|
||||
@ -49,8 +49,8 @@ namespace osu.Game.Modes.UI
|
||||
};
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuConfigManager config)
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(OsuConfigManager config, NotificationManager notificationManager)
|
||||
{
|
||||
showKeyCounter = config.GetBindable<bool>(OsuConfig.KeyOverlay);
|
||||
showKeyCounter.ValueChanged += keyCounterVisibilityChanged;
|
||||
@ -59,6 +59,14 @@ namespace osu.Game.Modes.UI
|
||||
showHud = config.GetBindable<bool>(OsuConfig.ShowInterface);
|
||||
showHud.ValueChanged += hudVisibilityChanged;
|
||||
showHud.TriggerChange();
|
||||
|
||||
if (!showHud)
|
||||
{
|
||||
notificationManager?.Post(new SimpleNotification
|
||||
{
|
||||
Text = @"The score overlay is currently disabled. You can toogle this by pressing Shift + Tab."
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void keyCounterVisibilityChanged(object sender, EventArgs e)
|
||||
|
@ -22,8 +22,6 @@ using osu.Game.Screens.Ranking;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using osu.Game.Modes.Scoring;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Notifications;
|
||||
|
||||
namespace osu.Game.Screens.Play
|
||||
{
|
||||
@ -61,8 +59,8 @@ namespace osu.Game.Screens.Play
|
||||
private HudOverlay hudOverlay;
|
||||
private PauseOverlay pauseOverlay;
|
||||
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(AudioManager audio, BeatmapDatabase beatmaps, OsuConfigManager config, NotificationManager notificationManager)
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(AudioManager audio, BeatmapDatabase beatmaps, OsuConfigManager config)
|
||||
{
|
||||
var beatmap = Beatmap.Beatmap;
|
||||
|
||||
@ -160,14 +158,6 @@ namespace osu.Game.Screens.Play
|
||||
hudOverlay,
|
||||
pauseOverlay
|
||||
};
|
||||
|
||||
if (!hudOverlay.IsVisible)
|
||||
{
|
||||
notificationManager?.Post(new SimpleNotification
|
||||
{
|
||||
Text = @"The score overlay is currently disabled. You can toogle this by pressing Shift + Tab."
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void initializeSkipButton()
|
||||
|
Loading…
Reference in New Issue
Block a user