mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 15:16:38 +09:00
Hud Visibility
This commit is contained in:
@ -22,6 +22,9 @@ namespace osu.Game.Modes.UI
|
||||
public readonly HealthDisplay HealthDisplay;
|
||||
|
||||
private Bindable<bool> showKeyCounter;
|
||||
private Bindable<bool> showHud;
|
||||
|
||||
public bool IsVisible => showHud;
|
||||
|
||||
protected abstract KeyCounterCollection CreateKeyCounter();
|
||||
protected abstract ComboCounter CreateComboCounter();
|
||||
@ -47,11 +50,15 @@ namespace osu.Game.Modes.UI
|
||||
private void load(OsuConfigManager config)
|
||||
{
|
||||
showKeyCounter = config.GetBindable<bool>(OsuConfig.KeyOverlay);
|
||||
showKeyCounter.ValueChanged += visibilityChanged;
|
||||
showKeyCounter.ValueChanged += keyCounterVisibilityChanged;
|
||||
showKeyCounter.TriggerChange();
|
||||
|
||||
showHud = config.GetBindable<bool>(OsuConfig.ShowInterface);
|
||||
showHud.ValueChanged += hudVisibilityChanged;
|
||||
showHud.TriggerChange();
|
||||
}
|
||||
|
||||
private void visibilityChanged(object sender, EventArgs e)
|
||||
private void keyCounterVisibilityChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (showKeyCounter)
|
||||
KeyCounter.Show();
|
||||
@ -59,6 +66,19 @@ namespace osu.Game.Modes.UI
|
||||
KeyCounter.Hide();
|
||||
}
|
||||
|
||||
private void hudVisibilityChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (showHud)
|
||||
Show();
|
||||
else
|
||||
Hide();
|
||||
}
|
||||
|
||||
public void ChangeVisibility()
|
||||
{
|
||||
showHud.Value = !showHud.Value;
|
||||
}
|
||||
|
||||
public void BindProcessor(ScoreProcessor processor)
|
||||
{
|
||||
//bind processor bindables to combocounter, score display etc.
|
||||
|
Reference in New Issue
Block a user