1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 06:12:56 +08:00

Fix AutoSize references.

This commit is contained in:
Dean Herbert 2016-10-22 17:50:42 +09:00
parent e26a9de5b5
commit cdef75c98b
10 changed files with 34 additions and 14 deletions

View File

@ -93,8 +93,9 @@ namespace osu.Game.GameModes
Alpha = 1,
Additive = false
},
textContainer = new AutoSizeContainer
textContainer = new Container
{
AutoSizeAxes = Axes.Both,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Children = new[]

View File

@ -17,7 +17,7 @@ namespace osu.Game.GameModes.Menu
/// Button designed specifically for the osu!next main menu.
/// In order to correctly flow, we have to use a negative margin on the parent container (due to the parallelogram shape).
/// </summary>
public class Button : AutoSizeContainer, IStateful<ButtonState>
public class Button : Container, IStateful<ButtonState>
{
private Container iconText;
private Box box;
@ -44,6 +44,8 @@ namespace osu.Game.GameModes.Menu
this.extraWidth = extraWidth;
this.triggerKey = triggerKey;
this.text = text;
AutoSizeAxes = Axes.Both;
}
public override void Load(BaseGame game)
@ -64,8 +66,9 @@ namespace osu.Game.GameModes.Menu
Size = boxSize,
Shear = new Vector2(ButtonSystem.wedge_width / boxSize.Y, 0),
},
iconText = new AutoSizeContainer
iconText = new Container
{
AutoSizeAxes = Axes.Both,
Position = new Vector2(extraWidth / 2, 0),
Anchor = Anchor.Centre,
Origin = Anchor.Centre,

View File

@ -15,7 +15,7 @@ namespace osu.Game.GameModes.Menu
/// <summary>
/// osu! logo and its attachments (pulsing, visualiser etc.)
/// </summary>
public partial class OsuLogo : AutoSizeContainer
public partial class OsuLogo : Container
{
private Sprite logo;
private CircularContainer logoContainer;
@ -51,10 +51,13 @@ namespace osu.Game.GameModes.Menu
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
AutoSizeAxes = Axes.Both;
Children = new Drawable[]
{
logoBounceContainer = new AutoSizeContainer
logoBounceContainer = new Container
{
AutoSizeAxes = Axes.Both,
Children = new Drawable[]
{
logoContainer = new CircularContainer

View File

@ -17,7 +17,7 @@ using System.Threading.Tasks;
namespace osu.Game.GameModes.Play
{
public abstract class ComboCounter : AutoSizeContainer
public abstract class ComboCounter : Container
{
public bool IsRolling
{
@ -102,6 +102,8 @@ namespace osu.Game.GameModes.Play
/// </summary>
protected ComboCounter()
{
AutoSizeAxes = Axes.Both;
Children = new Drawable[]
{
DisplayedCountSpriteText = new SpriteText

View File

@ -29,11 +29,12 @@ namespace osu.Game.Graphics.Cursor
return base.OnMouseUp(state, args);
}
class OsuCursor : AutoSizeContainer
class OsuCursor : Container
{
public OsuCursor()
{
Origin = Anchor.Centre;
AutoSizeAxes = Axes.Both;
}
public override void Load(BaseGame game)

View File

@ -15,7 +15,7 @@ using System.Threading.Tasks;
namespace osu.Game.Graphics.UserInterface
{
public abstract class RollingCounter<T> : AutoSizeContainer
public abstract class RollingCounter<T> : Container
{
/// <summary>
/// Type of the Transform to use.
@ -116,6 +116,7 @@ namespace osu.Game.Graphics.UserInterface
};
TextSize = 40;
AutoSizeAxes = Axes.Both;
}
public override void Load(BaseGame game)

View File

@ -15,7 +15,7 @@ using System.Threading.Tasks;
namespace osu.Game.Graphics.UserInterface
{
public class StarCounter : AutoSizeContainer
public class StarCounter : Container
{
private readonly Container starContainer;
private readonly List<TextAwesome> stars = new List<TextAwesome>();
@ -84,7 +84,9 @@ namespace osu.Game.Graphics.UserInterface
/// <summary>
/// Shows a float count as stars (up to 10). Used as star difficulty display.
/// </summary>
public StarCounter() : this(10) {
public StarCounter() : this(10)
{
AutoSizeAxes = Axes.Both;
}
/// <summary>

View File

@ -15,7 +15,7 @@ namespace osu.Game.Online.Chat.Display
{
namespace osu.Online.Social
{
public class ChatLine : AutoSizeContainer
public class ChatLine : Container
{
public readonly Message Message;
@ -32,6 +32,7 @@ namespace osu.Game.Online.Chat.Display
base.Load(game);
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Children = new Drawable[]
{
@ -55,9 +56,10 @@ namespace osu.Game.Online.Chat.Display
}
}
},
new AutoSizeContainer
new Container
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Padding = new MarginPadding { Left = padding + 10 },
Children = new Drawable[]
{

View File

@ -3,7 +3,6 @@
using System;
using System.Linq;
using osu.Framework.Cached;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Transformations;
@ -11,6 +10,7 @@ using osu.Game.GameModes.Play;
using OpenTK;
using OpenTK.Graphics;
using osu.Framework;
using osu.Framework.Caching;
using osu.Framework.Graphics.Sprites;
namespace osu.Game.Overlays

View File

@ -8,7 +8,7 @@ using osu.Framework.Graphics.Primitives;
namespace osu.Game
{
internal class VolumeControl : AutoSizeContainer
internal class VolumeControl : Container
{
private FlowContainer volumeMetersContainer;
private VolumeMeter volumeMeterMaster;
@ -26,6 +26,11 @@ namespace osu.Game
Origin = Anchor.BottomRight;
}
public VolumeControl()
{
AutoSizeAxes = Axes.Both;
}
public override void Load(BaseGame game)
{
base.Load(game);