1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-23 16:27:20 +08:00

Merge pull request #404 from default0/flowcontainer-refactor

Flowcontainer refactor
This commit is contained in:
Dean Herbert 2017-03-02 16:42:03 +09:00 committed by GitHub
commit 66cea49ba6
42 changed files with 128 additions and 126 deletions

@ -1 +1 @@
Subproject commit 4c0762eec20d2a3063df908a49432326570bea9f
Subproject commit 0b11b8b1ed740ab74371cf178b5d956ac7bc1547

View File

@ -95,7 +95,7 @@ namespace osu.Desktop.VisualTests.Tests
AddButton(@"slider", () => load(HitObjectType.Slider));
AddButton(@"spinner", () => load(HitObjectType.Spinner));
AddToggle(@"auto", () => { auto = !auto; load(mode); });
AddToggle(@"auto", (state) => { auto = state; load(mode); });
ButtonsContainer.Add(new SpriteText { Text = "Playback Speed" });
ButtonsContainer.Add(new BasicSliderBar<double>

View File

@ -5,6 +5,7 @@ using osu.Framework.Screens.Testing;
using osu.Framework.Graphics;
using osu.Framework.Timing;
using osu.Game.Overlays;
using osu.Framework.Graphics.Containers;
namespace osu.Desktop.VisualTests.Tests
{
@ -30,7 +31,7 @@ namespace osu.Desktop.VisualTests.Tests
Anchor = Anchor.Centre
};
Add(mc);
AddToggle(@"Show", mc.ToggleVisibility);
AddToggle(@"Show", (state) => mc.State = state ? Visibility.Visible : Visibility.Hidden);
}
}
}

View File

@ -8,6 +8,7 @@ using osu.Framework.MathUtils;
using osu.Game.Overlays;
using System.Linq;
using osu.Game.Overlays.Notifications;
using osu.Framework.Graphics.Containers;
namespace osu.Desktop.VisualTests.Tests
{
@ -30,7 +31,7 @@ namespace osu.Desktop.VisualTests.Tests
Origin = Anchor.TopRight,
});
AddToggle(@"show", manager.ToggleVisibility);
AddToggle(@"show", (state) => manager.State = state ? Visibility.Visible : Visibility.Hidden);
AddButton(@"simple #1", sendNotification1);
AddButton(@"simple #2", sendNotification2);

View File

@ -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),

View File

@ -57,19 +57,19 @@ namespace osu.Desktop.Overlays
Children = new Drawable[]
{
new FlowContainer
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Direction = FlowDirections.Vertical,
Direction = FillDirection.Down,
Children = new Drawable[]
{
new FlowContainer
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Direction = FlowDirections.Horizontal,
Direction = FillDirection.Right,
Spacing = new Vector2(5),
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Spacing = new Vector2(5),
Children = new Drawable[]
{
new OsuSpriteText
@ -95,6 +95,8 @@ namespace osu.Desktop.Overlays
},
new Sprite
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Texture = textures.Get(@"Menu/dev-build-footer"),
},
}

View File

@ -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,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
AutoSizeAxes = Axes.Both;
Origin = Anchor.Centre;
Direction = FlowDirections.Vertical;
Direction = FillDirection.Down;
Spacing = new Vector2(0, 2);
Position = (h?.StackedEndPosition ?? Vector2.Zero) + judgement.PositionOffset;

View File

@ -64,7 +64,7 @@ namespace osu.Game.Beatmaps.Drawables
BeatmapSet = beatmapSet;
WorkingBeatmap beatmap = database.GetWorkingBeatmap(BeatmapSet.Beatmaps.FirstOrDefault());
foreach (var b in BeatmapSet.Beatmaps)
b.StarDifficulty = (float)(database.GetWorkingBeatmap(b).Beatmap?.CalculateStarDifficulty() ?? 0);
b.StarDifficulty = (float)(database.GetWorkingBeatmap(b).Beatmap?.CalculateStarDifficulty() ?? -1f);
Header = new BeatmapSetHeader(beatmap)
{

View File

@ -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),
Direction = FlowDirections.Horizontal,
Direction = FillDirection.Right,
AutoSizeAxes = Axes.Both,
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
@ -98,18 +98,18 @@ namespace osu.Game.Beatmaps.Drawables
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
},
new FlowContainer
new FillFlowContainer
{
Padding = new MarginPadding { Left = 5 },
Direction = FlowDirections.Vertical,
Direction = FillDirection.Down,
AutoSizeAxes = Axes.Both,
Children = new Drawable[]
{
new FlowContainer
new FillFlowContainer
{
Direction = FlowDirections.Horizontal,
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Right,
Spacing = new Vector2(4, 0),
AutoSizeAxes = Axes.Both,
Children = new[]
{
new OsuSpriteText

View File

@ -24,7 +24,7 @@ namespace osu.Game.Beatmaps.Drawables
private OsuConfigManager config;
private Bindable<bool> 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
{
Direction = FlowDirections.Vertical,
Direction = FillDirection.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,
Direction = FlowDirections.Horizontal,
Direction = FillDirection.Right,
RelativeSizeAxes = Axes.Both,
// This makes the gradient not be perfectly horizontal, but diagonal at a ~40° angle
Shear = new Vector2(0.8f, 0),

View File

@ -19,9 +19,9 @@ namespace osu.Game.Graphics.UserInterface
Children = new[]
{
new FlowContainer
new FillFlowContainer
{
Direction = FlowDirections.Horizontal,
Direction = FillDirection.Right,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Children = new Drawable[]

View File

@ -68,10 +68,10 @@ namespace osu.Game.Graphics.UserInterface
Children = new Drawable[]
{
stars = new FlowContainer<Star>
stars = new FillFlowContainer<Star>
{
AutoSizeAxes = Axes.Both,
Direction = FlowDirections.Horizontal,
Direction = FillDirection.Right,
Spacing = new Vector2(star_spacing),
}
};

View File

@ -33,7 +33,7 @@ namespace osu.Game.Graphics.UserInterface.Volume
Children = new Drawable[]
{
new FlowContainer
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Anchor = Anchor.BottomRight,

View File

@ -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
{
Direction = FlowDirections.Vertical,
Direction = FillDirection.Down,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Padding = new MarginPadding { Left = 20, Right = 20 }

View File

@ -44,9 +44,9 @@ namespace osu.Game.Overlays
Margin = new MarginPadding { Top = Toolbar.Toolbar.HEIGHT },
Children = new[]
{
sections = new FlowContainer<NotificationSection>
sections = new FillFlowContainer<NotificationSection>
{
Direction = FlowDirections.Vertical,
Direction = FillDirection.Down,
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
Children = new []

View File

@ -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;
Direction = FlowDirections.Vertical;
Direction = FillDirection.Down;
Padding = new MarginPadding
{
@ -85,7 +85,7 @@ namespace osu.Game.Overlays.Notifications
Origin = Anchor.TopRight,
Action = clearAll
},
new FlowContainer
new FillFlowContainer
{
Margin = new MarginPadding
{
@ -110,7 +110,7 @@ namespace osu.Game.Overlays.Notifications
},
},
},
notifications = new FlowContainer<Notification>
notifications = new FillFlowContainer<Notification>
{
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,

View File

@ -14,7 +14,7 @@ using System.Collections.Generic;
namespace osu.Game.Overlays.Options
{
public class OptionDropDown<T> : FlowContainer
public class OptionDropDown<T> : FillFlowContainer
{
private DropDownMenu<T> dropdown;
private SpriteText text;
@ -89,7 +89,7 @@ namespace osu.Game.Overlays.Options
{
Items = new KeyValuePair<string, T>[0];
Direction = FlowDirections.Vertical;
Direction = FillDirection.Down;
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Children = new Drawable[]

View File

@ -12,7 +12,7 @@ using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options
{
public class OptionSlider<T> : FlowContainer where T : struct
public class OptionSlider<T> : FillFlowContainer where T : struct
{
private SliderBar<T> slider;
private SpriteText text;
@ -40,7 +40,6 @@ namespace osu.Game.Overlays.Options
public OptionSlider()
{
Direction = FlowDirections.Vertical;
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Padding = new MarginPadding { Right = 5 };

View File

@ -15,7 +15,7 @@ namespace osu.Game.Overlays.Options
{
public abstract class OptionsSection : Container
{
protected FlowContainer FlowContent;
protected FillFlowContainer FlowContent;
protected override Container<Drawable> Content => FlowContent;
public abstract FontAwesome Icon { get; }
@ -58,10 +58,10 @@ namespace osu.Game.Overlays.Options
TextSize = header_size,
Text = Header,
},
FlowContent = new FlowContainer
FlowContent = new FillFlowContainer
{
Margin = new MarginPadding { Top = header_size + header_margin },
Direction = FlowDirections.Vertical,
Direction = FillDirection.Down,
Spacing = new Vector2(0, 30),
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,

View File

@ -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<Drawable> content;
protected override Container<Drawable> Content => content;
@ -20,7 +20,7 @@ namespace osu.Game.Overlays.Options
{
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Direction = FlowDirections.Vertical;
Direction = FillDirection.Down;
AddInternal(new Drawable[]
{
new OsuSpriteText
@ -29,12 +29,12 @@ namespace osu.Game.Overlays.Options
Margin = new MarginPadding { Bottom = 10 },
Font = @"Exo2.0-Black",
},
content = new FlowContainer
content = new FillFlowContainer
{
Direction = FlowDirections.Vertical,
Direction = FillDirection.Down,
Spacing = new Vector2(0, 5),
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Spacing = new Vector2(0, 5),
},
});
}

View File

@ -7,6 +7,7 @@ using osu.Game.Configuration;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
using OpenTK;
using osu.Framework.Graphics.Containers;
namespace osu.Game.Overlays.Options.Sections
{

View File

@ -84,7 +84,7 @@ namespace osu.Game.Overlays.Options.Sections.General
}
}
class LoginForm : FlowContainer
class LoginForm : FillFlowContainer
{
private TextBox username;
private TextBox password;
@ -100,10 +100,10 @@ namespace osu.Game.Overlays.Options.Sections.General
private void load(APIAccess api, OsuConfigManager config)
{
this.api = api;
Direction = FlowDirections.Vertical;
Direction = FillDirection.Down;
Spacing = new Vector2(0, 5);
AutoSizeAxes = Axes.Y;
RelativeSizeAxes = Axes.X;
Spacing = new Vector2(0, 5);
Children = new Drawable[]
{
username = new OsuTextBox

View File

@ -5,6 +5,7 @@ using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
using OpenTK;
using osu.Framework.Graphics.Containers;
namespace osu.Game.Overlays.Options.Sections
{

View File

@ -8,6 +8,7 @@ using osu.Game.Configuration;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
using OpenTK;
using osu.Framework.Graphics.Containers;
namespace osu.Game.Overlays.Options.Sections
{

View File

@ -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<Drawable> 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,
Direction = FlowDirections.Vertical
Direction = FillDirection.Down,
}
}
},

View File

@ -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,
Direction = FlowDirections.Vertical,
Direction = FillDirection.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,
Direction = FlowDirections.Vertical,
Direction = FillDirection.Down,
Children = sections,
}
}

View File

@ -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,21 +100,21 @@ namespace osu.Game.Overlays.Pause
Colour = Color4.Black,
Alpha = background_alpha,
},
new FlowContainer
new FillFlowContainer
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FlowDirections.Vertical,
Spacing = new Vector2(0f, 50f),
Direction = FillDirection.Down,
Spacing = new Vector2(0, 50),
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
Children = new Drawable[]
{
new FlowContainer
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Direction = FlowDirections.Vertical,
Spacing = new Vector2(0f, 20f),
Direction = FillDirection.Down,
Spacing = new Vector2(0, 20),
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre,
Children = new Drawable[]
@ -141,7 +141,7 @@ namespace osu.Game.Overlays.Pause
}
}
},
new FlowContainer
new FillFlowContainer
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
@ -188,7 +188,7 @@ namespace osu.Game.Overlays.Pause
}
}
},
retryCounterContainer = new FlowContainer
retryCounterContainer = new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Origin = Anchor.TopCentre,

View File

@ -41,9 +41,9 @@ namespace osu.Game.Overlays.Toolbar
Children = new Drawable[]
{
new ToolbarBackground(),
new FlowContainer
new FillFlowContainer
{
Direction = FlowDirections.Horizontal,
Direction = FillDirection.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,
Direction = FlowDirections.Horizontal,
Direction = FillDirection.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;

View File

@ -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,21 +82,21 @@ namespace osu.Game.Overlays.Toolbar
BlendingMode = BlendingMode.Additive,
Alpha = 0,
},
Flow = new FlowContainer
Flow = new FillFlowContainer
{
Direction = FlowDirections.Horizontal,
Direction = FillDirection.Right,
Spacing = new Vector2(5),
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Padding = new MarginPadding { Left = Toolbar.HEIGHT / 2, Right = Toolbar.HEIGHT / 2 },
Spacing = new Vector2(5),
RelativeSizeAxes = Axes.Y,
AutoSizeAxes = Axes.X,
Children = new Drawable[]
{
DrawableIcon = new TextAwesome
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
},
DrawableText = new OsuSpriteText
{
@ -105,9 +105,9 @@ namespace osu.Game.Overlays.Toolbar
},
},
},
tooltipContainer = new FlowContainer
tooltipContainer = new FillFlowContainer
{
Direction = FlowDirections.Vertical,
Direction = FillDirection.Down,
RelativeSizeAxes = Axes.Both, //stops us being considered in parent's autosize
Anchor = (TooltipAnchor & Anchor.x0) > 0 ? Anchor.BottomLeft : Anchor.BottomRight,
Origin = TooltipAnchor,

View File

@ -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,
Direction = FlowDirections.Horizontal,
Direction = FillDirection.Right,
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Padding = new MarginPadding { Left = padding, Right = padding },

View File

@ -25,7 +25,7 @@ namespace osu.Game.Screens
protected virtual IEnumerable<Type> 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
{
Direction = FlowDirections.Vertical,
Direction = FillDirection.Down,
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
RelativeSizeAxes = Axes.Both,

View File

@ -114,7 +114,7 @@ namespace osu.Game.Screens.Menu
new OsuSpriteText
{
Shadow = true,
Direction = FlowDirections.Horizontal,
AllowMultiline = false,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
TextSize = 16,

View File

@ -78,16 +78,16 @@ namespace osu.Game.Screens.Menu
},
buttonFlow = new FlowContainerWithOrigin
{
Direction = FlowDirections.Horizontal,
Direction = FillDirection.Right,
Spacing = new Vector2(-WEDGE_WIDTH, 0),
Anchor = Anchor.Centre,
AutoSizeAxes = Axes.Both,
Spacing = new Vector2(-WEDGE_WIDTH, 0),
Children = new[]
{
settingsButton = new Button(@"settings", @"options", FontAwesome.fa_gear, new Color4(85, 85, 85, 255), () => OnSettings?.Invoke(), -WEDGE_WIDTH, Key.O),
backButton = new Button(@"back", @"back", FontAwesome.fa_osu_left_o, new Color4(51, 58, 94, 255), onBack, -WEDGE_WIDTH),
iconFacade = new Container //need a container to make the osu! icon flow properly.
{
{
Size = new Vector2(0, BUTTON_AREA_HEIGHT)
}
},

View File

@ -27,12 +27,12 @@ namespace osu.Game.Screens.Menu
Children = new Drawable[]
{
new FlowContainer
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Direction = FlowDirections.Vertical,
Direction = FillDirection.Down,
Spacing = new Vector2(0, 2),
Children = new Drawable[]
{

View File

@ -12,7 +12,7 @@ namespace osu.Game.Screens.Menu
/// <summary>
/// A flow container with an origin based on one of its contained drawables.
/// </summary>
public class FlowContainerWithOrigin : FlowContainer
public class FlowContainerWithOrigin : FillFlowContainer
{
/// <summary>
/// A target drawable which this flowcontainer should be centered around.
@ -22,7 +22,7 @@ namespace osu.Game.Screens.Menu
protected override IComparer<Drawable> DepthComparer => new ReverseCreationOrderDepthComparer();
protected override IEnumerable<Drawable> SortedChildren => base.SortedChildren.Reverse();
protected override IEnumerable<Drawable> FlowingChildren => base.FlowingChildren.Reverse();
public override Anchor Origin => Anchor.Custom;

View File

@ -8,11 +8,11 @@ using OpenTK.Graphics;
namespace osu.Game.Screens.Play
{
public class KeyCounterCollection : FlowContainer<KeyCounter>
public class KeyCounterCollection : FillFlowContainer<KeyCounter>
{
public KeyCounterCollection()
{
Direction = FlowDirections.Horizontal;
Direction = FillDirection.Right;
AutoSizeAxes = Axes.Both;
}

View File

@ -152,7 +152,6 @@ namespace osu.Game.Screens.Play
playerInputManager = new PlayerInputManager(game.Host)
{
Clock = new InterpolatingFramedClock(sourceClock),
PassThrough = false,
Children = new Drawable[]
{
hitRenderer,
@ -196,7 +195,6 @@ namespace osu.Game.Screens.Play
if (canPause || force)
{
lastPauseActionTime = Time.Current;
playerInputManager.PassThrough = true;
scoreOverlay.KeyCounter.IsCounting = false;
pauseOverlay.Retries = RestartCount;
pauseOverlay.Show();
@ -212,7 +210,6 @@ namespace osu.Game.Screens.Play
public void Resume()
{
lastPauseActionTime = Time.Current;
playerInputManager.PassThrough = false;
scoreOverlay.KeyCounter.IsCounting = true;
pauseOverlay.Hide();
sourceClock.Start();

View File

@ -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,
Direction = FlowDirections.Vertical,
Direction = FillDirection.Down,
Children = new Drawable[]
{
new OsuSpriteText

View File

@ -65,10 +65,10 @@ namespace osu.Game.Screens.Ranking
Children = new Drawable[]
{
new FlowContainer
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Direction = FlowDirections.Vertical,
Direction = FillDirection.Down,
Children = new Drawable[]
{
new OsuSpriteText

View File

@ -121,11 +121,11 @@ namespace osu.Game.Screens.Select
},
},
// Text for beatmap info
new FlowContainer
new FillFlowContainer
{
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft,
Direction = FlowDirections.Vertical,
Direction = FillDirection.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 },
Direction = FlowDirections.Horizontal,
Direction = FillDirection.Right,
AutoSizeAxes = Axes.Both,
Children = new []
{
@ -167,10 +167,10 @@ namespace osu.Game.Screens.Select
},
}
},
new FlowContainer
new FillFlowContainer
{
Margin = new MarginPadding { Top = 20 },
Spacing = new Vector2(40,0),
Spacing = new Vector2(40, 0),
AutoSizeAxes = Axes.Both,
Children = labels
},

View File

@ -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
Direction = FlowDirections.Vertical,
Direction = FillDirection.Down,
Children = new Drawable[]
{
searchTextBox = new SearchTextBox {
@ -174,10 +174,10 @@ namespace osu.Game.Screens.Select
Origin = Anchor.BottomLeft,
Anchor = Anchor.BottomLeft,
},
new FlowContainer
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Direction = FlowDirections.Horizontal,
Direction = FillDirection.Right,
Spacing = new Vector2(10, 0),
Children = new Drawable[]
{
@ -206,10 +206,10 @@ namespace osu.Game.Screens.Select
}
}
},
new FlowContainer
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Direction = FlowDirections.Horizontal,
Direction = FillDirection.Right,
Spacing = new Vector2(10, 0),
Origin = Anchor.TopRight,
Anchor = Anchor.TopRight,

View File

@ -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,21 +91,20 @@ 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,
Direction = FlowDirections.Horizontal,
Direction = FillDirection.Right,
Spacing = new Vector2(padding, 0),
Children = new Drawable[]
{
buttons = new FlowContainer
buttons = new FillFlowContainer
{
Direction = FlowDirections.Horizontal,
Direction = FillDirection.Right,
Spacing = new Vector2(0.2f, 0),
AutoSizeAxes = Axes.Both,
}