mirror of
https://github.com/ppy/osu.git
synced 2025-02-19 12:23:13 +08:00
Fix tests crashing due to HUDOverlay
not finding DrawableRuleset
in Update()
This commit is contained in:
parent
4db203ecc3
commit
1fd4a6dc96
@ -70,7 +70,9 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
public Bindable<bool> ShowHealthBar = new Bindable<bool>(true);
|
public Bindable<bool> ShowHealthBar = new Bindable<bool>(true);
|
||||||
|
|
||||||
|
[CanBeNull]
|
||||||
private readonly DrawableRuleset drawableRuleset;
|
private readonly DrawableRuleset drawableRuleset;
|
||||||
|
|
||||||
private readonly IReadOnlyList<Mod> mods;
|
private readonly IReadOnlyList<Mod> mods;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -106,7 +108,7 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
private readonly Drawable playfieldComponents;
|
private readonly Drawable playfieldComponents;
|
||||||
|
|
||||||
public HUDOverlay(DrawableRuleset drawableRuleset, IReadOnlyList<Mod> mods, bool alwaysShowLeaderboard = true)
|
public HUDOverlay([CanBeNull] DrawableRuleset drawableRuleset, IReadOnlyList<Mod> mods, bool alwaysShowLeaderboard = true)
|
||||||
{
|
{
|
||||||
Drawable rulesetComponents;
|
Drawable rulesetComponents;
|
||||||
this.drawableRuleset = drawableRuleset;
|
this.drawableRuleset = drawableRuleset;
|
||||||
@ -235,10 +237,13 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
|
|
||||||
Quad playfieldScreenSpaceDrawQuad = drawableRuleset.Playfield.SkinnableComponentScreenSpaceDrawQuad;
|
if (drawableRuleset != null)
|
||||||
|
{
|
||||||
|
Quad playfieldScreenSpaceDrawQuad = drawableRuleset.Playfield.SkinnableComponentScreenSpaceDrawQuad;
|
||||||
|
|
||||||
playfieldComponents.Position = ToLocalSpace(playfieldScreenSpaceDrawQuad.TopLeft);
|
playfieldComponents.Position = ToLocalSpace(playfieldScreenSpaceDrawQuad.TopLeft);
|
||||||
playfieldComponents.Size = ToLocalSpace(playfieldScreenSpaceDrawQuad.BottomRight) - ToLocalSpace(playfieldScreenSpaceDrawQuad.TopLeft);
|
playfieldComponents.Size = ToLocalSpace(playfieldScreenSpaceDrawQuad.BottomRight) - ToLocalSpace(playfieldScreenSpaceDrawQuad.TopLeft);
|
||||||
|
}
|
||||||
|
|
||||||
float? lowestTopScreenSpaceLeft = null;
|
float? lowestTopScreenSpaceLeft = null;
|
||||||
float? lowestTopScreenSpaceRight = null;
|
float? lowestTopScreenSpaceRight = null;
|
||||||
|
Loading…
Reference in New Issue
Block a user