Skip to content
Merged

aa #96

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions osu.Game/Screens/Play/PlayerLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Framework.Input;
using osu.Framework.Platform;
using osu.Framework.Screens;
using osu.Framework.Threading;
using osu.Framework.Utils;
Expand Down Expand Up @@ -105,6 +106,9 @@ public partial class PlayerLoader : ScreenWithBeatmapBackground
[Cached]
private OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Purple);

[Resolved]
private GameHost host { get; set; } = null!;

private const double quick_restart_initial_delay = 500;

protected bool BackgroundBrightnessReduction
Expand All @@ -121,6 +125,7 @@ protected bool BackgroundBrightnessReduction
}

protected virtual bool ReadyForGameplay =>
host.IsActive.Value &&
// not ready if the user is hovering one of the panes (logo is excluded), unless they are idle.
(IsHovered || osuLogo?.IsHovered == true || idleTracker.IsIdle.Value)
// not ready if the user is dragging a slider or otherwise.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,17 @@ private void updateState()
{
if (ScopedBeatmapSet.Value != null)
{
this.TransformTo(nameof(Margin), new MarginPadding { Top = 5 }, transition_duration, Easing.OutQuint);
content.BypassAutoSizeAxes = Axes.None;

text.Clear();
text.AddText(SongSelectStrings.TemporarilyShowingAllBeatmapsIn);
text.AddText(@" ");
text.AddText(ScopedBeatmapSet.Value.Metadata.GetDisplayTitleRomanisable(), t => t.Font = OsuFont.Style.Body.With(weight: FontWeight.Bold));
}
else
{
this.TransformTo(nameof(Margin), new MarginPadding(0), transition_duration, Easing.OutQuint);
flashLayer.FadeOutFromOne(transition_duration, Easing.OutQuint);
content.BypassAutoSizeAxes = Axes.Y;
}
Expand Down
147 changes: 78 additions & 69 deletions osu.Game/Screens/Select/FilterControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,99 +109,108 @@ private void load(IAPIProvider api)
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical,
Spacing = new Vector2(0f, 5f),
Padding = new MarginPadding { Top = corner_radius + 5, Bottom = 2, Right = 40f, Left = 2f },
Children = new Drawable[]
{
new Container
new ReverseChildIDFillFlowContainer<Drawable>
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Shear = -OsuGame.SHEAR,
Child = searchTextBox = new SongSelectSearchTextBox
Direction = FillDirection.Vertical,
Spacing = new Vector2(0f, 5f),
Children = new Drawable[]
{
RelativeSizeAxes = Axes.X,
HoldFocus = true,
ScopedBeatmapSet = { BindTarget = ScopedBeatmapSet },
},
},
new GridContainer
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Shear = -OsuGame.SHEAR,
RowDimensions = new[] { new Dimension(GridSizeMode.AutoSize) },
ColumnDimensions = new[]
{
new Dimension(),
new Dimension(GridSizeMode.Absolute), // can probably be removed?
new Dimension(GridSizeMode.AutoSize),
},
Content = new[]
{
new[]
new Container
{
difficultyRangeSlider = new DifficultyRangeSlider
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Shear = -OsuGame.SHEAR,
Child = searchTextBox = new SongSelectSearchTextBox
{
RelativeSizeAxes = Axes.X,
MinRange = 0.1f,
},
Empty(),
showConvertedBeatmapsButton = new ShearedToggleButton
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
AutoSizeAxes = Axes.X,
Text = UserInterfaceStrings.ShowConverts,
Height = 30f,
HoldFocus = true,
ScopedBeatmapSet = { BindTarget = ScopedBeatmapSet },
},
},
}
},
new GridContainer
{
RelativeSizeAxes = Axes.X,
Height = 30,
Shear = -OsuGame.SHEAR,
RowDimensions = new[] { new Dimension(GridSizeMode.AutoSize) },
ColumnDimensions = new[]
{
new Dimension(maxSize: 180),
new Dimension(GridSizeMode.Absolute, 5),
new Dimension(maxSize: 180),
new Dimension(GridSizeMode.Absolute, 5),
new Dimension(),
new Dimension(GridSizeMode.AutoSize),
},
Content = new[]
{
new[]
new GridContainer
{
sortDropdown = new ShearedDropdown<SortMode>(SongSelectStrings.Sort)
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Shear = -OsuGame.SHEAR,
RowDimensions = new[] { new Dimension(GridSizeMode.AutoSize) },
ColumnDimensions = new[]
{
RelativeSizeAxes = Axes.X,
Items = Enum.GetValues<SortMode>(),
new Dimension(),
new Dimension(GridSizeMode.Absolute), // can probably be removed?
new Dimension(GridSizeMode.AutoSize),
},
Empty(),
groupDropdown = new ShearedDropdown<GroupMode>(SongSelectStrings.Group)
Content = new[]
{
RelativeSizeAxes = Axes.X,
Items = Enum.GetValues<GroupMode>(),
},
Empty(),
collectionDropdown = new CollectionDropdown
new[]
{
difficultyRangeSlider = new DifficultyRangeSlider
{
RelativeSizeAxes = Axes.X,
MinRange = 0.1f,
},
Empty(),
showConvertedBeatmapsButton = new ShearedToggleButton
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
AutoSizeAxes = Axes.X,
Text = UserInterfaceStrings.ShowConverts,
Height = 30f,
},
},
}
},
new GridContainer
{
RelativeSizeAxes = Axes.X,
Height = 30,
Shear = -OsuGame.SHEAR,
RowDimensions = new[] { new Dimension(GridSizeMode.AutoSize) },
ColumnDimensions = new[]
{
RelativeSizeAxes = Axes.X,
new Dimension(maxSize: 180),
new Dimension(GridSizeMode.Absolute, 5),
new Dimension(maxSize: 180),
new Dimension(GridSizeMode.Absolute, 5),
new Dimension(),
new Dimension(GridSizeMode.AutoSize),
},
}
}
Content = new[]
{
new[]
{
sortDropdown = new ShearedDropdown<SortMode>(SongSelectStrings.Sort)
{
RelativeSizeAxes = Axes.X,
Items = Enum.GetValues<SortMode>(),
},
Empty(),
groupDropdown = new ShearedDropdown<GroupMode>(SongSelectStrings.Group)
{
RelativeSizeAxes = Axes.X,
Items = Enum.GetValues<GroupMode>(),
},
Empty(),
collectionDropdown = new CollectionDropdown
{
RelativeSizeAxes = Axes.X,
},
}
}
},
},
},
new ScopedBeatmapSetDisplay
{
ScopedBeatmapSet = { BindTarget = ScopedBeatmapSet },
}
},
}
},
};

localUser = api.LocalUser.GetBoundCopy();
Expand Down
Loading