From 9c853b04657816be24263cb8e3dc2b9e281670b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Wed, 1 Mar 2017 19:33:01 +0100 Subject: [PATCH] =?UTF-8?q?Update=20framew=C3=B6rk?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- osu-framework | 2 +- .../Tests/TestCaseTextAwesome.cs | 4 +- osu.Desktop/Overlays/VersionManager.cs | 9 +-- .../Objects/Drawables/HitExplosion.cs | 5 +- osu.Game/Beatmaps/Drawables/BeatmapGroup.cs | 66 ------------------- osu.Game/Beatmaps/Drawables/BeatmapPanel.cs | 13 ++-- .../Beatmaps/Drawables/BeatmapSetHeader.cs | 12 ++-- .../UserInterface/OsuDropDownMenuItem.cs | 4 +- .../Graphics/UserInterface/StarCounter.cs | 5 +- .../UserInterface/Volume/VolumeControl.cs | 4 +- .../Online/Chat/Drawables/DrawableChannel.cs | 6 +- osu.Game/Overlays/NotificationManager.cs | 4 +- .../Notifications/NotificationSection.cs | 12 ++-- osu.Game/Overlays/Options/OptionDropDown.cs | 4 +- osu.Game/Overlays/Options/OptionSlider.cs | 3 +- osu.Game/Overlays/Options/OptionsSection.cs | 7 +- .../Overlays/Options/OptionsSubsection.cs | 9 +-- .../Options/Sections/EditorSection.cs | 2 +- .../Options/Sections/General/LoginOptions.cs | 5 +- .../Options/Sections/MaintenanceSection.cs | 2 +- .../Overlays/Options/Sections/SkinSection.cs | 2 +- osu.Game/Overlays/Options/Sidebar.cs | 6 +- osu.Game/Overlays/OptionsOverlay.cs | 8 +-- osu.Game/Overlays/Pause/PauseOverlay.cs | 16 +++-- osu.Game/Overlays/Toolbar/Toolbar.cs | 8 +-- osu.Game/Overlays/Toolbar/ToolbarButton.cs | 13 ++-- .../Overlays/Toolbar/ToolbarModeSelector.cs | 6 +- osu.Game/Screens/GameScreenWhiteBox.cs | 6 +- osu.Game/Screens/Menu/ButtonSystem.cs | 3 +- osu.Game/Screens/Menu/Disclaimer.cs | 5 +- .../Screens/Menu/FlowContainerWithOrigin.cs | 4 +- osu.Game/Screens/Play/KeyCounterCollection.cs | 4 +- osu.Game/Screens/Play/PlayerLoader.cs | 4 +- osu.Game/Screens/Ranking/Results.cs | 4 +- osu.Game/Screens/Select/BeatmapInfoWedge.cs | 12 ++-- osu.Game/Screens/Select/FilterControl.cs | 14 ++-- osu.Game/Screens/Select/Footer.cs | 13 ++-- 37 files changed, 127 insertions(+), 179 deletions(-) diff --git a/osu-framework b/osu-framework index 995e80742b..f3aea04b0e 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 995e80742b289dbe1e7655c39148b1773876d52a +Subproject commit f3aea04b0e6a6ebb6d6f24fcb2134058765c0df0 diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTextAwesome.cs b/osu.Desktop.VisualTests/Tests/TestCaseTextAwesome.cs index 7502c623fe..ce3650fe61 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTextAwesome.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTextAwesome.cs @@ -22,9 +22,9 @@ namespace osu.Desktop.VisualTests.Tests { base.Reset(); - FlowContainer flow; + FillFlowContainer flow; - Add(flow = new FlowContainer() + Add(flow = new FillFlowContainer() { RelativeSizeAxes = Axes.Both, Size = new Vector2(0.5f), diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index 8c3f7ceaa4..92c4e25136 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -57,16 +57,17 @@ namespace osu.Desktop.Overlays Children = new Drawable[] { - new FlowContainer + new FillFlowContainer { AutoSizeAxes = Axes.Both, - FlowStrategy = FlowStrategies.CreateVerticalFlow(), + Direction = FlowDirection.Down, Children = new Drawable[] { - new FlowContainer + new FillFlowContainer { AutoSizeAxes = Axes.Both, - FlowStrategy = FlowStrategies.CreateHorizontalFlow(new Vector2(5)), + Direction = FlowDirection.Right, + Spacing = new Vector2(5), Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Children = new Drawable[] diff --git a/osu.Game.Modes.Osu/Objects/Drawables/HitExplosion.cs b/osu.Game.Modes.Osu/Objects/Drawables/HitExplosion.cs index 545f71567a..9a0a532739 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/HitExplosion.cs +++ b/osu.Game.Modes.Osu/Objects/Drawables/HitExplosion.cs @@ -13,7 +13,7 @@ using OpenTK.Graphics; namespace osu.Game.Modes.Osu.Objects.Drawables { - public class HitExplosion : FlowContainer + public class HitExplosion : FillFlowContainer { private readonly OsuJudgementInfo judgement; private SpriteText line1; @@ -25,7 +25,8 @@ namespace osu.Game.Modes.Osu.Objects.Drawables AutoSizeAxes = Axes.Both; Origin = Anchor.Centre; - FlowStrategy = FlowStrategies.CreateVerticalFlow(new Vector2(0, 2)); + Direction = FlowDirection.Down; + Spacing = new Vector2(0, 2); Position = (h?.StackedEndPosition ?? Vector2.Zero) + judgement.PositionOffset; Children = new Drawable[] diff --git a/osu.Game/Beatmaps/Drawables/BeatmapGroup.cs b/osu.Game/Beatmaps/Drawables/BeatmapGroup.cs index 301a81d4b5..9c1f1a02fc 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapGroup.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapGroup.cs @@ -8,72 +8,6 @@ using osu.Framework; using osu.Framework.Graphics; using osu.Game.Database; -namespace osu.Game.Beatmaps.Drawables -{ - class BeatmapGroup : IStateful - { - public BeatmapPanel SelectedPanel; - - /// - /// Fires when one of our difficulties was selected. Will fire on first expand. - /// - public Action SelectionChanged; - - /// - /// Fires when one of our difficulties is clicked when already selected. Should start playing the map. - /// - public Action StartRequested; - - public BeatmapSetHeader Header; - - private BeatmapGroupState state; - - public List BeatmapPanels; - - public BeatmapSetInfo BeatmapSet; - - public BeatmapGroupState State - { - get { return state; } - set - { - switch (value) - { - case BeatmapGroupState.Expanded: - Header.State = PanelSelectedState.Selected; - foreach (BeatmapPanel panel in BeatmapPanels) - panel.State = panel == SelectedPanel ? PanelSelectedState.Selected : PanelSelectedState.NotSelected; - break; - case BeatmapGroupState.Collapsed: - Header.State = PanelSelectedState.NotSelected; - foreach (BeatmapPanel panel in BeatmapPanels) - panel.State = PanelSelectedState.Hidden; - break; - case BeatmapGroupState.Hidden: - Header.State = PanelSelectedState.Hidden; - foreach (BeatmapPanel panel in BeatmapPanels) - panel.State = PanelSelectedState.Hidden; - break; - } - state = value; - } - } - - public BeatmapGroup(BeatmapSetInfo beatmapSet, BeatmapDatabase database) - { - BeatmapSet = beatmapSet; - WorkingBeatmap beatmap = database.GetWorkingBeatmap(BeatmapSet.Beatmaps.FirstOrDefault()); - foreach (var b in BeatmapSet.Beatmaps) -// Copyright (c) 2007-2017 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 osu.Framework; -using osu.Framework.Graphics; -using osu.Game.Database; - namespace osu.Game.Beatmaps.Drawables { class BeatmapGroup : IStateful diff --git a/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs b/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs index 7e8b0068c1..24808ed1dd 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs @@ -83,10 +83,10 @@ namespace osu.Game.Beatmaps.Drawables ColourLight = OsuColour.FromHex(@"3a7285"), ColourDark = OsuColour.FromHex(@"123744") }, - new FlowContainer + new FillFlowContainer { Padding = new MarginPadding(5), - FlowStrategy = FlowStrategies.CreateHorizontalFlow(), + Direction = FlowDirection.Right, AutoSizeAxes = Axes.Both, Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, @@ -98,16 +98,17 @@ namespace osu.Game.Beatmaps.Drawables Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, }, - new FlowContainer + new FillFlowContainer { Padding = new MarginPadding { Left = 5 }, - FlowStrategy = FlowStrategies.CreateVerticalFlow(), + Direction = FlowDirection.Down, AutoSizeAxes = Axes.Both, Children = new Drawable[] { - new FlowContainer + new FillFlowContainer { - FlowStrategy = FlowStrategies.CreateHorizontalFlow(new Vector2(4, 0)), + Direction = FlowDirection.Right, + Spacing = new Vector2(4, 0), AutoSizeAxes = Axes.Both, Children = new[] { diff --git a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs index 0998423d47..4dbee876d0 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs @@ -24,7 +24,7 @@ namespace osu.Game.Beatmaps.Drawables private OsuConfigManager config; private Bindable preferUnicode; private WorkingBeatmap beatmap; - private FlowContainer difficultyIcons; + private FillFlowContainer difficultyIcons; public BeatmapSetHeader(WorkingBeatmap beatmap) { @@ -36,9 +36,9 @@ namespace osu.Game.Beatmaps.Drawables { RelativeSizeAxes = Axes.Both, }, - new FlowContainer + new FillFlowContainer { - FlowStrategy = FlowStrategies.CreateVerticalFlow(), + Direction = FlowDirection.Down, Padding = new MarginPadding { Top = 5, Left = 18, Right = 10, Bottom = 10 }, AutoSizeAxes = Axes.Both, Children = new[] @@ -58,7 +58,7 @@ namespace osu.Game.Beatmaps.Drawables TextSize = 17, Shadow = true, }, - difficultyIcons = new FlowContainer + difficultyIcons = new FillFlowContainer { Margin = new MarginPadding { Top = 5 }, AutoSizeAxes = Axes.Both, @@ -109,10 +109,10 @@ namespace osu.Game.Beatmaps.Drawables Children = new[] { - new FlowContainer + new FillFlowContainer { Depth = -1, - FlowStrategy = FlowStrategies.CreateHorizontalFlow(), + Direction = FlowDirection.Right, RelativeSizeAxes = Axes.Both, // This makes the gradient not be perfectly horizontal, but diagonal at a ~40° angle Shear = new Vector2(0.8f, 0), diff --git a/osu.Game/Graphics/UserInterface/OsuDropDownMenuItem.cs b/osu.Game/Graphics/UserInterface/OsuDropDownMenuItem.cs index f1f055fb6a..88179be7a3 100644 --- a/osu.Game/Graphics/UserInterface/OsuDropDownMenuItem.cs +++ b/osu.Game/Graphics/UserInterface/OsuDropDownMenuItem.cs @@ -19,9 +19,9 @@ namespace osu.Game.Graphics.UserInterface Children = new[] { - new FlowContainer + new FillFlowContainer { - FlowStrategy = FlowStrategies.CreateHorizontalFlow(), + Direction = FlowDirection.Right, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Children = new Drawable[] diff --git a/osu.Game/Graphics/UserInterface/StarCounter.cs b/osu.Game/Graphics/UserInterface/StarCounter.cs index 70b189d1d7..c1f87325ab 100644 --- a/osu.Game/Graphics/UserInterface/StarCounter.cs +++ b/osu.Game/Graphics/UserInterface/StarCounter.cs @@ -68,10 +68,11 @@ namespace osu.Game.Graphics.UserInterface Children = new Drawable[] { - stars = new FlowContainer + stars = new FillFlowContainer { AutoSizeAxes = Axes.Both, - FlowStrategy = FlowStrategies.CreateHorizontalFlow(new Vector2(star_spacing)), + Direction = FlowDirection.Right, + Spacing = new Vector2(star_spacing), } }; diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs index d1e2a9b178..04ba2fcd2f 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs @@ -33,13 +33,13 @@ namespace osu.Game.Graphics.UserInterface.Volume Children = new Drawable[] { - new FlowContainer + new FillFlowContainer { AutoSizeAxes = Axes.Both, Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, Margin = new MarginPadding { Left = 10, Right = 10, Top = 30, Bottom = 30 }, - FlowStrategy = FlowStrategies.CreateFillFlow(new Vector2(15, 0)), + Spacing = new Vector2(15, 0), Children = new Drawable[] { volumeMeterMaster = new VolumeMeter("Master"), diff --git a/osu.Game/Online/Chat/Drawables/DrawableChannel.cs b/osu.Game/Online/Chat/Drawables/DrawableChannel.cs index d665e39b24..ee8f6edd28 100644 --- a/osu.Game/Online/Chat/Drawables/DrawableChannel.cs +++ b/osu.Game/Online/Chat/Drawables/DrawableChannel.cs @@ -15,7 +15,7 @@ namespace osu.Game.Online.Chat.Drawables public class DrawableChannel : Container { private readonly Channel channel; - private FlowContainer flow; + private FillFlowContainer flow; private ScrollContainer scroll; public DrawableChannel(Channel channel) @@ -39,9 +39,9 @@ namespace osu.Game.Online.Chat.Drawables RelativeSizeAxes = Axes.Both, Children = new Drawable[] { - flow = new FlowContainer + flow = new FillFlowContainer { - FlowStrategy = FlowStrategies.CreateVerticalFlow(), + Direction = FlowDirection.Down, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Padding = new MarginPadding { Left = 20, Right = 20 } diff --git a/osu.Game/Overlays/NotificationManager.cs b/osu.Game/Overlays/NotificationManager.cs index 70d5860510..3e36113617 100644 --- a/osu.Game/Overlays/NotificationManager.cs +++ b/osu.Game/Overlays/NotificationManager.cs @@ -44,9 +44,9 @@ namespace osu.Game.Overlays Margin = new MarginPadding { Top = Toolbar.Toolbar.HEIGHT }, Children = new[] { - sections = new FlowContainer + sections = new FillFlowContainer { - FlowStrategy = FlowStrategies.CreateVerticalFlow(), + Direction = FlowDirection.Down, AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, Children = new [] diff --git a/osu.Game/Overlays/Notifications/NotificationSection.cs b/osu.Game/Overlays/Notifications/NotificationSection.cs index 90b142d5ae..7d95700431 100644 --- a/osu.Game/Overlays/Notifications/NotificationSection.cs +++ b/osu.Game/Overlays/Notifications/NotificationSection.cs @@ -16,7 +16,7 @@ using OpenTK; namespace osu.Game.Overlays.Notifications { - public class NotificationSection : FlowContainer + public class NotificationSection : FillFlowContainer { private OsuSpriteText titleText; private OsuSpriteText countText; @@ -60,7 +60,7 @@ namespace osu.Game.Overlays.Notifications { RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; - FlowStrategy = FlowStrategies.CreateVerticalFlow(); + Direction = FlowDirection.Down; Padding = new MarginPadding { @@ -85,13 +85,13 @@ namespace osu.Game.Overlays.Notifications Origin = Anchor.TopRight, Action = clearAll }, - new FlowContainer + new FillFlowContainer { Margin = new MarginPadding { Bottom = 5 }, - FlowStrategy = FlowStrategies.CreateFillFlow(new Vector2(5, 0)), + Spacing = new Vector2(5, 0), AutoSizeAxes = Axes.Both, Children = new Drawable[] { @@ -110,13 +110,13 @@ namespace osu.Game.Overlays.Notifications }, }, }, - notifications = new FlowContainer + notifications = new FillFlowContainer { AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, LayoutDuration = 150, LayoutEasing = EasingTypes.OutQuart, - FlowStrategy = FlowStrategies.CreateFillFlow(new Vector2(3)), + Spacing = new Vector2(3), } }); } diff --git a/osu.Game/Overlays/Options/OptionDropDown.cs b/osu.Game/Overlays/Options/OptionDropDown.cs index 67e995f482..7c4b82e198 100644 --- a/osu.Game/Overlays/Options/OptionDropDown.cs +++ b/osu.Game/Overlays/Options/OptionDropDown.cs @@ -14,7 +14,7 @@ using System.Collections.Generic; namespace osu.Game.Overlays.Options { - public class OptionDropDown : FlowContainer + public class OptionDropDown : FillFlowContainer { private DropDownMenu dropdown; private SpriteText text; @@ -89,7 +89,7 @@ namespace osu.Game.Overlays.Options { Items = new KeyValuePair[0]; - FlowStrategy = FlowStrategies.CreateVerticalFlow(); + Direction = FlowDirection.Down; RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; Children = new Drawable[] diff --git a/osu.Game/Overlays/Options/OptionSlider.cs b/osu.Game/Overlays/Options/OptionSlider.cs index 58635b4345..2f09c51655 100644 --- a/osu.Game/Overlays/Options/OptionSlider.cs +++ b/osu.Game/Overlays/Options/OptionSlider.cs @@ -12,7 +12,7 @@ using osu.Game.Graphics.UserInterface; namespace osu.Game.Overlays.Options { - public class OptionSlider : FlowContainer where T : struct + public class OptionSlider : FillFlowContainer where T : struct { private SliderBar slider; private SpriteText text; @@ -40,7 +40,6 @@ namespace osu.Game.Overlays.Options public OptionSlider() { - FlowStrategy = FlowStrategies.CreateFillFlow(); RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; Padding = new MarginPadding { Right = 5 }; diff --git a/osu.Game/Overlays/Options/OptionsSection.cs b/osu.Game/Overlays/Options/OptionsSection.cs index 7f01ff91d8..1775744b26 100644 --- a/osu.Game/Overlays/Options/OptionsSection.cs +++ b/osu.Game/Overlays/Options/OptionsSection.cs @@ -15,7 +15,7 @@ namespace osu.Game.Overlays.Options { public abstract class OptionsSection : Container { - protected FlowContainer FlowContent; + protected FillFlowContainer FlowContent; protected override Container Content => FlowContent; public abstract FontAwesome Icon { get; } @@ -58,10 +58,11 @@ namespace osu.Game.Overlays.Options TextSize = header_size, Text = Header, }, - FlowContent = new FlowContainer + FlowContent = new FillFlowContainer { Margin = new MarginPadding { Top = header_size + header_margin }, - FlowStrategy = FlowStrategies.CreateVerticalFlow(new Vector2(0, 30)), + Direction = FlowDirection.Down, + Spacing = new Vector2(0, 30), AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, }, diff --git a/osu.Game/Overlays/Options/OptionsSubsection.cs b/osu.Game/Overlays/Options/OptionsSubsection.cs index 7fbb2ac3b1..04b0114b22 100644 --- a/osu.Game/Overlays/Options/OptionsSubsection.cs +++ b/osu.Game/Overlays/Options/OptionsSubsection.cs @@ -9,7 +9,7 @@ using osu.Game.Graphics.Sprites; namespace osu.Game.Overlays.Options { - public abstract class OptionsSubsection : FlowContainer + public abstract class OptionsSubsection : FillFlowContainer { private Container content; protected override Container Content => content; @@ -20,7 +20,7 @@ namespace osu.Game.Overlays.Options { RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; - FlowStrategy = FlowStrategies.CreateVerticalFlow(); + Direction = FlowDirection.Down; AddInternal(new Drawable[] { new OsuSpriteText @@ -29,9 +29,10 @@ namespace osu.Game.Overlays.Options Margin = new MarginPadding { Bottom = 10 }, Font = @"Exo2.0-Black", }, - content = new FlowContainer + content = new FillFlowContainer { - FlowStrategy = FlowStrategies.CreateVerticalFlow(new Vector2(0, 5)), + Direction = FlowDirection.Down, + Spacing = new Vector2(0, 5), RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, }, diff --git a/osu.Game/Overlays/Options/Sections/EditorSection.cs b/osu.Game/Overlays/Options/Sections/EditorSection.cs index 0484806044..11d3f6b642 100644 --- a/osu.Game/Overlays/Options/Sections/EditorSection.cs +++ b/osu.Game/Overlays/Options/Sections/EditorSection.cs @@ -19,7 +19,7 @@ namespace osu.Game.Overlays.Options.Sections [BackgroundDependencyLoader] private void load(OsuConfigManager config) { - FlowContent.FlowStrategy = FlowStrategies.CreateFillFlow(new Vector2(0, 5)); + FlowContent.Spacing = new Vector2(0, 5); Children = new Drawable[] { new OsuCheckbox diff --git a/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs b/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs index 15d0a480b5..b6f5d0ea68 100644 --- a/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs +++ b/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs @@ -84,7 +84,7 @@ namespace osu.Game.Overlays.Options.Sections.General } } - class LoginForm : FlowContainer + class LoginForm : FillFlowContainer { private TextBox username; private TextBox password; @@ -100,7 +100,8 @@ namespace osu.Game.Overlays.Options.Sections.General private void load(APIAccess api, OsuConfigManager config) { this.api = api; - FlowStrategy = FlowStrategies.CreateVerticalFlow(new Vector2(0, 5)); + Direction = FlowDirection.Down; + Spacing = new Vector2(0, 5); AutoSizeAxes = Axes.Y; RelativeSizeAxes = Axes.X; Children = new Drawable[] diff --git a/osu.Game/Overlays/Options/Sections/MaintenanceSection.cs b/osu.Game/Overlays/Options/Sections/MaintenanceSection.cs index 13c479b1ee..5393c42843 100644 --- a/osu.Game/Overlays/Options/Sections/MaintenanceSection.cs +++ b/osu.Game/Overlays/Options/Sections/MaintenanceSection.cs @@ -16,7 +16,7 @@ namespace osu.Game.Overlays.Options.Sections public MaintenanceSection() { - FlowContent.FlowStrategy = FlowStrategies.CreateFillFlow(new Vector2(0, 5)); + FlowContent.Spacing = new Vector2(0, 5); Children = new Drawable[] { new OsuButton diff --git a/osu.Game/Overlays/Options/Sections/SkinSection.cs b/osu.Game/Overlays/Options/Sections/SkinSection.cs index 5e262d4109..71c460760e 100644 --- a/osu.Game/Overlays/Options/Sections/SkinSection.cs +++ b/osu.Game/Overlays/Options/Sections/SkinSection.cs @@ -20,7 +20,7 @@ namespace osu.Game.Overlays.Options.Sections [BackgroundDependencyLoader] private void load(OsuConfigManager config) { - FlowContent.FlowStrategy = FlowStrategies.CreateFillFlow(new Vector2(0, 5)); + FlowContent.Spacing = new Vector2(0, 5); Children = new Drawable[] { new OptionLabel { Text = "TODO: Skin preview textures" }, diff --git a/osu.Game/Overlays/Options/Sidebar.cs b/osu.Game/Overlays/Options/Sidebar.cs index 47b3cfa0ca..fc47ea35be 100644 --- a/osu.Game/Overlays/Options/Sidebar.cs +++ b/osu.Game/Overlays/Options/Sidebar.cs @@ -15,7 +15,7 @@ namespace osu.Game.Overlays.Options { public class Sidebar : Container { - private FlowContainer content; + private FillFlowContainer content; internal const float DEFAULT_WIDTH = ToolbarButton.WIDTH; internal const int EXPANDED_WIDTH = 200; protected override Container Content => content; @@ -34,13 +34,13 @@ namespace osu.Game.Overlays.Options { Children = new [] { - content = new FlowContainer + content = new FillFlowContainer { Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, - FlowStrategy = FlowStrategies.CreateVerticalFlow(), + Direction = FlowDirection.Down, } } }, diff --git a/osu.Game/Overlays/OptionsOverlay.cs b/osu.Game/Overlays/OptionsOverlay.cs index 8aabc98771..e88535915f 100644 --- a/osu.Game/Overlays/OptionsOverlay.cs +++ b/osu.Game/Overlays/OptionsOverlay.cs @@ -73,11 +73,11 @@ namespace osu.Game.Overlays Margin = new MarginPadding { Left = SIDEBAR_WIDTH }, Children = new[] { - new FlowContainer + new FillFlowContainer { AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, - FlowStrategy = FlowStrategies.CreateVerticalFlow(), + Direction = FlowDirection.Down, Children = new Drawable[] { @@ -94,11 +94,11 @@ namespace osu.Game.Overlays TextSize = 18, Margin = new MarginPadding { Left = CONTENT_MARGINS, Bottom = 30 }, }, - new FlowContainer + new FillFlowContainer { AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, - FlowStrategy = FlowStrategies.CreateVerticalFlow(), + Direction = FlowDirection.Down, Children = sections, } } diff --git a/osu.Game/Overlays/Pause/PauseOverlay.cs b/osu.Game/Overlays/Pause/PauseOverlay.cs index 198fe2ffef..a39a8d49d6 100644 --- a/osu.Game/Overlays/Pause/PauseOverlay.cs +++ b/osu.Game/Overlays/Pause/PauseOverlay.cs @@ -66,7 +66,7 @@ namespace osu.Game.Overlays.Pause } } - private FlowContainer retryCounterContainer; + private FillFlowContainer retryCounterContainer; public override bool Contains(Vector2 screenSpacePos) => true; public override bool HandleInput => State == Visibility.Visible; @@ -100,19 +100,21 @@ namespace osu.Game.Overlays.Pause Colour = Color4.Black, Alpha = background_alpha, }, - new FlowContainer + new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, - FlowStrategy = FlowStrategies.CreateVerticalFlow(new Vector2(0, 50)), + Direction = FlowDirection.Down, + Spacing = new Vector2(0, 50), Origin = Anchor.Centre, Anchor = Anchor.Centre, Children = new Drawable[] { - new FlowContainer + new FillFlowContainer { AutoSizeAxes = Axes.Both, - FlowStrategy = FlowStrategies.CreateVerticalFlow(new Vector2(0, 20)), + Direction = FlowDirection.Down, + Spacing = new Vector2(0, 20), Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, Children = new Drawable[] @@ -139,7 +141,7 @@ namespace osu.Game.Overlays.Pause } } }, - new FlowContainer + new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, @@ -186,7 +188,7 @@ namespace osu.Game.Overlays.Pause } } }, - retryCounterContainer = new FlowContainer + retryCounterContainer = new FillFlowContainer { AutoSizeAxes = Axes.Both, Origin = Anchor.TopCentre, diff --git a/osu.Game/Overlays/Toolbar/Toolbar.cs b/osu.Game/Overlays/Toolbar/Toolbar.cs index f9dbb6132a..afb30b31c0 100644 --- a/osu.Game/Overlays/Toolbar/Toolbar.cs +++ b/osu.Game/Overlays/Toolbar/Toolbar.cs @@ -41,9 +41,9 @@ namespace osu.Game.Overlays.Toolbar Children = new Drawable[] { new ToolbarBackground(), - new FlowContainer + new FillFlowContainer { - FlowStrategy = FlowStrategies.CreateHorizontalFlow(), + Direction = FlowDirection.Right, RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X, Children = new Drawable[] @@ -63,7 +63,7 @@ namespace osu.Game.Overlays.Toolbar { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, - FlowStrategy = FlowStrategies.CreateHorizontalFlow(), + Direction = FlowDirection.Right, RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X, Children = new Drawable[] @@ -141,7 +141,7 @@ namespace osu.Game.Overlays.Toolbar FadeOut(transition_time); } - class PassThroughFlowContainer : FlowContainer + class PassThroughFlowContainer : FillFlowContainer { //needed to get input to the login overlay. public override bool Contains(Vector2 screenSpacePos) => true; diff --git a/osu.Game/Overlays/Toolbar/ToolbarButton.cs b/osu.Game/Overlays/Toolbar/ToolbarButton.cs index 245311b739..7d1438dd1d 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarButton.cs @@ -62,10 +62,10 @@ namespace osu.Game.Overlays.Toolbar protected TextAwesome DrawableIcon; protected SpriteText DrawableText; protected Box HoverBackground; - private FlowContainer tooltipContainer; + private FillFlowContainer tooltipContainer; private SpriteText tooltip1; private SpriteText tooltip2; - protected FlowContainer Flow; + protected FillFlowContainer Flow; private SampleChannel sampleClick; public ToolbarButton() @@ -82,9 +82,10 @@ namespace osu.Game.Overlays.Toolbar BlendingMode = BlendingMode.Additive, Alpha = 0, }, - Flow = new FlowContainer + Flow = new FillFlowContainer { - FlowStrategy = FlowStrategies.CreateHorizontalFlow(new Vector2(5)), + Direction = FlowDirection.Right, + Spacing = new Vector2(5), Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Padding = new MarginPadding { Left = Toolbar.HEIGHT / 2, Right = Toolbar.HEIGHT / 2 }, @@ -104,9 +105,9 @@ namespace osu.Game.Overlays.Toolbar }, }, }, - tooltipContainer = new FlowContainer + tooltipContainer = new FillFlowContainer { - FlowStrategy = FlowStrategies.CreateVerticalFlow(), + Direction = FlowDirection.Down, RelativeSizeAxes = Axes.Both, //stops us being considered in parent's autosize Anchor = (TooltipAnchor & Anchor.x0) > 0 ? Anchor.BottomLeft : Anchor.BottomRight, Origin = TooltipAnchor, diff --git a/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs b/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs index d499238cf7..94f62ce54d 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs @@ -19,7 +19,7 @@ namespace osu.Game.Overlays.Toolbar { const float padding = 10; - private FlowContainer modeButtons; + private FillFlowContainer modeButtons; private Drawable modeButtonLine; private ToolbarModeButton activeButton; @@ -32,11 +32,11 @@ namespace osu.Game.Overlays.Toolbar Children = new Drawable[] { new OpaqueBackground(), - modeButtons = new FlowContainer + modeButtons = new FillFlowContainer { RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X, - FlowStrategy = FlowStrategies.CreateHorizontalFlow(), + Direction = FlowDirection.Right, Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Padding = new MarginPadding { Left = padding, Right = padding }, diff --git a/osu.Game/Screens/GameScreenWhiteBox.cs b/osu.Game/Screens/GameScreenWhiteBox.cs index a4adfd5201..5d486d9e4c 100644 --- a/osu.Game/Screens/GameScreenWhiteBox.cs +++ b/osu.Game/Screens/GameScreenWhiteBox.cs @@ -25,7 +25,7 @@ namespace osu.Game.Screens protected virtual IEnumerable PossibleChildren => null; - private FlowContainer childModeButtons; + private FillFlowContainer childModeButtons; private Container textContainer; private Box box; @@ -124,9 +124,9 @@ namespace osu.Game.Screens Exit(); } }, - childModeButtons = new FlowContainer + childModeButtons = new FillFlowContainer { - FlowStrategy = FlowStrategies.CreateVerticalFlow(), + Direction = FlowDirection.Down, Anchor = Anchor.TopRight, Origin = Anchor.TopRight, RelativeSizeAxes = Axes.Both, diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index e21e11dfb7..0f8ac6c31a 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -78,7 +78,8 @@ namespace osu.Game.Screens.Menu }, buttonFlow = new FlowContainerWithOrigin { - FlowStrategy = FlowStrategies.CreateHorizontalFlow(new Vector2(-WEDGE_WIDTH, 0)), + Direction = FlowDirection.Right, + Spacing = new Vector2(-WEDGE_WIDTH, 0), Anchor = Anchor.Centre, AutoSizeAxes = Axes.Both, Children = new[] diff --git a/osu.Game/Screens/Menu/Disclaimer.cs b/osu.Game/Screens/Menu/Disclaimer.cs index 3f345ddfb2..71569b1abf 100644 --- a/osu.Game/Screens/Menu/Disclaimer.cs +++ b/osu.Game/Screens/Menu/Disclaimer.cs @@ -27,12 +27,13 @@ namespace osu.Game.Screens.Menu Children = new Drawable[] { - new FlowContainer + new FillFlowContainer { AutoSizeAxes = Axes.Both, Anchor = Anchor.Centre, Origin = Anchor.Centre, - FlowStrategy = FlowStrategies.CreateVerticalFlow(new Vector2(0, 2)), + Direction = FlowDirection.Down, + Spacing = new Vector2(0, 2), Children = new Drawable[] { icon = new TextAwesome diff --git a/osu.Game/Screens/Menu/FlowContainerWithOrigin.cs b/osu.Game/Screens/Menu/FlowContainerWithOrigin.cs index f8b92dc795..d0972ea84b 100644 --- a/osu.Game/Screens/Menu/FlowContainerWithOrigin.cs +++ b/osu.Game/Screens/Menu/FlowContainerWithOrigin.cs @@ -12,7 +12,7 @@ namespace osu.Game.Screens.Menu /// /// A flow container with an origin based on one of its contained drawables. /// - public class FlowContainerWithOrigin : FlowContainer + public class FlowContainerWithOrigin : FillFlowContainer { /// /// A target drawable which this flowcontainer should be centered around. @@ -22,7 +22,7 @@ namespace osu.Game.Screens.Menu protected override IComparer DepthComparer => new ReverseCreationOrderDepthComparer(); - protected override IEnumerable SortedChildren => base.SortedChildren.Reverse(); + protected override IEnumerable FlowingChildren => base.FlowingChildren.Reverse(); public override Anchor Origin => Anchor.Custom; diff --git a/osu.Game/Screens/Play/KeyCounterCollection.cs b/osu.Game/Screens/Play/KeyCounterCollection.cs index 8772d7d7e4..a31c5a9d4d 100644 --- a/osu.Game/Screens/Play/KeyCounterCollection.cs +++ b/osu.Game/Screens/Play/KeyCounterCollection.cs @@ -8,11 +8,11 @@ using OpenTK.Graphics; namespace osu.Game.Screens.Play { - public class KeyCounterCollection : FlowContainer + public class KeyCounterCollection : FillFlowContainer { public KeyCounterCollection() { - FlowStrategy = FlowStrategies.CreateHorizontalFlow(); + Direction = FlowDirection.Right; AutoSizeAxes = Axes.Both; } diff --git a/osu.Game/Screens/Play/PlayerLoader.cs b/osu.Game/Screens/Play/PlayerLoader.cs index 2bb684ae29..bf879fc0dd 100644 --- a/osu.Game/Screens/Play/PlayerLoader.cs +++ b/osu.Game/Screens/Play/PlayerLoader.cs @@ -131,12 +131,12 @@ namespace osu.Game.Screens.Play AutoSizeAxes = Axes.Both; Children = new Drawable[] { - new FlowContainer() + new FillFlowContainer() { AutoSizeAxes = Axes.Both, Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, - FlowStrategy = FlowStrategies.CreateVerticalFlow(), + Direction = FlowDirection.Down, Children = new Drawable[] { new OsuSpriteText diff --git a/osu.Game/Screens/Ranking/Results.cs b/osu.Game/Screens/Ranking/Results.cs index 4958cbc8e2..8e6f113185 100644 --- a/osu.Game/Screens/Ranking/Results.cs +++ b/osu.Game/Screens/Ranking/Results.cs @@ -65,10 +65,10 @@ namespace osu.Game.Screens.Ranking Children = new Drawable[] { - new FlowContainer + new FillFlowContainer { AutoSizeAxes = Axes.Both, - FlowStrategy = FlowStrategies.CreateVerticalFlow(), + Direction = FlowDirection.Down, Children = new Drawable[] { new OsuSpriteText diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index 4a1df44de4..5f2bd15e16 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -121,11 +121,11 @@ namespace osu.Game.Screens.Select }, }, // Text for beatmap info - new FlowContainer + new FillFlowContainer { Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, - FlowStrategy = FlowStrategies.CreateVerticalFlow(), + Direction = FlowDirection.Down, Margin = new MarginPadding { Top = 10, Left = 25, Right = 10, Bottom = 20 }, AutoSizeAxes = Axes.Both, Children = new Drawable[] @@ -144,10 +144,10 @@ namespace osu.Game.Screens.Select TextSize = 17, Shadow = true, }, - new FlowContainer + new FillFlowContainer { Margin = new MarginPadding { Top = 10 }, - FlowStrategy = FlowStrategies.CreateHorizontalFlow(), + Direction = FlowDirection.Right, AutoSizeAxes = Axes.Both, Children = new [] { @@ -167,10 +167,10 @@ namespace osu.Game.Screens.Select }, } }, - new FlowContainer + new FillFlowContainer { Margin = new MarginPadding { Top = 20 }, - FlowStrategy = FlowStrategies.CreateFillFlow(new Vector2(40, 0)), + Spacing = new Vector2(40, 0), AutoSizeAxes = Axes.Both, Children = labels }, diff --git a/osu.Game/Screens/Select/FilterControl.cs b/osu.Game/Screens/Select/FilterControl.cs index 98eb0e43c0..f45016c5c9 100644 --- a/osu.Game/Screens/Select/FilterControl.cs +++ b/osu.Game/Screens/Select/FilterControl.cs @@ -36,7 +36,7 @@ namespace osu.Game.Screens.Select Alpha = 0.8f, RelativeSizeAxes = Axes.Both, }, - new FlowContainer + new FillFlowContainer { Padding = new MarginPadding(20), AutoSizeAxes = Axes.Y, @@ -44,7 +44,7 @@ namespace osu.Game.Screens.Select Anchor = Anchor.TopRight, Origin = Anchor.TopRight, Width = 0.4f, // TODO: InnerWidth property or something - FlowStrategy = FlowStrategies.CreateVerticalFlow(), + Direction = FlowDirection.Down, Children = new Drawable[] { searchTextBox = new SearchTextBox { @@ -174,10 +174,11 @@ namespace osu.Game.Screens.Select Origin = Anchor.BottomLeft, Anchor = Anchor.BottomLeft, }, - new FlowContainer + new FillFlowContainer { AutoSizeAxes = Axes.Both, - FlowStrategy = FlowStrategies.CreateHorizontalFlow(new Vector2(10, 0)), + Direction = FlowDirection.Right, + Spacing = new Vector2(10, 0), Children = new Drawable[] { new TabItem @@ -205,10 +206,11 @@ namespace osu.Game.Screens.Select } } }, - new FlowContainer + new FillFlowContainer { AutoSizeAxes = Axes.Both, - FlowStrategy = FlowStrategies.CreateHorizontalFlow(new Vector2(10, 0)), + Direction = FlowDirection.Right, + Spacing = new Vector2(10, 0), Origin = Anchor.TopRight, Anchor = Anchor.TopRight, Children = new Drawable[] diff --git a/osu.Game/Screens/Select/Footer.cs b/osu.Game/Screens/Select/Footer.cs index 23935b0f40..8a10f5455a 100644 --- a/osu.Game/Screens/Select/Footer.cs +++ b/osu.Game/Screens/Select/Footer.cs @@ -30,7 +30,7 @@ namespace osu.Game.Screens.Select public Action OnBack; public Action OnStart; - private FlowContainer buttons; + private FillFlowContainer buttons; public OsuLogo StartButton; @@ -91,20 +91,21 @@ namespace osu.Game.Screens.Select Origin = Anchor.BottomLeft, Action = () => OnBack?.Invoke(), }, - new FlowContainer + new FillFlowContainer { Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, Position = new Vector2(BackButton.SIZE_EXTENDED.X + padding, 0), RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X, - FlowStrategy = FlowStrategies.CreateHorizontalFlow(new Vector2(padding, 0)), + Direction = FlowDirection.Right, + Spacing = new Vector2(padding, 0), Children = new Drawable[] { - - buttons = new FlowContainer + buttons = new FillFlowContainer { - FlowStrategy = FlowStrategies.CreateHorizontalFlow(new Vector2(0.2f, 0)), + Direction = FlowDirection.Right, + Spacing = new Vector2(0.2f, 0), AutoSizeAxes = Axes.Both, } }