mirror of
https://github.com/ppy/osu
synced 2025-01-09 23:59:44 +00:00
Added container whose visibility will be changable
This commit is contained in:
parent
8d28c54ff3
commit
e51fdd3c86
@ -28,6 +28,8 @@ namespace osu.Game.Modes.UI
|
|||||||
private Bindable<bool> showKeyCounter;
|
private Bindable<bool> showKeyCounter;
|
||||||
private Bindable<bool> showHud;
|
private Bindable<bool> showHud;
|
||||||
|
|
||||||
|
private readonly Container hud;
|
||||||
|
|
||||||
protected abstract KeyCounterCollection CreateKeyCounter();
|
protected abstract KeyCounterCollection CreateKeyCounter();
|
||||||
protected abstract ComboCounter CreateComboCounter();
|
protected abstract ComboCounter CreateComboCounter();
|
||||||
protected abstract PercentageCounter CreateAccuracyCounter();
|
protected abstract PercentageCounter CreateAccuracyCounter();
|
||||||
@ -39,14 +41,19 @@ namespace osu.Game.Modes.UI
|
|||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
AlwaysPresent = true;
|
AlwaysPresent = true;
|
||||||
|
|
||||||
Children = new Drawable[]
|
Add(hud = new Container
|
||||||
{
|
{
|
||||||
KeyCounter = CreateKeyCounter(),
|
RelativeSizeAxes = Axes.Both,
|
||||||
ComboCounter = CreateComboCounter(),
|
|
||||||
ScoreCounter = CreateScoreCounter(),
|
Children = new Drawable[]
|
||||||
AccuracyCounter = CreateAccuracyCounter(),
|
{
|
||||||
HealthDisplay = CreateHealthDisplay(),
|
KeyCounter = CreateKeyCounter(),
|
||||||
};
|
ComboCounter = CreateComboCounter(),
|
||||||
|
ScoreCounter = CreateScoreCounter(),
|
||||||
|
AccuracyCounter = CreateAccuracyCounter(),
|
||||||
|
HealthDisplay = CreateHealthDisplay(),
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
@ -80,9 +87,9 @@ namespace osu.Game.Modes.UI
|
|||||||
private void hudVisibilityChanged(object sender, EventArgs e)
|
private void hudVisibilityChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (showHud)
|
if (showHud)
|
||||||
Show();
|
hud.Show();
|
||||||
else
|
else
|
||||||
Hide();
|
hud.Hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void BindProcessor(ScoreProcessor processor)
|
public void BindProcessor(ScoreProcessor processor)
|
||||||
|
Loading…
Reference in New Issue
Block a user