mirror of
https://github.com/ppy/osu.git
synced 2025-02-19 21:52:54 +08: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.Game.Modes.Scoring;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using OpenTK.Input;
|
using OpenTK.Input;
|
||||||
|
using osu.Game.Overlays;
|
||||||
|
using osu.Game.Overlays.Notifications;
|
||||||
|
|
||||||
namespace osu.Game.Modes.UI
|
namespace osu.Game.Modes.UI
|
||||||
{
|
{
|
||||||
@ -26,8 +28,6 @@ namespace osu.Game.Modes.UI
|
|||||||
private Bindable<bool> showKeyCounter;
|
private Bindable<bool> showKeyCounter;
|
||||||
private Bindable<bool> showHud;
|
private Bindable<bool> showHud;
|
||||||
|
|
||||||
public bool IsVisible => showHud;
|
|
||||||
|
|
||||||
protected abstract KeyCounterCollection CreateKeyCounter();
|
protected abstract KeyCounterCollection CreateKeyCounter();
|
||||||
protected abstract ComboCounter CreateComboCounter();
|
protected abstract ComboCounter CreateComboCounter();
|
||||||
protected abstract PercentageCounter CreateAccuracyCounter();
|
protected abstract PercentageCounter CreateAccuracyCounter();
|
||||||
@ -49,8 +49,8 @@ namespace osu.Game.Modes.UI
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader(true)]
|
||||||
private void load(OsuConfigManager config)
|
private void load(OsuConfigManager config, NotificationManager notificationManager)
|
||||||
{
|
{
|
||||||
showKeyCounter = config.GetBindable<bool>(OsuConfig.KeyOverlay);
|
showKeyCounter = config.GetBindable<bool>(OsuConfig.KeyOverlay);
|
||||||
showKeyCounter.ValueChanged += keyCounterVisibilityChanged;
|
showKeyCounter.ValueChanged += keyCounterVisibilityChanged;
|
||||||
@ -59,6 +59,14 @@ namespace osu.Game.Modes.UI
|
|||||||
showHud = config.GetBindable<bool>(OsuConfig.ShowInterface);
|
showHud = config.GetBindable<bool>(OsuConfig.ShowInterface);
|
||||||
showHud.ValueChanged += hudVisibilityChanged;
|
showHud.ValueChanged += hudVisibilityChanged;
|
||||||
showHud.TriggerChange();
|
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)
|
private void keyCounterVisibilityChanged(object sender, EventArgs e)
|
||||||
|
@ -22,8 +22,6 @@ using osu.Game.Screens.Ranking;
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Game.Modes.Scoring;
|
using osu.Game.Modes.Scoring;
|
||||||
using osu.Game.Overlays;
|
|
||||||
using osu.Game.Overlays.Notifications;
|
|
||||||
|
|
||||||
namespace osu.Game.Screens.Play
|
namespace osu.Game.Screens.Play
|
||||||
{
|
{
|
||||||
@ -61,8 +59,8 @@ namespace osu.Game.Screens.Play
|
|||||||
private HudOverlay hudOverlay;
|
private HudOverlay hudOverlay;
|
||||||
private PauseOverlay pauseOverlay;
|
private PauseOverlay pauseOverlay;
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader]
|
||||||
private void load(AudioManager audio, BeatmapDatabase beatmaps, OsuConfigManager config, NotificationManager notificationManager)
|
private void load(AudioManager audio, BeatmapDatabase beatmaps, OsuConfigManager config)
|
||||||
{
|
{
|
||||||
var beatmap = Beatmap.Beatmap;
|
var beatmap = Beatmap.Beatmap;
|
||||||
|
|
||||||
@ -160,14 +158,6 @@ namespace osu.Game.Screens.Play
|
|||||||
hudOverlay,
|
hudOverlay,
|
||||||
pauseOverlay
|
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()
|
private void initializeSkipButton()
|
||||||
|
Loading…
Reference in New Issue
Block a user