mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 12:35:34 +08:00
Save beatmap listing card size to game config
This commit is contained in:
parent
c4635f3c03
commit
beb8426d3b
@ -10,6 +10,7 @@ using osu.Framework.Extensions.LocalisationExtensions;
|
|||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
using osu.Framework.Platform;
|
using osu.Framework.Platform;
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
|
using osu.Game.Beatmaps.Drawables.Cards;
|
||||||
using osu.Game.Input;
|
using osu.Game.Input;
|
||||||
using osu.Game.Input.Bindings;
|
using osu.Game.Input.Bindings;
|
||||||
using osu.Game.Localisation;
|
using osu.Game.Localisation;
|
||||||
@ -44,6 +45,8 @@ namespace osu.Game.Configuration
|
|||||||
|
|
||||||
SetDefault(OsuSetting.ChatDisplayHeight, ChatOverlay.DEFAULT_HEIGHT, 0.2f, 1f);
|
SetDefault(OsuSetting.ChatDisplayHeight, ChatOverlay.DEFAULT_HEIGHT, 0.2f, 1f);
|
||||||
|
|
||||||
|
SetDefault(OsuSetting.BeatmapListingCardSize, BeatmapCardSize.Normal);
|
||||||
|
|
||||||
SetDefault(OsuSetting.ToolbarClockDisplayMode, ToolbarClockDisplayMode.Full);
|
SetDefault(OsuSetting.ToolbarClockDisplayMode, ToolbarClockDisplayMode.Full);
|
||||||
|
|
||||||
// Online settings
|
// Online settings
|
||||||
@ -297,6 +300,7 @@ namespace osu.Game.Configuration
|
|||||||
RandomSelectAlgorithm,
|
RandomSelectAlgorithm,
|
||||||
ShowFpsDisplay,
|
ShowFpsDisplay,
|
||||||
ChatDisplayHeight,
|
ChatDisplayHeight,
|
||||||
|
BeatmapListingCardSize,
|
||||||
ToolbarClockDisplayMode,
|
ToolbarClockDisplayMode,
|
||||||
Version,
|
Version,
|
||||||
ShowConvertedBeatmaps,
|
ShowConvertedBeatmaps,
|
||||||
|
@ -14,6 +14,7 @@ using osu.Framework.Graphics.Shapes;
|
|||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
using osu.Framework.Threading;
|
using osu.Framework.Threading;
|
||||||
using osu.Game.Beatmaps.Drawables.Cards;
|
using osu.Game.Beatmaps.Drawables.Cards;
|
||||||
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Online.API;
|
using osu.Game.Online.API;
|
||||||
using osu.Game.Online.API.Requests;
|
using osu.Game.Online.API.Requests;
|
||||||
using osu.Game.Online.API.Requests.Responses;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
@ -53,7 +54,9 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The currently selected <see cref="BeatmapCardSize"/>.
|
/// The currently selected <see cref="BeatmapCardSize"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IBindable<BeatmapCardSize> CardSize { get; } = new Bindable<BeatmapCardSize>();
|
public IBindable<BeatmapCardSize> CardSize => cardSize;
|
||||||
|
|
||||||
|
private readonly Bindable<BeatmapCardSize> cardSize = new Bindable<BeatmapCardSize>();
|
||||||
|
|
||||||
private readonly BeatmapListingSearchControl searchControl;
|
private readonly BeatmapListingSearchControl searchControl;
|
||||||
private readonly BeatmapListingSortTabControl sortControl;
|
private readonly BeatmapListingSortTabControl sortControl;
|
||||||
@ -128,6 +131,9 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private OsuConfigManager config { get; set; }
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OverlayColourProvider colourProvider, IAPIProvider api)
|
private void load(OverlayColourProvider colourProvider, IAPIProvider api)
|
||||||
{
|
{
|
||||||
@ -141,6 +147,8 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
|
config.BindWith(OsuSetting.BeatmapListingCardSize, cardSize);
|
||||||
|
|
||||||
var sortCriteria = sortControl.Current;
|
var sortCriteria = sortControl.Current;
|
||||||
var sortDirection = sortControl.SortDirection;
|
var sortDirection = sortControl.SortDirection;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user