1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 09:02:55 +08:00

Added container whose visibility will be changable

This commit is contained in:
Andrey Zavadskiy 2017-04-03 11:41:17 +03:00
parent 8d28c54ff3
commit e51fdd3c86

View File

@ -28,6 +28,8 @@ namespace osu.Game.Modes.UI
private Bindable<bool> showKeyCounter;
private Bindable<bool> showHud;
private readonly Container hud;
protected abstract KeyCounterCollection CreateKeyCounter();
protected abstract ComboCounter CreateComboCounter();
protected abstract PercentageCounter CreateAccuracyCounter();
@ -39,14 +41,19 @@ namespace osu.Game.Modes.UI
RelativeSizeAxes = Axes.Both;
AlwaysPresent = true;
Children = new Drawable[]
Add(hud = new Container
{
KeyCounter = CreateKeyCounter(),
ComboCounter = CreateComboCounter(),
ScoreCounter = CreateScoreCounter(),
AccuracyCounter = CreateAccuracyCounter(),
HealthDisplay = CreateHealthDisplay(),
};
RelativeSizeAxes = Axes.Both,
Children = new Drawable[]
{
KeyCounter = CreateKeyCounter(),
ComboCounter = CreateComboCounter(),
ScoreCounter = CreateScoreCounter(),
AccuracyCounter = CreateAccuracyCounter(),
HealthDisplay = CreateHealthDisplay(),
}
});
}
[BackgroundDependencyLoader(true)]
@ -80,9 +87,9 @@ namespace osu.Game.Modes.UI
private void hudVisibilityChanged(object sender, EventArgs e)
{
if (showHud)
Show();
hud.Show();
else
Hide();
hud.Hide();
}
public void BindProcessor(ScoreProcessor processor)