1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 05:22:54 +08:00

Make taiko proxy containers use LifetimeManagementContainer (#5863)

Make taiko proxy containers use LifetimeManagementContainer

Co-authored-by: Dean Herbert <pe@ppy.sh>
This commit is contained in:
Dean Herbert 2019-08-28 18:35:15 +09:00 committed by GitHub
commit a91dbe4a50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,9 +44,8 @@ namespace osu.Game.Rulesets.Taiko.UI
private readonly JudgementContainer<DrawableTaikoJudgement> judgementContainer;
internal readonly HitTarget HitTarget;
private readonly Container topLevelHitContainer;
private readonly Container barlineContainer;
private readonly ProxyContainer topLevelHitContainer;
private readonly ProxyContainer barlineContainer;
private readonly Container overlayBackgroundContainer;
private readonly Container backgroundContainer;
@ -108,7 +107,7 @@ namespace osu.Game.Rulesets.Taiko.UI
}
}
},
barlineContainer = new Container
barlineContainer = new ProxyContainer
{
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Left = HIT_TARGET_OFFSET }
@ -183,7 +182,7 @@ namespace osu.Game.Rulesets.Taiko.UI
}
}
},
topLevelHitContainer = new Container
topLevelHitContainer = new ProxyContainer
{
Name = "Top level hit objects",
RelativeSizeAxes = Axes.Both,
@ -256,5 +255,15 @@ namespace osu.Game.Rulesets.Taiko.UI
break;
}
}
private class ProxyContainer : LifetimeManagementContainer
{
public new MarginPadding Padding
{
set => base.Padding = value;
}
public void Add(Drawable proxy) => AddInternal(proxy);
}
}
}