From 42dc4d9b1c96c83eff95948a331a7d8948fa8af5 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 11 Sep 2017 10:46:54 +0900 Subject: [PATCH] Rework mania playfield to be more sane with masking/nesting. --- osu-framework | 2 +- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 39 +++++++++++--------- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/osu-framework b/osu-framework index a617245a42..09f71b9383 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit a617245a4261d7d6e138c2fddbbeaa7940d24ca7 +Subproject commit 09f71b93837f072da067cc60755bdf85682d9fb4 diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index ce91fda023..57f204990f 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -50,6 +50,8 @@ namespace osu.Game.Rulesets.Mania.UI protected override Container Content => content; private readonly Container content; + private readonly Container topLevelContainer; + private List normalColumnColours = new List(); private Color4 specialColumnColour; @@ -69,17 +71,16 @@ namespace osu.Game.Rulesets.Mania.UI { new Container { + Name = "Playfield elements", Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, - RelativeSizeAxes = Axes.Both, - Masking = true, + RelativeSizeAxes = Axes.Y, + AutoSizeAxes = Axes.X, Children = new Drawable[] { new Container { - Name = "Masked elements", - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, + Name = "Columns mask", RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X, Masking = true, @@ -87,6 +88,7 @@ namespace osu.Game.Rulesets.Mania.UI { new Box { + Name = "Background", RelativeSizeAxes = Axes.Both, Colour = Color4.Black }, @@ -98,27 +100,28 @@ namespace osu.Game.Rulesets.Mania.UI Direction = FillDirection.Horizontal, Padding = new MarginPadding { Left = 1, Right = 1 }, Spacing = new Vector2(1, 0) - } + }, } }, new Container { + Name = "Barlines mask", Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, - RelativeSizeAxes = Axes.Both, - Padding = new MarginPadding { Top = HIT_TARGET_POSITION }, - Children = new[] + RelativeSizeAxes = Axes.Y, + Width = 1366, // Bar lines should only be masked on the vertical axis + BypassAutoSizeAxes = Axes.Both, + Masking = true, + Child = content = new Container { - content = new Container - { - Name = "Bar lines", - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - RelativeSizeAxes = Axes.Y, - // Width is set in the Update method - } + Name = "Bar lines", + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + RelativeSizeAxes = Axes.Y, + Padding = new MarginPadding { Top = HIT_TARGET_POSITION } } - } + }, + topLevelContainer = new Container { RelativeSizeAxes = Axes.Both } } } };