1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-03 22:02:57 +08:00

Give stages a size again

This commit is contained in:
smoogipoo 2018-01-15 19:44:42 +09:00
parent 8a7892b66a
commit 28586317dd
4 changed files with 8 additions and 10 deletions

View File

@ -47,6 +47,7 @@ namespace osu.Game.Rulesets.Mania.UI
public Column() public Column()
: base(ScrollingDirection.Up) : base(ScrollingDirection.Up)
{ {
RelativeSizeAxes = Axes.Y;
Width = column_width; Width = column_width;
InternalChildren = new Drawable[] InternalChildren = new Drawable[]

View File

@ -55,6 +55,7 @@ namespace osu.Game.Rulesets.Mania.UI
Name = "Stages", Name = "Stages",
Direction = FillDirection.Horizontal, Direction = FillDirection.Horizontal,
RelativeSizeAxes = Axes.Y, RelativeSizeAxes = Axes.Y,
AutoSizeAxes = Axes.X,
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
Spacing = new Vector2(stageSpacing), Spacing = new Vector2(stageSpacing),

View File

@ -60,9 +60,13 @@ namespace osu.Game.Rulesets.Mania.UI
this.firstColumnIndex = firstColumnIndex; this.firstColumnIndex = firstColumnIndex;
this.definition = definition; this.definition = definition;
Name = "Playfield elements"; Name = "Stage";
Anchor = Anchor.Centre; Anchor = Anchor.Centre;
Origin = Anchor.Centre; Origin = Anchor.Centre;
RelativeSizeAxes = Axes.Y;
AutoSizeAxes = Axes.X;
InternalChildren = new Drawable[] InternalChildren = new Drawable[]
{ {
new Container new Container

View File

@ -1,7 +1,6 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Objects.Drawables;
@ -34,8 +33,7 @@ namespace osu.Game.Rulesets.UI
/// <param name="customWidth">Whether we want our internal coordinate system to be scaled to a specified width.</param> /// <param name="customWidth">Whether we want our internal coordinate system to be scaled to a specified width.</param>
protected Playfield(float? customWidth = null) protected Playfield(float? customWidth = null)
{ {
// Default height since we force relative size axes RelativeSizeAxes = Axes.Both;
Size = Vector2.One;
AddInternal(ScaledContent = new ScaledContainer AddInternal(ScaledContent = new ScaledContainer
{ {
@ -60,12 +58,6 @@ namespace osu.Game.Rulesets.UI
Add(HitObjects); Add(HitObjects);
} }
public override Axes RelativeSizeAxes
{
get { return Axes.Both; }
set { throw new InvalidOperationException($@"{nameof(Playfield)}'s {nameof(RelativeSizeAxes)} should never be changed from {Axes.Both}"); }
}
/// <summary> /// <summary>
/// Performs post-processing tasks (if any) after all DrawableHitObjects are loaded into this Playfield. /// Performs post-processing tasks (if any) after all DrawableHitObjects are loaded into this Playfield.
/// </summary> /// </summary>