2023-06-23 01:37:25 +09:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
2019-01-25 11:17:48 +01:00
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2020-11-11 12:19:01 +09:00
|
|
|
|
using System;
|
2020-11-11 12:54:39 +09:00
|
|
|
|
using System.Diagnostics;
|
2022-11-08 18:24:57 +09:00
|
|
|
|
using osu.Framework.Bindables;
|
2018-04-13 18:19:50 +09:00
|
|
|
|
using osu.Framework.Configuration;
|
2018-05-02 19:37:47 +09:00
|
|
|
|
using osu.Framework.Configuration.Tracking;
|
2019-01-04 14:18:29 +09:00
|
|
|
|
using osu.Framework.Extensions;
|
2021-10-10 19:35:25 -07:00
|
|
|
|
using osu.Framework.Extensions.LocalisationExtensions;
|
2021-10-11 01:02:26 -07:00
|
|
|
|
using osu.Framework.Localisation;
|
2018-04-13 18:19:50 +09:00
|
|
|
|
using osu.Framework.Platform;
|
2022-04-02 18:36:49 +03:00
|
|
|
|
using osu.Game.Beatmaps.Drawables.Cards;
|
2020-08-16 11:04:28 +09:30
|
|
|
|
using osu.Game.Input;
|
2020-11-11 12:54:39 +09:00
|
|
|
|
using osu.Game.Input.Bindings;
|
2021-10-10 19:35:25 -07:00
|
|
|
|
using osu.Game.Localisation;
|
2018-04-13 18:19:50 +09:00
|
|
|
|
using osu.Game.Overlays;
|
2022-06-21 13:03:46 +02:00
|
|
|
|
using osu.Game.Overlays.Mods.Input;
|
2018-06-08 03:17:12 +09:00
|
|
|
|
using osu.Game.Rulesets.Scoring;
|
2024-01-15 14:30:27 +09:00
|
|
|
|
using osu.Game.Screens.OnlinePlay.Lounge.Components;
|
2018-04-13 18:19:50 +09:00
|
|
|
|
using osu.Game.Screens.Select;
|
2019-08-23 13:15:38 +02:00
|
|
|
|
using osu.Game.Screens.Select.Filter;
|
2021-12-01 12:45:47 +09:00
|
|
|
|
using osu.Game.Skinning;
|
2024-01-02 14:04:40 +01:00
|
|
|
|
using osu.Game.Users;
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Configuration
|
|
|
|
|
{
|
2022-11-08 18:24:57 +09:00
|
|
|
|
public class OsuConfigManager : IniConfigManager<OsuSetting>, IGameplaySettings
|
2018-04-13 18:19:50 +09:00
|
|
|
|
{
|
2022-08-22 17:03:20 +09:00
|
|
|
|
public OsuConfigManager(Storage storage)
|
|
|
|
|
: base(storage)
|
|
|
|
|
{
|
|
|
|
|
Migrate();
|
|
|
|
|
}
|
|
|
|
|
|
2018-04-13 18:19:50 +09:00
|
|
|
|
protected override void InitialiseDefaults()
|
|
|
|
|
{
|
|
|
|
|
// UI/selection defaults
|
2021-11-22 17:40:43 +09:00
|
|
|
|
SetDefault(OsuSetting.Ruleset, string.Empty);
|
2022-09-27 17:41:55 +09:00
|
|
|
|
SetDefault(OsuSetting.Skin, SkinInfo.ARGON_SKIN.ToString());
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2023-12-19 19:31:05 +09:00
|
|
|
|
SetDefault(OsuSetting.BeatmapDetailTab, PlayBeatmapDetailArea.TabType.Local);
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.BeatmapDetailModsFilter, false);
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.ShowConvertedBeatmaps, true);
|
|
|
|
|
SetDefault(OsuSetting.DisplayStarsMinimum, 0.0, 0, 10, 0.1);
|
|
|
|
|
SetDefault(OsuSetting.DisplayStarsMaximum, 10.1, 0, 10.1, 0.1);
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.SongSelectGroupingMode, GroupMode.All);
|
|
|
|
|
SetDefault(OsuSetting.SongSelectSortingMode, SortMode.Title);
|
2019-08-23 13:15:38 +02:00
|
|
|
|
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.RandomSelectAlgorithm, RandomSelectAlgorithm.RandomPermutation);
|
2022-06-21 13:03:46 +02:00
|
|
|
|
SetDefault(OsuSetting.ModSelectHotkeyStyle, ModSelectHotkeyStyle.Sequential);
|
2023-12-14 09:23:03 +01:00
|
|
|
|
SetDefault(OsuSetting.ModSelectTextSearchStartsActive, true);
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2022-05-30 17:54:09 +09:00
|
|
|
|
SetDefault(OsuSetting.ChatDisplayHeight, ChatOverlay.DEFAULT_HEIGHT, 0.2f, 1f);
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2022-04-02 18:36:49 +03:00
|
|
|
|
SetDefault(OsuSetting.BeatmapListingCardSize, BeatmapCardSize.Normal);
|
|
|
|
|
|
2023-01-24 23:30:07 +01:00
|
|
|
|
SetDefault(OsuSetting.ProfileCoverExpanded, true);
|
|
|
|
|
|
2022-03-26 19:18:41 +09:00
|
|
|
|
SetDefault(OsuSetting.ToolbarClockDisplayMode, ToolbarClockDisplayMode.Full);
|
|
|
|
|
|
2023-01-25 16:28:38 +09:00
|
|
|
|
SetDefault(OsuSetting.SongSelectBackgroundBlur, true);
|
2023-01-23 13:53:31 +01:00
|
|
|
|
|
2018-04-13 18:19:50 +09:00
|
|
|
|
// Online settings
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.Username, string.Empty);
|
|
|
|
|
SetDefault(OsuSetting.Token, string.Empty);
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2024-08-07 19:01:47 +09:00
|
|
|
|
SetDefault(OsuSetting.AutomaticallyDownloadMissingBeatmaps, true);
|
2020-10-28 19:03:01 +09:00
|
|
|
|
|
2024-03-12 20:14:50 +08:00
|
|
|
|
SetDefault(OsuSetting.SavePassword, true).ValueChanged += enabled =>
|
2018-04-13 18:19:50 +09:00
|
|
|
|
{
|
2024-02-22 09:44:59 +01:00
|
|
|
|
if (enabled.NewValue)
|
|
|
|
|
SetValue(OsuSetting.SaveUsername, true);
|
|
|
|
|
else
|
|
|
|
|
GetBindable<string>(OsuSetting.Token).SetDefault();
|
2018-04-13 18:19:50 +09:00
|
|
|
|
};
|
|
|
|
|
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.SaveUsername, true).ValueChanged += enabled =>
|
2018-04-13 18:19:50 +09:00
|
|
|
|
{
|
2024-02-22 09:44:59 +01:00
|
|
|
|
if (!enabled.NewValue)
|
|
|
|
|
{
|
|
|
|
|
GetBindable<string>(OsuSetting.Username).SetDefault();
|
|
|
|
|
SetValue(OsuSetting.SavePassword, false);
|
|
|
|
|
}
|
2018-04-13 18:19:50 +09:00
|
|
|
|
};
|
|
|
|
|
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.ExternalLinkWarning, true);
|
|
|
|
|
SetDefault(OsuSetting.PreferNoVideo, false);
|
2018-10-22 23:57:37 +03:00
|
|
|
|
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.ShowOnlineExplicitContent, false);
|
2018-10-22 23:57:37 +03:00
|
|
|
|
|
2021-06-11 16:37:31 +09:00
|
|
|
|
SetDefault(OsuSetting.NotifyOnUsernameMentioned, true);
|
|
|
|
|
SetDefault(OsuSetting.NotifyOnPrivateMessage, true);
|
2019-12-16 00:45:33 +01:00
|
|
|
|
|
2018-04-13 18:19:50 +09:00
|
|
|
|
// Audio
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.VolumeInactive, 0.25, 0, 1, 0.01);
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.MenuVoice, true);
|
|
|
|
|
SetDefault(OsuSetting.MenuMusic, true);
|
2023-12-28 16:05:20 +09:00
|
|
|
|
SetDefault(OsuSetting.MenuTips, true);
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.AudioOffset, 0, -500.0, 500.0, 1);
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
|
|
|
|
// Input
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.MenuCursorSize, 1.0f, 0.5f, 2f, 0.01f);
|
|
|
|
|
SetDefault(OsuSetting.GameplayCursorSize, 1.0f, 0.1f, 2f, 0.01f);
|
2022-07-26 14:07:33 +09:00
|
|
|
|
SetDefault(OsuSetting.GameplayCursorDuringTouch, false);
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.AutoCursorSize, false);
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.MouseDisableButtons, false);
|
|
|
|
|
SetDefault(OsuSetting.MouseDisableWheel, false);
|
|
|
|
|
SetDefault(OsuSetting.ConfineMouseMode, OsuConfineMouseMode.DuringGameplay);
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2023-11-07 00:13:46 +01:00
|
|
|
|
SetDefault(OsuSetting.TouchDisableGameplayTaps, false);
|
2023-11-06 20:42:40 +01:00
|
|
|
|
|
2018-04-13 18:19:50 +09:00
|
|
|
|
// Graphics
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.ShowFpsDisplay, false);
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.ShowStoryboard, true);
|
|
|
|
|
SetDefault(OsuSetting.BeatmapSkins, true);
|
|
|
|
|
SetDefault(OsuSetting.BeatmapColours, true);
|
|
|
|
|
SetDefault(OsuSetting.BeatmapHitsounds, true);
|
2018-04-25 16:15:23 +09:00
|
|
|
|
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.CursorRotation, true);
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.MenuParallax, true);
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2022-04-07 18:13:23 +09:00
|
|
|
|
// See https://stackoverflow.com/a/63307411 for default sourcing.
|
2022-11-11 22:10:27 +09:00
|
|
|
|
SetDefault(OsuSetting.Prefer24HourTime, !CultureInfoHelper.SystemCulture.DateTimeFormat.ShortTimePattern.Contains(@"tt"));
|
2022-04-05 16:21:28 -04:00
|
|
|
|
|
2018-04-13 18:19:50 +09:00
|
|
|
|
// Gameplay
|
2021-11-28 14:06:53 +01:00
|
|
|
|
SetDefault(OsuSetting.PositionalHitsoundsLevel, 0.2f, 0, 1);
|
2022-10-07 18:46:26 +09:00
|
|
|
|
SetDefault(OsuSetting.DimLevel, 0.7, 0, 1, 0.01);
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.BlurLevel, 0, 0, 1, 0.01);
|
|
|
|
|
SetDefault(OsuSetting.LightenDuringBreaks, true);
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.HitLighting, true);
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.HUDVisibilityMode, HUDVisibilityMode.Always);
|
|
|
|
|
SetDefault(OsuSetting.ShowHealthDisplayWhenCantFail, true);
|
|
|
|
|
SetDefault(OsuSetting.FadePlayfieldWhenHealthLow, true);
|
|
|
|
|
SetDefault(OsuSetting.KeyOverlay, false);
|
2023-07-06 00:46:28 +09:00
|
|
|
|
SetDefault(OsuSetting.ReplaySettingsOverlay, true);
|
2024-01-18 15:08:24 +09:00
|
|
|
|
SetDefault(OsuSetting.ReplayPlaybackControlsExpanded, true);
|
2022-09-26 20:07:43 +08:00
|
|
|
|
SetDefault(OsuSetting.GameplayLeaderboard, true);
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.AlwaysPlayFirstComboBreak, true);
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.FloatingComments, false);
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.ScoreDisplayMode, ScoringMode.Standardised);
|
2018-06-08 03:17:12 +09:00
|
|
|
|
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.IncreaseFirstObjectVisibility, true);
|
|
|
|
|
SetDefault(OsuSetting.GameplayDisableWinKey, true);
|
2018-04-25 17:15:53 +09:00
|
|
|
|
|
2018-04-13 18:19:50 +09:00
|
|
|
|
// Update
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.ReleaseStream, ReleaseStream.Lazer);
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.Version, string.Empty);
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2022-04-19 16:59:25 +09:00
|
|
|
|
SetDefault(OsuSetting.ShowFirstRunSetup, true);
|
|
|
|
|
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.ScreenshotFormat, ScreenshotFormat.Jpg);
|
|
|
|
|
SetDefault(OsuSetting.ScreenshotCaptureMenuCursor, false);
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.SongSelectRightMouseScroll, false);
|
2018-04-13 19:50:37 +09:00
|
|
|
|
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.Scaling, ScalingMode.Off);
|
2022-10-28 13:52:45 +09:00
|
|
|
|
SetDefault(OsuSetting.SafeAreaConsiderations, true);
|
2023-03-29 22:55:25 +09:00
|
|
|
|
SetDefault(OsuSetting.ScalingBackgroundDim, 0.9f, 0.5f, 1f);
|
2019-01-04 13:29:37 +09:00
|
|
|
|
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.ScalingSizeX, 0.8f, 0.2f, 1f);
|
|
|
|
|
SetDefault(OsuSetting.ScalingSizeY, 0.8f, 0.2f, 1f);
|
2019-01-04 13:29:37 +09:00
|
|
|
|
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.ScalingPositionX, 0.5f, 0f, 1f);
|
|
|
|
|
SetDefault(OsuSetting.ScalingPositionY, 0.5f, 0f, 1f);
|
2019-01-04 13:29:37 +09:00
|
|
|
|
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.UIScale, 1f, 0.8f, 1.6f, 0.01f);
|
2019-01-09 19:01:33 +09:00
|
|
|
|
|
2022-03-04 12:21:05 +09:00
|
|
|
|
SetDefault(OsuSetting.UIHoldActivationDelay, 200.0, 0.0, 500.0, 50.0);
|
2019-08-09 20:05:28 +09:00
|
|
|
|
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.IntroSequence, IntroSequence.Triangles);
|
2019-09-19 14:04:51 +09:00
|
|
|
|
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.MenuBackgroundSource, BackgroundSource.Skin);
|
|
|
|
|
SetDefault(OsuSetting.SeasonalBackgroundMode, SeasonalBackgroundMode.Sometimes);
|
2019-09-24 17:42:06 +08:00
|
|
|
|
|
2021-03-17 16:10:16 +09:00
|
|
|
|
SetDefault(OsuSetting.DiscordRichPresence, DiscordRichPresenceMode.Full);
|
2020-12-30 12:29:51 +07:00
|
|
|
|
|
2022-11-11 18:29:15 +09:00
|
|
|
|
SetDefault(OsuSetting.EditorDim, 0.25f, 0f, 0.75f, 0.25f);
|
|
|
|
|
SetDefault(OsuSetting.EditorWaveformOpacity, 0.25f, 0f, 1f, 0.25f);
|
|
|
|
|
SetDefault(OsuSetting.EditorShowHitMarkers, true);
|
2023-02-19 15:06:40 +01:00
|
|
|
|
SetDefault(OsuSetting.EditorAutoSeekOnPlacement, true);
|
2023-06-09 15:54:22 +09:00
|
|
|
|
SetDefault(OsuSetting.EditorLimitedDistanceSnap, false);
|
2023-10-17 16:01:00 +09:00
|
|
|
|
SetDefault(OsuSetting.EditorShowSpeedChanges, false);
|
2022-07-05 21:42:35 +09:00
|
|
|
|
|
2024-05-10 20:32:21 +08:00
|
|
|
|
SetDefault(OsuSetting.HideCountryFlags, false);
|
|
|
|
|
|
2024-01-15 14:30:27 +09:00
|
|
|
|
SetDefault(OsuSetting.MultiplayerRoomFilter, RoomPermissionsFilter.All);
|
|
|
|
|
|
2022-07-05 21:42:35 +09:00
|
|
|
|
SetDefault(OsuSetting.LastProcessedMetadataId, -1);
|
2022-10-14 14:37:24 +09:00
|
|
|
|
|
2022-11-02 18:14:20 +09:00
|
|
|
|
SetDefault(OsuSetting.ComboColourNormalisationAmount, 0.2f, 0f, 1f, 0.01f);
|
2024-01-02 14:04:40 +01:00
|
|
|
|
SetDefault<UserStatus?>(OsuSetting.UserOnlineStatus, null);
|
2024-06-17 10:16:40 +02:00
|
|
|
|
|
|
|
|
|
SetDefault(OsuSetting.EditorTimelineShowTimingChanges, true);
|
|
|
|
|
SetDefault(OsuSetting.EditorTimelineShowTicks, true);
|
2024-08-19 20:23:25 +09:00
|
|
|
|
|
|
|
|
|
SetDefault(OsuSetting.AlwaysShowHoldForMenuButton, false);
|
2018-04-13 18:19:50 +09:00
|
|
|
|
}
|
|
|
|
|
|
2022-08-22 17:03:20 +09:00
|
|
|
|
protected override bool CheckLookupContainsPrivateInformation(OsuSetting lookup)
|
2022-05-11 14:03:16 +09:00
|
|
|
|
{
|
2022-08-22 17:03:20 +09:00
|
|
|
|
switch (lookup)
|
2022-05-11 14:03:16 +09:00
|
|
|
|
{
|
|
|
|
|
case OsuSetting.Token:
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-05 13:18:42 +09:00
|
|
|
|
public void Migrate()
|
2019-01-04 15:34:32 +09:00
|
|
|
|
{
|
2020-03-05 13:18:42 +09:00
|
|
|
|
// arrives as 2020.123.0
|
2021-10-27 13:04:41 +09:00
|
|
|
|
string rawVersion = Get<string>(OsuSetting.Version);
|
2020-03-05 13:18:42 +09:00
|
|
|
|
|
|
|
|
|
if (rawVersion.Length < 6)
|
|
|
|
|
return;
|
|
|
|
|
|
2021-10-27 13:04:41 +09:00
|
|
|
|
string[] pieces = rawVersion.Split('.');
|
2020-03-05 13:18:42 +09:00
|
|
|
|
|
2020-03-05 15:36:36 +09:00
|
|
|
|
// on a fresh install or when coming from a non-release build, execution will end here.
|
|
|
|
|
// we don't want to run migrations in such cases.
|
2020-03-05 13:18:42 +09:00
|
|
|
|
if (!int.TryParse(pieces[0], out int year)) return;
|
|
|
|
|
if (!int.TryParse(pieces[1], out int monthDay)) return;
|
|
|
|
|
|
2022-10-28 13:09:28 +09:00
|
|
|
|
// ReSharper disable once UnusedVariable
|
2020-03-05 13:18:42 +09:00
|
|
|
|
int combined = (year * 10000) + monthDay;
|
2022-01-03 12:46:20 +09:00
|
|
|
|
|
2022-10-28 13:09:28 +09:00
|
|
|
|
// migrations can be added here using a condition like:
|
|
|
|
|
// if (combined < 20220103) { performMigration() }
|
2018-04-13 18:19:50 +09:00
|
|
|
|
}
|
2018-05-02 19:37:47 +09:00
|
|
|
|
|
2020-11-11 12:54:39 +09:00
|
|
|
|
public override TrackedSettings CreateTrackedSettings()
|
2019-01-04 15:34:32 +09:00
|
|
|
|
{
|
2020-11-11 12:54:39 +09:00
|
|
|
|
// these need to be assigned in normal game startup scenarios.
|
|
|
|
|
Debug.Assert(LookupKeyBindings != null);
|
|
|
|
|
Debug.Assert(LookupSkinName != null);
|
|
|
|
|
|
|
|
|
|
return new TrackedSettings
|
2020-11-11 12:19:01 +09:00
|
|
|
|
{
|
2022-07-20 21:05:20 +09:00
|
|
|
|
new TrackedSetting<bool>(OsuSetting.ShowFpsDisplay, state => new SettingDescription(
|
|
|
|
|
rawValue: state,
|
|
|
|
|
name: GlobalActionKeyBindingStrings.ToggleFPSCounter,
|
|
|
|
|
value: state ? CommonStrings.Enabled.ToLower() : CommonStrings.Disabled.ToLower(),
|
|
|
|
|
shortcut: LookupKeyBindings(GlobalAction.ToggleFPSDisplay))
|
|
|
|
|
),
|
2021-10-19 17:00:51 +09:00
|
|
|
|
new TrackedSetting<bool>(OsuSetting.MouseDisableButtons, disabledState => new SettingDescription(
|
|
|
|
|
rawValue: !disabledState,
|
2023-11-06 21:10:04 +01:00
|
|
|
|
name: GlobalActionKeyBindingStrings.ToggleGameplayMouseButtons,
|
2021-10-19 17:00:51 +09:00
|
|
|
|
value: disabledState ? CommonStrings.Disabled.ToLower() : CommonStrings.Enabled.ToLower(),
|
|
|
|
|
shortcut: LookupKeyBindings(GlobalAction.ToggleGameplayMouseButtons))
|
|
|
|
|
),
|
2023-08-16 16:17:56 +09:00
|
|
|
|
new TrackedSetting<bool>(OsuSetting.GameplayLeaderboard, state => new SettingDescription(
|
|
|
|
|
rawValue: state,
|
|
|
|
|
name: GlobalActionKeyBindingStrings.ToggleInGameLeaderboard,
|
|
|
|
|
value: state ? CommonStrings.Enabled.ToLower() : CommonStrings.Disabled.ToLower(),
|
|
|
|
|
shortcut: LookupKeyBindings(GlobalAction.ToggleInGameLeaderboard))
|
|
|
|
|
),
|
2021-10-19 17:22:50 +09:00
|
|
|
|
new TrackedSetting<HUDVisibilityMode>(OsuSetting.HUDVisibilityMode, visibilityMode => new SettingDescription(
|
|
|
|
|
rawValue: visibilityMode,
|
2021-10-19 17:00:51 +09:00
|
|
|
|
name: GameplaySettingsStrings.HUDVisibilityMode,
|
2021-10-19 17:22:50 +09:00
|
|
|
|
value: visibilityMode.GetLocalisableDescription(),
|
2021-10-19 17:00:51 +09:00
|
|
|
|
shortcut: new TranslatableString(@"_", @"{0}: {1} {2}: {3}",
|
|
|
|
|
GlobalActionKeyBindingStrings.ToggleInGameInterface,
|
|
|
|
|
LookupKeyBindings(GlobalAction.ToggleInGameInterface),
|
|
|
|
|
GlobalActionKeyBindingStrings.HoldForHUD,
|
|
|
|
|
LookupKeyBindings(GlobalAction.HoldForHUD)))
|
|
|
|
|
),
|
|
|
|
|
new TrackedSetting<ScalingMode>(OsuSetting.Scaling, scalingMode => new SettingDescription(
|
|
|
|
|
rawValue: scalingMode,
|
|
|
|
|
name: GraphicsSettingsStrings.ScreenScaling,
|
|
|
|
|
value: scalingMode.GetLocalisableDescription()
|
|
|
|
|
)
|
|
|
|
|
),
|
2021-11-23 16:04:55 +09:00
|
|
|
|
new TrackedSetting<string>(OsuSetting.Skin, skin =>
|
2020-11-11 12:54:39 +09:00
|
|
|
|
{
|
2021-11-23 16:04:55 +09:00
|
|
|
|
string skinName = string.Empty;
|
|
|
|
|
|
|
|
|
|
if (Guid.TryParse(skin, out var id))
|
2023-06-24 00:59:36 +09:00
|
|
|
|
skinName = LookupSkinName(id);
|
2021-10-19 17:00:51 +09:00
|
|
|
|
|
|
|
|
|
return new SettingDescription(
|
|
|
|
|
rawValue: skinName,
|
|
|
|
|
name: SkinSettingsStrings.SkinSectionHeader,
|
|
|
|
|
value: skinName,
|
2021-10-22 15:45:48 -07:00
|
|
|
|
shortcut: new TranslatableString(@"_", @"{0}: {1}",
|
|
|
|
|
GlobalActionKeyBindingStrings.RandomSkin,
|
|
|
|
|
LookupKeyBindings(GlobalAction.RandomSkin))
|
2021-10-19 17:00:51 +09:00
|
|
|
|
);
|
2021-10-10 19:55:02 -07:00
|
|
|
|
}),
|
2021-10-19 17:00:51 +09:00
|
|
|
|
new TrackedSetting<float>(OsuSetting.UIScale, scale => new SettingDescription(
|
|
|
|
|
rawValue: scale,
|
|
|
|
|
name: GraphicsSettingsStrings.UIScaling,
|
|
|
|
|
value: $"{scale:N2}x"
|
|
|
|
|
// TODO: implement lookup for framework platform key bindings
|
|
|
|
|
)
|
|
|
|
|
),
|
2020-11-11 12:54:39 +09:00
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-04 12:31:57 +09:00
|
|
|
|
public Func<Guid, string> LookupSkinName { private get; set; } = _ => @"unknown";
|
2020-11-11 12:19:01 +09:00
|
|
|
|
|
2022-03-04 12:31:57 +09:00
|
|
|
|
public Func<GlobalAction, LocalisableString> LookupKeyBindings { get; set; } = _ => @"unknown";
|
2022-11-08 18:24:57 +09:00
|
|
|
|
|
|
|
|
|
IBindable<float> IGameplaySettings.ComboColourNormalisationAmount => GetOriginalBindable<float>(OsuSetting.ComboColourNormalisationAmount);
|
|
|
|
|
IBindable<float> IGameplaySettings.PositionalHitsoundsLevel => GetOriginalBindable<float>(OsuSetting.PositionalHitsoundsLevel);
|
2018-04-13 18:19:50 +09:00
|
|
|
|
}
|
|
|
|
|
|
2021-08-16 16:59:59 +09:00
|
|
|
|
// IMPORTANT: These are used in user configuration files.
|
|
|
|
|
// The naming of these keys should not be changed once they are deployed in a release, unless migration logic is also added.
|
2018-04-13 18:19:50 +09:00
|
|
|
|
public enum OsuSetting
|
|
|
|
|
{
|
|
|
|
|
Ruleset,
|
|
|
|
|
Token,
|
|
|
|
|
MenuCursorSize,
|
|
|
|
|
GameplayCursorSize,
|
|
|
|
|
AutoCursorSize,
|
2022-07-26 14:07:33 +09:00
|
|
|
|
GameplayCursorDuringTouch,
|
2018-04-13 18:19:50 +09:00
|
|
|
|
DimLevel,
|
|
|
|
|
BlurLevel,
|
2022-11-11 18:29:15 +09:00
|
|
|
|
EditorDim,
|
2019-12-10 15:10:35 +03:00
|
|
|
|
LightenDuringBreaks,
|
2018-04-13 18:19:50 +09:00
|
|
|
|
ShowStoryboard,
|
|
|
|
|
KeyOverlay,
|
2022-09-26 20:07:43 +08:00
|
|
|
|
GameplayLeaderboard,
|
2022-01-03 12:46:20 +09:00
|
|
|
|
PositionalHitsoundsLevel,
|
2020-07-14 20:11:54 +09:00
|
|
|
|
AlwaysPlayFirstComboBreak,
|
2018-04-13 18:19:50 +09:00
|
|
|
|
FloatingComments,
|
2020-07-22 12:41:06 +09:00
|
|
|
|
HUDVisibilityMode,
|
2022-04-27 18:10:58 +09:00
|
|
|
|
|
2019-07-07 05:30:30 +09:00
|
|
|
|
ShowHealthDisplayWhenCantFail,
|
2020-03-30 12:59:39 +02:00
|
|
|
|
FadePlayfieldWhenHealthLow,
|
2023-11-05 12:40:06 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2023-11-06 20:42:40 +01:00
|
|
|
|
/// Disables mouse buttons clicks during gameplay.
|
2023-11-05 12:40:06 +01:00
|
|
|
|
/// </summary>
|
2018-04-13 18:19:50 +09:00
|
|
|
|
MouseDisableButtons,
|
|
|
|
|
MouseDisableWheel,
|
2020-08-16 11:04:28 +09:30
|
|
|
|
ConfineMouseMode,
|
2022-03-04 00:14:24 +09:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Globally applied audio offset.
|
|
|
|
|
/// This is added to the audio track's current time. Higher values will cause gameplay to occur earlier, relative to the audio track.
|
|
|
|
|
/// </summary>
|
2018-04-13 18:19:50 +09:00
|
|
|
|
AudioOffset,
|
2022-03-04 00:14:24 +09:00
|
|
|
|
|
2018-04-13 18:19:50 +09:00
|
|
|
|
VolumeInactive,
|
|
|
|
|
MenuMusic,
|
|
|
|
|
MenuVoice,
|
2023-12-28 16:05:20 +09:00
|
|
|
|
MenuTips,
|
2018-04-13 18:19:50 +09:00
|
|
|
|
CursorRotation,
|
|
|
|
|
MenuParallax,
|
2022-04-05 16:21:28 -04:00
|
|
|
|
Prefer24HourTime,
|
2018-04-13 18:19:50 +09:00
|
|
|
|
BeatmapDetailTab,
|
2020-09-15 21:33:52 -07:00
|
|
|
|
BeatmapDetailModsFilter,
|
2018-04-13 18:19:50 +09:00
|
|
|
|
Username,
|
|
|
|
|
ReleaseStream,
|
|
|
|
|
SavePassword,
|
|
|
|
|
SaveUsername,
|
|
|
|
|
DisplayStarsMinimum,
|
|
|
|
|
DisplayStarsMaximum,
|
2019-08-24 10:34:54 +02:00
|
|
|
|
SongSelectGroupingMode,
|
|
|
|
|
SongSelectSortingMode,
|
2018-04-13 18:19:50 +09:00
|
|
|
|
RandomSelectAlgorithm,
|
2022-06-21 13:03:46 +02:00
|
|
|
|
ModSelectHotkeyStyle,
|
2018-04-13 18:19:50 +09:00
|
|
|
|
ShowFpsDisplay,
|
|
|
|
|
ChatDisplayHeight,
|
2022-04-02 18:36:49 +03:00
|
|
|
|
BeatmapListingCardSize,
|
2022-03-26 19:18:41 +09:00
|
|
|
|
ToolbarClockDisplayMode,
|
2023-01-25 16:28:38 +09:00
|
|
|
|
SongSelectBackgroundBlur,
|
2018-04-13 18:19:50 +09:00
|
|
|
|
Version,
|
2022-04-19 16:59:25 +09:00
|
|
|
|
ShowFirstRunSetup,
|
2018-04-13 18:19:50 +09:00
|
|
|
|
ShowConvertedBeatmaps,
|
|
|
|
|
Skin,
|
2018-04-13 19:50:37 +09:00
|
|
|
|
ScreenshotFormat,
|
2018-04-18 18:10:40 +09:00
|
|
|
|
ScreenshotCaptureMenuCursor,
|
2018-04-20 18:17:57 +03:00
|
|
|
|
SongSelectRightMouseScroll,
|
2018-04-25 16:15:23 +09:00
|
|
|
|
BeatmapSkins,
|
2021-01-13 00:09:22 -05:00
|
|
|
|
BeatmapColours,
|
2018-04-25 17:15:53 +09:00
|
|
|
|
BeatmapHitsounds,
|
2018-06-08 03:17:12 +09:00
|
|
|
|
IncreaseFirstObjectVisibility,
|
2018-10-22 23:57:37 +03:00
|
|
|
|
ScoreDisplayMode,
|
2019-01-04 13:29:37 +09:00
|
|
|
|
ExternalLinkWarning,
|
2020-04-11 14:08:16 +03:00
|
|
|
|
PreferNoVideo,
|
2019-01-04 13:29:37 +09:00
|
|
|
|
Scaling,
|
|
|
|
|
ScalingPositionX,
|
|
|
|
|
ScalingPositionY,
|
|
|
|
|
ScalingSizeX,
|
2019-01-09 19:01:33 +09:00
|
|
|
|
ScalingSizeY,
|
2023-03-29 22:55:25 +09:00
|
|
|
|
ScalingBackgroundDim,
|
2019-08-09 20:05:28 +09:00
|
|
|
|
UIScale,
|
2019-12-16 00:45:33 +01:00
|
|
|
|
IntroSequence,
|
2021-06-11 16:37:31 +09:00
|
|
|
|
NotifyOnUsernameMentioned,
|
|
|
|
|
NotifyOnPrivateMessage,
|
2019-09-19 20:05:14 +09:00
|
|
|
|
UIHoldActivationDelay,
|
2019-09-24 17:42:06 +08:00
|
|
|
|
HitLighting,
|
2020-06-30 13:12:33 +02:00
|
|
|
|
MenuBackgroundSource,
|
2020-08-01 19:44:30 +02:00
|
|
|
|
GameplayDisableWinKey,
|
2020-10-31 16:22:49 +09:00
|
|
|
|
SeasonalBackgroundMode,
|
2020-11-03 16:01:14 +09:00
|
|
|
|
EditorWaveformOpacity,
|
2022-11-11 18:29:15 +09:00
|
|
|
|
EditorShowHitMarkers,
|
2023-02-19 15:06:40 +01:00
|
|
|
|
EditorAutoSeekOnPlacement,
|
2020-12-30 12:29:51 +07:00
|
|
|
|
DiscordRichPresence,
|
2023-09-18 14:46:24 +02:00
|
|
|
|
|
2021-01-17 22:40:24 +09:00
|
|
|
|
ShowOnlineExplicitContent,
|
2022-10-05 17:50:36 +09:00
|
|
|
|
LastProcessedMetadataId,
|
2022-10-28 13:52:45 +09:00
|
|
|
|
SafeAreaConsiderations,
|
2022-11-02 18:14:20 +09:00
|
|
|
|
ComboColourNormalisationAmount,
|
2023-01-24 23:30:07 +01:00
|
|
|
|
ProfileCoverExpanded,
|
2023-07-06 00:46:28 +09:00
|
|
|
|
EditorLimitedDistanceSnap,
|
2023-09-18 14:46:24 +02:00
|
|
|
|
ReplaySettingsOverlay,
|
2024-01-18 15:08:24 +09:00
|
|
|
|
ReplayPlaybackControlsExpanded,
|
2023-09-18 14:46:24 +02:00
|
|
|
|
AutomaticallyDownloadMissingBeatmaps,
|
2023-11-06 20:42:40 +01:00
|
|
|
|
EditorShowSpeedChanges,
|
2023-11-07 00:13:46 +01:00
|
|
|
|
TouchDisableGameplayTaps,
|
2023-12-14 09:23:03 +01:00
|
|
|
|
ModSelectTextSearchStartsActive,
|
2024-01-02 14:04:40 +01:00
|
|
|
|
UserOnlineStatus,
|
2024-05-10 20:32:21 +08:00
|
|
|
|
MultiplayerRoomFilter,
|
|
|
|
|
HideCountryFlags,
|
2024-06-17 10:16:40 +02:00
|
|
|
|
EditorTimelineShowTimingChanges,
|
|
|
|
|
EditorTimelineShowTicks,
|
2024-08-19 20:23:25 +09:00
|
|
|
|
AlwaysShowHoldForMenuButton
|
2018-04-13 18:19:50 +09:00
|
|
|
|
}
|
|
|
|
|
}
|