Make taiko proxy containers use LifetimeManagementContainer

This commit is contained in:
smoogipoo 2019-08-28 13:20:28 +09:00
parent 0f25ad8b87
commit 7cc92e2fad

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);
}
}
}