Skip to content

Commit 5469cac

Browse files
authored
Merge pull request #96 from ppy/master
aa
2 parents 383264f + 7b99842 commit 5469cac

3 files changed

Lines changed: 86 additions & 69 deletions

File tree

osu.Game/Screens/Play/PlayerLoader.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
using osu.Framework.Graphics.Sprites;
1616
using osu.Framework.Graphics.Transforms;
1717
using osu.Framework.Input;
18+
using osu.Framework.Platform;
1819
using osu.Framework.Screens;
1920
using osu.Framework.Threading;
2021
using osu.Framework.Utils;
@@ -105,6 +106,9 @@ public partial class PlayerLoader : ScreenWithBeatmapBackground
105106
[Cached]
106107
private OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Purple);
107108

109+
[Resolved]
110+
private GameHost host { get; set; } = null!;
111+
108112
private const double quick_restart_initial_delay = 500;
109113

110114
protected bool BackgroundBrightnessReduction
@@ -121,6 +125,7 @@ protected bool BackgroundBrightnessReduction
121125
}
122126

123127
protected virtual bool ReadyForGameplay =>
128+
host.IsActive.Value &&
124129
// not ready if the user is hovering one of the panes (logo is excluded), unless they are idle.
125130
(IsHovered || osuLogo?.IsHovered == true || idleTracker.IsIdle.Value)
126131
// not ready if the user is dragging a slider or otherwise.

osu.Game/Screens/Select/FilterControl.ScopedBeatmapSetDisplay.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,17 @@ private void updateState()
107107
{
108108
if (ScopedBeatmapSet.Value != null)
109109
{
110+
this.TransformTo(nameof(Margin), new MarginPadding { Top = 5 }, transition_duration, Easing.OutQuint);
110111
content.BypassAutoSizeAxes = Axes.None;
112+
111113
text.Clear();
112114
text.AddText(SongSelectStrings.TemporarilyShowingAllBeatmapsIn);
113115
text.AddText(@" ");
114116
text.AddText(ScopedBeatmapSet.Value.Metadata.GetDisplayTitleRomanisable(), t => t.Font = OsuFont.Style.Body.With(weight: FontWeight.Bold));
115117
}
116118
else
117119
{
120+
this.TransformTo(nameof(Margin), new MarginPadding(0), transition_duration, Easing.OutQuint);
118121
flashLayer.FadeOutFromOne(transition_duration, Easing.OutQuint);
119122
content.BypassAutoSizeAxes = Axes.Y;
120123
}

osu.Game/Screens/Select/FilterControl.cs

Lines changed: 78 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -109,99 +109,108 @@ private void load(IAPIProvider api)
109109
RelativeSizeAxes = Axes.X,
110110
AutoSizeAxes = Axes.Y,
111111
Direction = FillDirection.Vertical,
112-
Spacing = new Vector2(0f, 5f),
113112
Padding = new MarginPadding { Top = corner_radius + 5, Bottom = 2, Right = 40f, Left = 2f },
114113
Children = new Drawable[]
115114
{
116-
new Container
115+
new ReverseChildIDFillFlowContainer<Drawable>
117116
{
118117
RelativeSizeAxes = Axes.X,
119118
AutoSizeAxes = Axes.Y,
120-
Shear = -OsuGame.SHEAR,
121-
Child = searchTextBox = new SongSelectSearchTextBox
119+
Direction = FillDirection.Vertical,
120+
Spacing = new Vector2(0f, 5f),
121+
Children = new Drawable[]
122122
{
123-
RelativeSizeAxes = Axes.X,
124-
HoldFocus = true,
125-
ScopedBeatmapSet = { BindTarget = ScopedBeatmapSet },
126-
},
127-
},
128-
new GridContainer
129-
{
130-
RelativeSizeAxes = Axes.X,
131-
AutoSizeAxes = Axes.Y,
132-
Shear = -OsuGame.SHEAR,
133-
RowDimensions = new[] { new Dimension(GridSizeMode.AutoSize) },
134-
ColumnDimensions = new[]
135-
{
136-
new Dimension(),
137-
new Dimension(GridSizeMode.Absolute), // can probably be removed?
138-
new Dimension(GridSizeMode.AutoSize),
139-
},
140-
Content = new[]
141-
{
142-
new[]
123+
new Container
143124
{
144-
difficultyRangeSlider = new DifficultyRangeSlider
125+
RelativeSizeAxes = Axes.X,
126+
AutoSizeAxes = Axes.Y,
127+
Shear = -OsuGame.SHEAR,
128+
Child = searchTextBox = new SongSelectSearchTextBox
145129
{
146130
RelativeSizeAxes = Axes.X,
147-
MinRange = 0.1f,
148-
},
149-
Empty(),
150-
showConvertedBeatmapsButton = new ShearedToggleButton
151-
{
152-
Anchor = Anchor.Centre,
153-
Origin = Anchor.Centre,
154-
AutoSizeAxes = Axes.X,
155-
Text = UserInterfaceStrings.ShowConverts,
156-
Height = 30f,
131+
HoldFocus = true,
132+
ScopedBeatmapSet = { BindTarget = ScopedBeatmapSet },
157133
},
158134
},
159-
}
160-
},
161-
new GridContainer
162-
{
163-
RelativeSizeAxes = Axes.X,
164-
Height = 30,
165-
Shear = -OsuGame.SHEAR,
166-
RowDimensions = new[] { new Dimension(GridSizeMode.AutoSize) },
167-
ColumnDimensions = new[]
168-
{
169-
new Dimension(maxSize: 180),
170-
new Dimension(GridSizeMode.Absolute, 5),
171-
new Dimension(maxSize: 180),
172-
new Dimension(GridSizeMode.Absolute, 5),
173-
new Dimension(),
174-
new Dimension(GridSizeMode.AutoSize),
175-
},
176-
Content = new[]
177-
{
178-
new[]
135+
new GridContainer
179136
{
180-
sortDropdown = new ShearedDropdown<SortMode>(SongSelectStrings.Sort)
137+
RelativeSizeAxes = Axes.X,
138+
AutoSizeAxes = Axes.Y,
139+
Shear = -OsuGame.SHEAR,
140+
RowDimensions = new[] { new Dimension(GridSizeMode.AutoSize) },
141+
ColumnDimensions = new[]
181142
{
182-
RelativeSizeAxes = Axes.X,
183-
Items = Enum.GetValues<SortMode>(),
143+
new Dimension(),
144+
new Dimension(GridSizeMode.Absolute), // can probably be removed?
145+
new Dimension(GridSizeMode.AutoSize),
184146
},
185-
Empty(),
186-
groupDropdown = new ShearedDropdown<GroupMode>(SongSelectStrings.Group)
147+
Content = new[]
187148
{
188-
RelativeSizeAxes = Axes.X,
189-
Items = Enum.GetValues<GroupMode>(),
190-
},
191-
Empty(),
192-
collectionDropdown = new CollectionDropdown
149+
new[]
150+
{
151+
difficultyRangeSlider = new DifficultyRangeSlider
152+
{
153+
RelativeSizeAxes = Axes.X,
154+
MinRange = 0.1f,
155+
},
156+
Empty(),
157+
showConvertedBeatmapsButton = new ShearedToggleButton
158+
{
159+
Anchor = Anchor.Centre,
160+
Origin = Anchor.Centre,
161+
AutoSizeAxes = Axes.X,
162+
Text = UserInterfaceStrings.ShowConverts,
163+
Height = 30f,
164+
},
165+
},
166+
}
167+
},
168+
new GridContainer
169+
{
170+
RelativeSizeAxes = Axes.X,
171+
Height = 30,
172+
Shear = -OsuGame.SHEAR,
173+
RowDimensions = new[] { new Dimension(GridSizeMode.AutoSize) },
174+
ColumnDimensions = new[]
193175
{
194-
RelativeSizeAxes = Axes.X,
176+
new Dimension(maxSize: 180),
177+
new Dimension(GridSizeMode.Absolute, 5),
178+
new Dimension(maxSize: 180),
179+
new Dimension(GridSizeMode.Absolute, 5),
180+
new Dimension(),
181+
new Dimension(GridSizeMode.AutoSize),
195182
},
196-
}
197-
}
183+
Content = new[]
184+
{
185+
new[]
186+
{
187+
sortDropdown = new ShearedDropdown<SortMode>(SongSelectStrings.Sort)
188+
{
189+
RelativeSizeAxes = Axes.X,
190+
Items = Enum.GetValues<SortMode>(),
191+
},
192+
Empty(),
193+
groupDropdown = new ShearedDropdown<GroupMode>(SongSelectStrings.Group)
194+
{
195+
RelativeSizeAxes = Axes.X,
196+
Items = Enum.GetValues<GroupMode>(),
197+
},
198+
Empty(),
199+
collectionDropdown = new CollectionDropdown
200+
{
201+
RelativeSizeAxes = Axes.X,
202+
},
203+
}
204+
}
205+
},
206+
},
198207
},
199208
new ScopedBeatmapSetDisplay
200209
{
201210
ScopedBeatmapSet = { BindTarget = ScopedBeatmapSet },
202211
}
203212
},
204-
}
213+
},
205214
};
206215

207216
localUser = api.LocalUser.GetBoundCopy();

0 commit comments

Comments
 (0)