diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs index f943d817a8..767a2b3458 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs @@ -27,18 +27,18 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables // This will be fixed when new designs are given or the current design is finalized. bodyPiece = new BodyPiece { - Anchor = Anchor.BottomCentre, - Origin = Anchor.BottomCentre, + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, }, headPiece = new NotePiece { - Anchor = Anchor.BottomCentre, - Origin = Anchor.BottomCentre + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre }, tailPiece = new NotePiece { - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre + Anchor = Anchor.BottomCentre, + Origin = Anchor.BottomCentre } }); } diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs index e3b28c8aca..0307e9162a 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs @@ -22,11 +22,8 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables { HitObject = hitObject; - Anchor = Anchor.BottomCentre; - Origin = Anchor.BottomCentre; - RelativePositionAxes = Axes.Y; - Y = (float)-HitObject.StartTime; + Y = (float)HitObject.StartTime; Add(glowContainer = new Container { diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs index a105c21e43..b216c362f5 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs @@ -20,8 +20,8 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables Add(headPiece = new NotePiece { - Anchor = Anchor.BottomCentre, - Origin = Anchor.BottomCentre + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre }); } diff --git a/osu.Game.Rulesets.Mania/Timing/TimeRelativeContainer.cs b/osu.Game.Rulesets.Mania/Timing/TimeRelativeContainer.cs index 64b5b4e5ef..5407b083df 100644 --- a/osu.Game.Rulesets.Mania/Timing/TimeRelativeContainer.cs +++ b/osu.Game.Rulesets.Mania/Timing/TimeRelativeContainer.cs @@ -87,18 +87,13 @@ namespace osu.Game.Rulesets.Mania.Timing { this.timingChange = timingChange; - Anchor = Anchor.BottomCentre; - Origin = Anchor.BottomCentre; - RelativeSizeAxes = Axes.Both; AddInternal(content = new AutoTimeRelativeContainer { - Anchor = Anchor.BottomCentre, - Origin = Anchor.BottomCentre, RelativeSizeAxes = Axes.Both, RelativePositionAxes = Axes.Both, - Y = -(float)timingChange.Time + Y = (float)timingChange.Time }); } @@ -111,7 +106,7 @@ namespace osu.Game.Rulesets.Mania.Timing RelativeCoordinateSpace = new Vector2(1, (float)parent.TimeSpan); // Scroll the content - content.Y = (float)(Time.Current - timingChange.Time); + content.Y = (float)(timingChange.Time - Time.Current); } public override void Add(Drawable drawable) @@ -120,7 +115,7 @@ namespace osu.Game.Rulesets.Mania.Timing // we need to offset it back by our position so that it becomes correctly relatively-positioned to us // This can be removed if hit objects were stored such that either their StartTime or their "beat offset" was relative to the timing section // they belonged to, but this requires a radical change to the beatmap format which we're not ready to do just yet - drawable.Y += (float)timingChange.Time; + drawable.Y -= (float)timingChange.Time; base.Add(drawable); } @@ -130,7 +125,7 @@ namespace osu.Game.Rulesets.Mania.Timing /// can be placed within the timing section's bounds (in this case, from the start of the timing section up to infinity). /// /// The drawable to check. - public bool CanContain(Drawable drawable) => content.Y >= drawable.Y; + public bool CanContain(Drawable drawable) => content.Y <= drawable.Y; private class AutoTimeRelativeContainer : Container { @@ -140,8 +135,7 @@ namespace osu.Game.Rulesets.Mania.Timing foreach (Drawable child in Children) { - // Todo: This is wrong, it won't work for absolute-y-sized children - float childEndPos = -child.Y + child.Height; + float childEndPos = child.Y + child.Height; if (childEndPos > height) height = childEndPos; } diff --git a/osu.Game.Rulesets.Mania/UI/Column.cs b/osu.Game.Rulesets.Mania/UI/Column.cs index 34d241485c..8491b631c5 100644 --- a/osu.Game.Rulesets.Mania/UI/Column.cs +++ b/osu.Game.Rulesets.Mania/UI/Column.cs @@ -18,6 +18,7 @@ using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Mania.Objects; using osu.Game.Rulesets.Mania.Judgements; using osu.Game.Beatmaps.Timing; +using osu.Framework.Graphics.Primitives; namespace osu.Game.Rulesets.Mania.UI { @@ -56,51 +57,50 @@ namespace osu.Game.Rulesets.Mania.UI }, new Container { - Name = "Hit target", - Anchor = Anchor.BottomCentre, - Origin = Anchor.BottomCentre, - RelativeSizeAxes = Axes.X, - Height = hit_target_height, - Y = -ManiaPlayfield.HIT_TARGET_POSITION, + Name = "Hit target + hit objects", + RelativeSizeAxes = Axes.Both, + Padding = new MarginPadding { Top = ManiaPlayfield.HIT_TARGET_POSITION}, Children = new Drawable[] { - new Box + new Container { - Name = "Background", - RelativeSizeAxes = Axes.Both, - Colour = Color4.Black - }, - hitTargetBar = new Container - { - Name = "Bar", - Anchor = Anchor.BottomCentre, - Origin = Anchor.BottomCentre, + Name = "Hit target", RelativeSizeAxes = Axes.X, - Height = hit_target_bar_height, - Masking = true, - Children = new[] + Height = hit_target_height, + Children = new Drawable[] { new Box { - RelativeSizeAxes = Axes.Both + Name = "Background", + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black + }, + hitTargetBar = new Container + { + Name = "Bar", + RelativeSizeAxes = Axes.X, + Height = hit_target_bar_height, + Masking = true, + Children = new[] + { + new Box + { + RelativeSizeAxes = Axes.Both + } + } } } - } + }, + TimingSectionContainer = new TimeRelativeContainer(timingChanges) + { + Name = "Hit objects", + RelativeSizeAxes = Axes.Both, + }, } }, - TimingSectionContainer = new TimeRelativeContainer(timingChanges) - { - Name = "Hit objects", - RelativeSizeAxes = Axes.Both, - Anchor = Anchor.BottomCentre, - Origin = Anchor.BottomCentre, - Y = -ManiaPlayfield.HIT_TARGET_POSITION - }, new Container { Name = "Key", - Anchor = Anchor.BottomCentre, - Origin = Anchor.BottomCentre, RelativeSizeAxes = Axes.X, Height = ManiaPlayfield.HIT_TARGET_POSITION, Children = new Drawable[] diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 118cf610dc..1929bfdf7d 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -74,8 +74,8 @@ namespace osu.Game.Rulesets.Mania.UI { new Container { - Anchor = Anchor.BottomCentre, - Origin = Anchor.BottomCentre, + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X, Masking = true, @@ -95,13 +95,18 @@ namespace osu.Game.Rulesets.Mania.UI Padding = new MarginPadding { Left = 1, Right = 1 }, Spacing = new Vector2(1, 0) }, - barlineContainer = new TimeRelativeContainer(timingChanges) + new Container { - Name = "Bar lines", - Anchor = Anchor.BottomCentre, - Origin = Anchor.BottomCentre, RelativeSizeAxes = Axes.Both, - Padding = new MarginPadding { Bottom = HIT_TARGET_POSITION } + Padding = new MarginPadding { Top = HIT_TARGET_POSITION }, + Children = new[] + { + barlineContainer = new TimeRelativeContainer(timingChanges) + { + Name = "Bar lines", + RelativeSizeAxes = Axes.Both, + } + } } } }