mirror of
https://github.com/ppy/osu
synced 2024-12-29 02:12:43 +00:00
Merge pull request #10502 from peppy/hud-available-area
Confine available area for HUD components to exclude the song progress area
This commit is contained in:
commit
a9075fc47c
@ -63,6 +63,8 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
private readonly Container topScoreContainer;
|
||||
|
||||
private readonly FillFlowContainer bottomRightElements;
|
||||
|
||||
private IEnumerable<Drawable> hideTargets => new Drawable[] { visibilityContainer, KeyCounter };
|
||||
|
||||
public HUDOverlay(ScoreProcessor scoreProcessor, HealthProcessor healthProcessor, DrawableRuleset drawableRuleset, IReadOnlyList<Mod> mods)
|
||||
@ -80,32 +82,55 @@ namespace osu.Game.Screens.Play
|
||||
visibilityContainer = new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Children = new Drawable[]
|
||||
Child = new GridContainer
|
||||
{
|
||||
HealthDisplay = CreateHealthDisplay(),
|
||||
topScoreContainer = new Container
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Content = new[]
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Children = new Drawable[]
|
||||
new Drawable[]
|
||||
{
|
||||
AccuracyCounter = CreateAccuracyCounter(),
|
||||
ScoreCounter = CreateScoreCounter(),
|
||||
ComboCounter = CreateComboCounter(),
|
||||
new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
HealthDisplay = CreateHealthDisplay(),
|
||||
topScoreContainer = new Container
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
AccuracyCounter = CreateAccuracyCounter(),
|
||||
ScoreCounter = CreateScoreCounter(),
|
||||
ComboCounter = CreateComboCounter(),
|
||||
},
|
||||
},
|
||||
ComboCounter = CreateComboCounter(),
|
||||
ModDisplay = CreateModsContainer(),
|
||||
HitErrorDisplay = CreateHitErrorDisplayOverlay(),
|
||||
PlayerSettingsOverlay = CreatePlayerSettingsOverlay(),
|
||||
}
|
||||
},
|
||||
},
|
||||
new Drawable[]
|
||||
{
|
||||
Progress = CreateProgress(),
|
||||
}
|
||||
},
|
||||
Progress = CreateProgress(),
|
||||
ModDisplay = CreateModsContainer(),
|
||||
HitErrorDisplay = CreateHitErrorDisplayOverlay(),
|
||||
PlayerSettingsOverlay = CreatePlayerSettingsOverlay(),
|
||||
}
|
||||
RowDimensions = new[]
|
||||
{
|
||||
new Dimension(),
|
||||
new Dimension(GridSizeMode.AutoSize)
|
||||
}
|
||||
},
|
||||
},
|
||||
new FillFlowContainer
|
||||
bottomRightElements = new FillFlowContainer
|
||||
{
|
||||
Anchor = Anchor.BottomRight,
|
||||
Origin = Anchor.BottomRight,
|
||||
Position = -new Vector2(5, TwoLayerButton.SIZE_RETRACTED.Y),
|
||||
X = -5,
|
||||
AutoSizeAxes = Axes.Both,
|
||||
LayoutDuration = fade_duration / 2,
|
||||
LayoutEasing = fade_easing,
|
||||
@ -186,6 +211,12 @@ namespace osu.Game.Screens.Play
|
||||
replayLoaded.BindValueChanged(replayLoadedValueChanged, true);
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
bottomRightElements.Y = -Progress.Height;
|
||||
}
|
||||
|
||||
private void replayLoadedValueChanged(ValueChangedEvent<bool> e)
|
||||
{
|
||||
PlayerSettingsOverlay.ReplayLoaded = e.NewValue;
|
||||
|
@ -70,7 +70,6 @@ namespace osu.Game.Screens.Play
|
||||
public SongProgress()
|
||||
{
|
||||
Masking = true;
|
||||
Height = bottom_bar_height + graph_height + handle_size.Y + info_height;
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
@ -148,6 +147,8 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
bar.CurrentTime = gameplayTime;
|
||||
graph.Progress = (int)(graph.ColumnCount * progress);
|
||||
|
||||
Height = bottom_bar_height + graph_height + handle_size.Y + info_height - graph.Y;
|
||||
}
|
||||
|
||||
private void updateBarVisibility()
|
||||
|
Loading…
Reference in New Issue
Block a user