From cdef75c98bfe263c715d8eeedbe01a6a005175c8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 22 Oct 2016 17:50:42 +0900 Subject: [PATCH 1/6] Fix AutoSize references. --- osu.Game/GameModes/GameModeWhiteBox.cs | 3 ++- osu.Game/GameModes/Menu/Button.cs | 7 +++++-- osu.Game/GameModes/Menu/OsuLogo.cs | 7 +++++-- osu.Game/GameModes/Play/ComboCounter.cs | 4 +++- osu.Game/Graphics/Cursor/OsuCursorContainer.cs | 3 ++- osu.Game/Graphics/UserInterface/RollingCounter.cs | 3 ++- osu.Game/Graphics/UserInterface/StarCounter.cs | 6 ++++-- osu.Game/Online/Chat/Display/ChatLine.cs | 6 ++++-- osu.Game/Overlays/ToolbarModeSelector.cs | 2 +- osu.Game/VolumeControl.cs | 7 ++++++- 10 files changed, 34 insertions(+), 14 deletions(-) diff --git a/osu.Game/GameModes/GameModeWhiteBox.cs b/osu.Game/GameModes/GameModeWhiteBox.cs index ac3dfa148a..8556a8b496 100644 --- a/osu.Game/GameModes/GameModeWhiteBox.cs +++ b/osu.Game/GameModes/GameModeWhiteBox.cs @@ -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[] diff --git a/osu.Game/GameModes/Menu/Button.cs b/osu.Game/GameModes/Menu/Button.cs index 3586daefa0..b278cefbd9 100644 --- a/osu.Game/GameModes/Menu/Button.cs +++ b/osu.Game/GameModes/Menu/Button.cs @@ -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). /// - public class Button : AutoSizeContainer, IStateful + public class Button : Container, IStateful { 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, diff --git a/osu.Game/GameModes/Menu/OsuLogo.cs b/osu.Game/GameModes/Menu/OsuLogo.cs index cccc8b495c..80ecf36834 100644 --- a/osu.Game/GameModes/Menu/OsuLogo.cs +++ b/osu.Game/GameModes/Menu/OsuLogo.cs @@ -15,7 +15,7 @@ namespace osu.Game.GameModes.Menu /// /// osu! logo and its attachments (pulsing, visualiser etc.) /// - 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 diff --git a/osu.Game/GameModes/Play/ComboCounter.cs b/osu.Game/GameModes/Play/ComboCounter.cs index 946569af14..c40d7a4964 100644 --- a/osu.Game/GameModes/Play/ComboCounter.cs +++ b/osu.Game/GameModes/Play/ComboCounter.cs @@ -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 /// protected ComboCounter() { + AutoSizeAxes = Axes.Both; + Children = new Drawable[] { DisplayedCountSpriteText = new SpriteText diff --git a/osu.Game/Graphics/Cursor/OsuCursorContainer.cs b/osu.Game/Graphics/Cursor/OsuCursorContainer.cs index 3239961eff..2ede018778 100644 --- a/osu.Game/Graphics/Cursor/OsuCursorContainer.cs +++ b/osu.Game/Graphics/Cursor/OsuCursorContainer.cs @@ -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) diff --git a/osu.Game/Graphics/UserInterface/RollingCounter.cs b/osu.Game/Graphics/UserInterface/RollingCounter.cs index 543f775f72..69e7b6e495 100644 --- a/osu.Game/Graphics/UserInterface/RollingCounter.cs +++ b/osu.Game/Graphics/UserInterface/RollingCounter.cs @@ -15,7 +15,7 @@ using System.Threading.Tasks; namespace osu.Game.Graphics.UserInterface { - public abstract class RollingCounter : AutoSizeContainer + public abstract class RollingCounter : Container { /// /// 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) diff --git a/osu.Game/Graphics/UserInterface/StarCounter.cs b/osu.Game/Graphics/UserInterface/StarCounter.cs index 381347a401..a01d0baab1 100644 --- a/osu.Game/Graphics/UserInterface/StarCounter.cs +++ b/osu.Game/Graphics/UserInterface/StarCounter.cs @@ -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 stars = new List(); @@ -84,7 +84,9 @@ namespace osu.Game.Graphics.UserInterface /// /// Shows a float count as stars (up to 10). Used as star difficulty display. /// - public StarCounter() : this(10) { + public StarCounter() : this(10) + { + AutoSizeAxes = Axes.Both; } /// diff --git a/osu.Game/Online/Chat/Display/ChatLine.cs b/osu.Game/Online/Chat/Display/ChatLine.cs index 3f1152064e..47503ae53c 100644 --- a/osu.Game/Online/Chat/Display/ChatLine.cs +++ b/osu.Game/Online/Chat/Display/ChatLine.cs @@ -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[] { diff --git a/osu.Game/Overlays/ToolbarModeSelector.cs b/osu.Game/Overlays/ToolbarModeSelector.cs index 77ed4ecca7..e2b4e91778 100644 --- a/osu.Game/Overlays/ToolbarModeSelector.cs +++ b/osu.Game/Overlays/ToolbarModeSelector.cs @@ -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 diff --git a/osu.Game/VolumeControl.cs b/osu.Game/VolumeControl.cs index 90ca5a1f89..1b13270b30 100644 --- a/osu.Game/VolumeControl.cs +++ b/osu.Game/VolumeControl.cs @@ -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); From 28a41dcca6f62efb395fa45808f6354014358689 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 22 Oct 2016 18:05:46 +0900 Subject: [PATCH 2/6] Fix FlowContainers. --- osu.Game/GameModes/Menu/ButtonSystem.cs | 3 ++- osu.Game/Online/Chat/Display/ChannelDisplay.cs | 1 + osu.Game/Overlays/Toolbar.cs | 2 ++ osu.Game/Overlays/ToolbarButton.cs | 2 ++ osu.Game/Overlays/ToolbarModeSelector.cs | 1 + osu.Game/VolumeControl.cs | 1 + 6 files changed, 9 insertions(+), 1 deletion(-) diff --git a/osu.Game/GameModes/Menu/ButtonSystem.cs b/osu.Game/GameModes/Menu/ButtonSystem.cs index 4457df3dc7..2bc2913756 100644 --- a/osu.Game/GameModes/Menu/ButtonSystem.cs +++ b/osu.Game/GameModes/Menu/ButtonSystem.cs @@ -80,8 +80,9 @@ namespace osu.Game.GameModes.Menu { Direction = FlowDirection.HorizontalOnly, Anchor = Anchor.Centre, + AutoSizeAxes = Axes.Both, Spacing = new Vector2(-wedge_width, 0), - Children = new Drawable[] + Children = new[] { settingsButton = new Button(@"settings", @"options", FontAwesome.gear, new Color4(85, 85, 85, 255), OnSettings, -wedge_width, Key.O), backButton = new Button(@"back", @"back", FontAwesome.fa_osu_left_o, new Color4(51, 58, 94, 255), onBack, -wedge_width, Key.Escape), diff --git a/osu.Game/Online/Chat/Display/ChannelDisplay.cs b/osu.Game/Online/Chat/Display/ChannelDisplay.cs index 714718990e..7ab351080b 100644 --- a/osu.Game/Online/Chat/Display/ChannelDisplay.cs +++ b/osu.Game/Online/Chat/Display/ChannelDisplay.cs @@ -45,6 +45,7 @@ namespace osu.Game.Online.Chat.Display { Direction = FlowDirection.VerticalOnly, RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, Spacing = new Vector2(1, 1) } } diff --git a/osu.Game/Overlays/Toolbar.cs b/osu.Game/Overlays/Toolbar.cs index f771257cec..5e85dd832e 100644 --- a/osu.Game/Overlays/Toolbar.cs +++ b/osu.Game/Overlays/Toolbar.cs @@ -57,6 +57,7 @@ namespace osu.Game.Overlays { Direction = FlowDirection.HorizontalOnly, RelativeSizeAxes = Axes.Y, + AutoSizeAxes = Axes.X, Children = new Drawable[] { new ToolbarButton @@ -85,6 +86,7 @@ namespace osu.Game.Overlays Origin = Anchor.TopRight, Direction = FlowDirection.HorizontalOnly, RelativeSizeAxes = Axes.Y, + AutoSizeAxes = Axes.X, Children = new [] { new ToolbarButton diff --git a/osu.Game/Overlays/ToolbarButton.cs b/osu.Game/Overlays/ToolbarButton.cs index 41eb7a3d20..adc436a3b4 100644 --- a/osu.Game/Overlays/ToolbarButton.cs +++ b/osu.Game/Overlays/ToolbarButton.cs @@ -77,6 +77,7 @@ namespace osu.Game.Overlays Origin = Anchor.TopCentre, Padding = new MarginPadding { Left = 5, Right = 5 }, RelativeSizeAxes = Axes.Y, + AutoSizeAxes = Axes.X, Children = new Drawable[] { DrawableIcon = new TextAwesome @@ -95,6 +96,7 @@ namespace osu.Game.Overlays tooltipContainer = new FlowContainer { Direction = FlowDirection.VerticalOnly, + AutoSizeAxes = Axes.Both, Anchor = Anchor.BottomLeft, Position = new Vector2(5, -5), Alpha = 0, diff --git a/osu.Game/Overlays/ToolbarModeSelector.cs b/osu.Game/Overlays/ToolbarModeSelector.cs index e2b4e91778..934a52ec8b 100644 --- a/osu.Game/Overlays/ToolbarModeSelector.cs +++ b/osu.Game/Overlays/ToolbarModeSelector.cs @@ -44,6 +44,7 @@ namespace osu.Game.Overlays modeButtons = new FlowContainer { RelativeSizeAxes = Axes.Y, + AutoSizeAxes = Axes.X, Direction = FlowDirection.HorizontalOnly, Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, diff --git a/osu.Game/VolumeControl.cs b/osu.Game/VolumeControl.cs index 1b13270b30..ca1c27198b 100644 --- a/osu.Game/VolumeControl.cs +++ b/osu.Game/VolumeControl.cs @@ -42,6 +42,7 @@ namespace osu.Game { volumeMetersContainer = new FlowContainer { + AutoSizeAxes = Axes.Both, Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, Position = new Vector2(10, 30), From 9021042d932145d3e272447b4b02408dba3ec04f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 22 Oct 2016 18:40:04 +0900 Subject: [PATCH 3/6] Fix CircularContainer usage. --- osu.Game/GameModes/Menu/OsuLogo.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/GameModes/Menu/OsuLogo.cs b/osu.Game/GameModes/Menu/OsuLogo.cs index 80ecf36834..57fbcdd0e5 100644 --- a/osu.Game/GameModes/Menu/OsuLogo.cs +++ b/osu.Game/GameModes/Menu/OsuLogo.cs @@ -62,6 +62,7 @@ namespace osu.Game.GameModes.Menu { logoContainer = new CircularContainer { + AutoSizeAxes = Axes.Both, Anchor = Anchor.Centre, Children = new[] { From 808d5c75fb0154254a0b08c79c0eedbdb676f1bf Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 22 Oct 2016 19:08:40 +0900 Subject: [PATCH 4/6] Fix unused field warning. --- osu.Game/Beatmaps/Timing/SampleChange.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/osu.Game/Beatmaps/Timing/SampleChange.cs b/osu.Game/Beatmaps/Timing/SampleChange.cs index 488d8f0a3b..c68ff9c3bb 100644 --- a/osu.Game/Beatmaps/Timing/SampleChange.cs +++ b/osu.Game/Beatmaps/Timing/SampleChange.cs @@ -1,16 +1,11 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using osu.Game.Beatmaps.Samples; namespace osu.Game.Beatmaps.Timing { - class SampleChange : ControlPoint + public class SampleChange : ControlPoint { public SampleInfo Sample; } From 3ce93608fbc27fb4ee5bc7286a0cc1a8eb104953 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 22 Oct 2016 19:37:27 +0900 Subject: [PATCH 5/6] Fix one remaining FlowContainer. --- osu.Game/Graphics/UserInterface/KeyCounterCollection.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Graphics/UserInterface/KeyCounterCollection.cs b/osu.Game/Graphics/UserInterface/KeyCounterCollection.cs index c9d22d2f06..83cab0748e 100644 --- a/osu.Game/Graphics/UserInterface/KeyCounterCollection.cs +++ b/osu.Game/Graphics/UserInterface/KeyCounterCollection.cs @@ -2,6 +2,7 @@ //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; +using osu.Framework.Graphics; using OpenTK; using OpenTK.Graphics; using osu.Framework.Graphics.Containers; @@ -13,6 +14,7 @@ namespace osu.Game.Graphics.UserInterface public KeyCounterCollection() { Direction = FlowDirection.HorizontalOnly; + AutoSizeAxes = Axes.Both; } private List counters = new List(); From 57f678150b7571a8876c205e06481aa4d7827d0a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 22 Oct 2016 23:54:04 +0900 Subject: [PATCH 6/6] Framework update. --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 44a3b764f0..f68706eb9b 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 44a3b764f0095573eec45ee1f68265f837896fc3 +Subproject commit f68706eb9b8106bb0f6a15e7406ec49df6ebb014