diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index c1fd34d009..bce1f85dc0 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -22,13 +22,13 @@ namespace osu.Desktop.Overlays { public class VersionManager : OverlayContainer { - private OsuConfigManager config; + private GameConfigManager config; private OsuGameBase game; private NotificationOverlay notificationOverlay; private GameHost host; [BackgroundDependencyLoader] - private void load(NotificationOverlay notification, OsuColour colours, TextureStore textures, OsuGameBase game, OsuConfigManager config, GameHost host) + private void load(NotificationOverlay notification, OsuColour colours, TextureStore textures, OsuGameBase game, GameConfigManager config, GameHost host) { notificationOverlay = notification; this.config = config; @@ -95,10 +95,10 @@ namespace osu.Desktop.Overlays base.LoadComplete(); var version = game.Version; - var lastVersion = config.Get(OsuSetting.Version); + var lastVersion = config.Get(GameSetting.Version); if (game.IsDeployedBuild && version != lastVersion) { - config.Set(OsuSetting.Version, version); + config.Set(GameSetting.Version, version); // only show a notification if we've previously saved a version to the config file (ie. not the first run). if (!string.IsNullOrEmpty(lastVersion)) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index 60377e373a..dafb54ff64 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -93,10 +93,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables } [BackgroundDependencyLoader] - private void load(OsuConfigManager config) + private void load(GameConfigManager config) { - config.BindWith(OsuSetting.SnakingInSliders, Body.SnakingIn); - config.BindWith(OsuSetting.SnakingOutSliders, Body.SnakingOut); + config.BindWith(GameSetting.SnakingInSliders, Body.SnakingIn); + config.BindWith(GameSetting.SnakingOutSliders, Body.SnakingOut); positionBindable.BindValueChanged(_ => Position = HitObject.StackedPosition); scaleBindable.BindValueChanged(v => diff --git a/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs index 80beb62d6c..582b99af7c 100644 --- a/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs +++ b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs @@ -112,7 +112,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor } [BackgroundDependencyLoader] - private void load(OsuConfigManager config, IBindableBeatmap beatmap) + private void load(GameConfigManager config, IBindableBeatmap beatmap) { InternalChild = expandTarget = new Container { @@ -185,10 +185,10 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor this.beatmap.BindTo(beatmap); this.beatmap.ValueChanged += v => calculateScale(); - cursorScale = config.GetBindable(OsuSetting.GameplayCursorSize); + cursorScale = config.GetBindable(GameSetting.GameplayCursorSize); cursorScale.ValueChanged += v => calculateScale(); - autoCursorScale = config.GetBindable(OsuSetting.AutoCursorSize); + autoCursorScale = config.GetBindable(GameSetting.AutoCursorSize); autoCursorScale.ValueChanged += v => calculateScale(); calculateScale(); diff --git a/osu.Game.Rulesets.Osu/UI/OsuSettings.cs b/osu.Game.Rulesets.Osu/UI/OsuSettings.cs index 25c009b117..ae0b3ef4dd 100644 --- a/osu.Game.Rulesets.Osu/UI/OsuSettings.cs +++ b/osu.Game.Rulesets.Osu/UI/OsuSettings.cs @@ -18,19 +18,19 @@ namespace osu.Game.Rulesets.Osu.UI } [BackgroundDependencyLoader] - private void load(OsuConfigManager config) + private void load(GameConfigManager config) { Children = new Drawable[] { new SettingsCheckbox { LabelText = "Snaking in sliders", - Bindable = config.GetBindable(OsuSetting.SnakingInSliders) + Bindable = config.GetBindable(GameSetting.SnakingInSliders) }, new SettingsCheckbox { LabelText = "Snaking out sliders", - Bindable = config.GetBindable(OsuSetting.SnakingOutSliders) + Bindable = config.GetBindable(GameSetting.SnakingOutSliders) }, }; } diff --git a/osu.Game/Configuration/GameConfigManager.cs b/osu.Game/Configuration/GameConfigManager.cs new file mode 100644 index 0000000000..736273dc35 --- /dev/null +++ b/osu.Game/Configuration/GameConfigManager.cs @@ -0,0 +1,175 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Configuration; +using osu.Framework.Configuration.Tracking; +using osu.Framework.Extensions; +using osu.Framework.Platform; +using osu.Game.Overlays; +using osu.Game.Rulesets.Scoring; +using osu.Game.Screens.Select; + +namespace osu.Game.Configuration +{ + public class GameConfigManager : IniConfigManager + { + protected override void InitialiseDefaults() + { + // UI/selection defaults + Set(GameSetting.Ruleset, 0, 0, int.MaxValue); + Set(GameSetting.Skin, 0, 0, int.MaxValue); + + Set(GameSetting.BeatmapDetailTab, BeatmapDetailTab.Details); + + Set(GameSetting.ShowConvertedBeatmaps, true); + Set(GameSetting.DisplayStarsMinimum, 0.0, 0, 10, 0.1); + Set(GameSetting.DisplayStarsMaximum, 10.0, 0, 10, 0.1); + + Set(GameSetting.RandomSelectAlgorithm, RandomSelectAlgorithm.RandomPermutation); + + Set(GameSetting.ChatDisplayHeight, ChatOverlay.DEFAULT_HEIGHT, 0.2, 1); + + // Online settings + Set(GameSetting.Username, string.Empty); + Set(GameSetting.Token, string.Empty); + + Set(GameSetting.SavePassword, false).ValueChanged += val => + { + if (val) Set(GameSetting.SaveUsername, true); + }; + + Set(GameSetting.SaveUsername, true).ValueChanged += val => + { + if (!val) Set(GameSetting.SavePassword, false); + }; + + Set(GameSetting.ExternalLinkWarning, true); + + // Audio + Set(GameSetting.VolumeInactive, 0.25, 0, 1, 0.01); + + Set(GameSetting.MenuVoice, true); + Set(GameSetting.MenuMusic, true); + + Set(GameSetting.AudioOffset, 0, -500.0, 500.0, 1); + + // Input + Set(GameSetting.MenuCursorSize, 1.0, 0.5f, 2, 0.01); + Set(GameSetting.GameplayCursorSize, 1.0, 0.5f, 2, 0.01); + Set(GameSetting.AutoCursorSize, false); + + Set(GameSetting.MouseDisableButtons, false); + Set(GameSetting.MouseDisableWheel, false); + + // Graphics + Set(GameSetting.ShowFpsDisplay, false); + + Set(GameSetting.ShowStoryboard, true); + Set(GameSetting.BeatmapSkins, true); + Set(GameSetting.BeatmapHitsounds, true); + + Set(GameSetting.CursorRotation, true); + + Set(GameSetting.MenuParallax, true); + + Set(GameSetting.SnakingInSliders, true); + Set(GameSetting.SnakingOutSliders, true); + + // Gameplay + Set(GameSetting.DimLevel, 0.3, 0, 1, 0.01); + Set(GameSetting.BlurLevel, 0, 0, 1, 0.01); + + Set(GameSetting.ShowInterface, true); + Set(GameSetting.KeyOverlay, false); + + Set(GameSetting.FloatingComments, false); + + Set(GameSetting.ScoreDisplayMode, ScoringMode.Standardised); + + Set(GameSetting.IncreaseFirstObjectVisibility, true); + + // Update + Set(GameSetting.ReleaseStream, ReleaseStream.Lazer); + + Set(GameSetting.Version, string.Empty); + + Set(GameSetting.ScreenshotFormat, ScreenshotFormat.Jpg); + Set(GameSetting.ScreenshotCaptureMenuCursor, false); + + Set(GameSetting.SongSelectRightMouseScroll, false); + + Set(GameSetting.Scaling, ScalingMode.Off); + + Set(GameSetting.ScalingSizeX, 0.8f, 0.2f, 1f); + Set(GameSetting.ScalingSizeY, 0.8f, 0.2f, 1f); + + Set(GameSetting.ScalingPositionX, 0.5f, 0f, 1f); + Set(GameSetting.ScalingPositionY, 0.5f, 0f, 1f); + + Set(GameSetting.UIScale, 1f, 0.8f, 1.6f, 0.01f); + } + + public GameConfigManager(Storage storage) + : base(storage) + { + } + + public override TrackedSettings CreateTrackedSettings() => new TrackedSettings + { + new TrackedSetting(GameSetting.MouseDisableButtons, v => new SettingDescription(!v, "gameplay mouse buttons", v ? "disabled" : "enabled")), + new TrackedSetting(GameSetting.Scaling, m => new SettingDescription(m, "scaling", m.GetDescription())), + }; + } + + public enum GameSetting + { + Ruleset, + Token, + MenuCursorSize, + GameplayCursorSize, + AutoCursorSize, + DimLevel, + BlurLevel, + ShowStoryboard, + KeyOverlay, + FloatingComments, + ShowInterface, + MouseDisableButtons, + MouseDisableWheel, + AudioOffset, + VolumeInactive, + MenuMusic, + MenuVoice, + CursorRotation, + MenuParallax, + BeatmapDetailTab, + Username, + ReleaseStream, + SavePassword, + SaveUsername, + DisplayStarsMinimum, + DisplayStarsMaximum, + RandomSelectAlgorithm, + SnakingInSliders, + SnakingOutSliders, + ShowFpsDisplay, + ChatDisplayHeight, + Version, + ShowConvertedBeatmaps, + Skin, + ScreenshotFormat, + ScreenshotCaptureMenuCursor, + SongSelectRightMouseScroll, + BeatmapSkins, + BeatmapHitsounds, + IncreaseFirstObjectVisibility, + ScoreDisplayMode, + ExternalLinkWarning, + Scaling, + ScalingPositionX, + ScalingPositionY, + ScalingSizeX, + ScalingSizeY, + UIScale + } +} diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs deleted file mode 100644 index 1b279eee44..0000000000 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using osu.Framework.Configuration; -using osu.Framework.Configuration.Tracking; -using osu.Framework.Extensions; -using osu.Framework.Platform; -using osu.Game.Overlays; -using osu.Game.Rulesets.Scoring; -using osu.Game.Screens.Select; - -namespace osu.Game.Configuration -{ - public class OsuConfigManager : IniConfigManager - { - protected override void InitialiseDefaults() - { - // UI/selection defaults - Set(OsuSetting.Ruleset, 0, 0, int.MaxValue); - Set(OsuSetting.Skin, 0, 0, int.MaxValue); - - Set(OsuSetting.BeatmapDetailTab, BeatmapDetailTab.Details); - - Set(OsuSetting.ShowConvertedBeatmaps, true); - Set(OsuSetting.DisplayStarsMinimum, 0.0, 0, 10, 0.1); - Set(OsuSetting.DisplayStarsMaximum, 10.0, 0, 10, 0.1); - - Set(OsuSetting.RandomSelectAlgorithm, RandomSelectAlgorithm.RandomPermutation); - - Set(OsuSetting.ChatDisplayHeight, ChatOverlay.DEFAULT_HEIGHT, 0.2, 1); - - // Online settings - Set(OsuSetting.Username, string.Empty); - Set(OsuSetting.Token, string.Empty); - - Set(OsuSetting.SavePassword, false).ValueChanged += val => - { - if (val) Set(OsuSetting.SaveUsername, true); - }; - - Set(OsuSetting.SaveUsername, true).ValueChanged += val => - { - if (!val) Set(OsuSetting.SavePassword, false); - }; - - Set(OsuSetting.ExternalLinkWarning, true); - - // Audio - Set(OsuSetting.VolumeInactive, 0.25, 0, 1, 0.01); - - Set(OsuSetting.MenuVoice, true); - Set(OsuSetting.MenuMusic, true); - - Set(OsuSetting.AudioOffset, 0, -500.0, 500.0, 1); - - // Input - Set(OsuSetting.MenuCursorSize, 1.0, 0.5f, 2, 0.01); - Set(OsuSetting.GameplayCursorSize, 1.0, 0.5f, 2, 0.01); - Set(OsuSetting.AutoCursorSize, false); - - Set(OsuSetting.MouseDisableButtons, false); - Set(OsuSetting.MouseDisableWheel, false); - - // Graphics - Set(OsuSetting.ShowFpsDisplay, false); - - Set(OsuSetting.ShowStoryboard, true); - Set(OsuSetting.BeatmapSkins, true); - Set(OsuSetting.BeatmapHitsounds, true); - - Set(OsuSetting.CursorRotation, true); - - Set(OsuSetting.MenuParallax, true); - - Set(OsuSetting.SnakingInSliders, true); - Set(OsuSetting.SnakingOutSliders, true); - - // Gameplay - Set(OsuSetting.DimLevel, 0.3, 0, 1, 0.01); - Set(OsuSetting.BlurLevel, 0, 0, 1, 0.01); - - Set(OsuSetting.ShowInterface, true); - Set(OsuSetting.KeyOverlay, false); - - Set(OsuSetting.FloatingComments, false); - - Set(OsuSetting.ScoreDisplayMode, ScoringMode.Standardised); - - Set(OsuSetting.IncreaseFirstObjectVisibility, true); - - // Update - Set(OsuSetting.ReleaseStream, ReleaseStream.Lazer); - - Set(OsuSetting.Version, string.Empty); - - Set(OsuSetting.ScreenshotFormat, ScreenshotFormat.Jpg); - Set(OsuSetting.ScreenshotCaptureMenuCursor, false); - - Set(OsuSetting.SongSelectRightMouseScroll, false); - - Set(OsuSetting.Scaling, ScalingMode.Off); - - Set(OsuSetting.ScalingSizeX, 0.8f, 0.2f, 1f); - Set(OsuSetting.ScalingSizeY, 0.8f, 0.2f, 1f); - - Set(OsuSetting.ScalingPositionX, 0.5f, 0f, 1f); - Set(OsuSetting.ScalingPositionY, 0.5f, 0f, 1f); - - Set(OsuSetting.UIScale, 1f, 0.8f, 1.6f, 0.01f); - } - - public OsuConfigManager(Storage storage) - : base(storage) - { - } - - public override TrackedSettings CreateTrackedSettings() => new TrackedSettings - { - new TrackedSetting(OsuSetting.MouseDisableButtons, v => new SettingDescription(!v, "gameplay mouse buttons", v ? "disabled" : "enabled")), - new TrackedSetting(OsuSetting.Scaling, m => new SettingDescription(m, "scaling", m.GetDescription())), - }; - } - - public enum OsuSetting - { - Ruleset, - Token, - MenuCursorSize, - GameplayCursorSize, - AutoCursorSize, - DimLevel, - BlurLevel, - ShowStoryboard, - KeyOverlay, - FloatingComments, - ShowInterface, - MouseDisableButtons, - MouseDisableWheel, - AudioOffset, - VolumeInactive, - MenuMusic, - MenuVoice, - CursorRotation, - MenuParallax, - BeatmapDetailTab, - Username, - ReleaseStream, - SavePassword, - SaveUsername, - DisplayStarsMinimum, - DisplayStarsMaximum, - RandomSelectAlgorithm, - SnakingInSliders, - SnakingOutSliders, - ShowFpsDisplay, - ChatDisplayHeight, - Version, - ShowConvertedBeatmaps, - Skin, - ScreenshotFormat, - ScreenshotCaptureMenuCursor, - SongSelectRightMouseScroll, - BeatmapSkins, - BeatmapHitsounds, - IncreaseFirstObjectVisibility, - ScoreDisplayMode, - ExternalLinkWarning, - Scaling, - ScalingPositionX, - ScalingPositionY, - ScalingSizeX, - ScalingSizeY, - UIScale - } -} diff --git a/osu.Game/Graphics/Containers/ParallaxContainer.cs b/osu.Game/Graphics/Containers/ParallaxContainer.cs index 97e12ec0f9..40da8a9afb 100644 --- a/osu.Game/Graphics/Containers/ParallaxContainer.cs +++ b/osu.Game/Graphics/Containers/ParallaxContainer.cs @@ -40,9 +40,9 @@ namespace osu.Game.Graphics.Containers protected override Container Content => content; [BackgroundDependencyLoader] - private void load(OsuConfigManager config) + private void load(GameConfigManager config) { - parallaxEnabled = config.GetBindable(OsuSetting.MenuParallax); + parallaxEnabled = config.GetBindable(GameSetting.MenuParallax); parallaxEnabled.ValueChanged += delegate { if (!parallaxEnabled) diff --git a/osu.Game/Graphics/Containers/ScalingContainer.cs b/osu.Game/Graphics/Containers/ScalingContainer.cs index 62760b39ea..fe49f282f0 100644 --- a/osu.Game/Graphics/Containers/ScalingContainer.cs +++ b/osu.Game/Graphics/Containers/ScalingContainer.cs @@ -65,11 +65,11 @@ namespace osu.Game.Graphics.Containers } [BackgroundDependencyLoader] - private void load(OsuConfigManager osuConfig) + private void load(GameConfigManager gameConfig) { if (applyUIScale) { - uiScale = osuConfig.GetBindable(OsuSetting.UIScale); + uiScale = gameConfig.GetBindable(GameSetting.UIScale); uiScale.BindValueChanged(scaleChanged, true); } } @@ -82,21 +82,21 @@ namespace osu.Game.Graphics.Containers } [BackgroundDependencyLoader] - private void load(OsuConfigManager config) + private void load(GameConfigManager config) { - scalingMode = config.GetBindable(OsuSetting.Scaling); + scalingMode = config.GetBindable(GameSetting.Scaling); scalingMode.ValueChanged += _ => updateSize(); - sizeX = config.GetBindable(OsuSetting.ScalingSizeX); + sizeX = config.GetBindable(GameSetting.ScalingSizeX); sizeX.ValueChanged += _ => updateSize(); - sizeY = config.GetBindable(OsuSetting.ScalingSizeY); + sizeY = config.GetBindable(GameSetting.ScalingSizeY); sizeY.ValueChanged += _ => updateSize(); - posX = config.GetBindable(OsuSetting.ScalingPositionX); + posX = config.GetBindable(GameSetting.ScalingPositionX); posX.ValueChanged += _ => updateSize(); - posY = config.GetBindable(OsuSetting.ScalingPositionY); + posY = config.GetBindable(GameSetting.ScalingPositionY); posY.ValueChanged += _ => updateSize(); } diff --git a/osu.Game/Graphics/Cursor/MenuCursor.cs b/osu.Game/Graphics/Cursor/MenuCursor.cs index 87d97806cd..a609249db3 100644 --- a/osu.Game/Graphics/Cursor/MenuCursor.cs +++ b/osu.Game/Graphics/Cursor/MenuCursor.cs @@ -31,9 +31,9 @@ namespace osu.Game.Graphics.Cursor private Vector2 positionMouseDown; [BackgroundDependencyLoader(true)] - private void load([NotNull] OsuConfigManager config, [CanBeNull] ScreenshotManager screenshotManager) + private void load([NotNull] GameConfigManager config, [CanBeNull] ScreenshotManager screenshotManager) { - cursorRotate = config.GetBindable(OsuSetting.CursorRotation); + cursorRotate = config.GetBindable(GameSetting.CursorRotation); if (screenshotManager != null) screenshotCursorVisibility.BindTo(screenshotManager.CursorVisibility); @@ -131,7 +131,7 @@ namespace osu.Game.Graphics.Cursor } [BackgroundDependencyLoader] - private void load(OsuConfigManager config, TextureStore textures, OsuColour colour) + private void load(GameConfigManager config, TextureStore textures, OsuColour colour) { Children = new Drawable[] { @@ -155,7 +155,7 @@ namespace osu.Game.Graphics.Cursor } }; - cursorScale = config.GetBindable(OsuSetting.MenuCursorSize); + cursorScale = config.GetBindable(GameSetting.MenuCursorSize); cursorScale.ValueChanged += newScale => cursorContainer.Scale = new Vector2((float)newScale * base_scale); cursorScale.TriggerChange(); } diff --git a/osu.Game/Graphics/ScreenshotManager.cs b/osu.Game/Graphics/ScreenshotManager.cs index be253f65c1..6d1be73e91 100644 --- a/osu.Game/Graphics/ScreenshotManager.cs +++ b/osu.Game/Graphics/ScreenshotManager.cs @@ -42,14 +42,14 @@ namespace osu.Game.Graphics private SampleChannel shutter; [BackgroundDependencyLoader] - private void load(GameHost host, OsuConfigManager config, Storage storage, NotificationOverlay notificationOverlay, AudioManager audio) + private void load(GameHost host, GameConfigManager config, Storage storage, NotificationOverlay notificationOverlay, AudioManager audio) { this.host = host; this.storage = storage.GetStorageForDirectory(@"screenshots"); this.notificationOverlay = notificationOverlay; - screenshotFormat = config.GetBindable(OsuSetting.ScreenshotFormat); - captureMenuCursor = config.GetBindable(OsuSetting.ScreenshotCaptureMenuCursor); + screenshotFormat = config.GetBindable(GameSetting.ScreenshotFormat); + captureMenuCursor = config.GetBindable(GameSetting.ScreenshotCaptureMenuCursor); shutter = audio.Sample.Get("UI/shutter"); } diff --git a/osu.Game/Online/API/APIAccess.cs b/osu.Game/Online/API/APIAccess.cs index db273dd00a..b733a5143c 100644 --- a/osu.Game/Online/API/APIAccess.cs +++ b/osu.Game/Online/API/APIAccess.cs @@ -19,7 +19,7 @@ namespace osu.Game.Online.API { public class APIAccess : Component, IAPIProvider { - private readonly OsuConfigManager config; + private readonly GameConfigManager config; private readonly OAuth authentication; public string Endpoint = @"https://osu.ppy.sh"; @@ -43,16 +43,16 @@ namespace osu.Game.Online.API private readonly Logger log; - public APIAccess(OsuConfigManager config) + public APIAccess(GameConfigManager config) { this.config = config; authentication = new OAuth(client_id, client_secret, Endpoint); log = Logger.GetLogger(LoggingTarget.Network); - ProvidedUsername = config.Get(OsuSetting.Username); + ProvidedUsername = config.Get(GameSetting.Username); - authentication.TokenString = config.Get(OsuSetting.Token); + authentication.TokenString = config.Get(GameSetting.Token); authentication.Token.ValueChanged += onTokenChanged; var thread = new Thread(run) @@ -64,7 +64,7 @@ namespace osu.Game.Online.API thread.Start(); } - private void onTokenChanged(OAuthToken token) => config.Set(OsuSetting.Token, config.Get(OsuSetting.SavePassword) ? authentication.TokenString : string.Empty); + private void onTokenChanged(OAuthToken token) => config.Set(GameSetting.Token, config.Get(GameSetting.SavePassword) ? authentication.TokenString : string.Empty); private readonly List components = new List(); @@ -124,7 +124,7 @@ namespace osu.Game.Online.API State = APIState.Connecting; // save the username at this point, if the user requested for it to be. - config.Set(OsuSetting.Username, config.Get(OsuSetting.SaveUsername) ? ProvidedUsername : string.Empty); + config.Set(GameSetting.Username, config.Get(GameSetting.SaveUsername) ? ProvidedUsername : string.Empty); if (!authentication.HasValidAccessToken && !authentication.AuthenticateWithLogin(ProvidedUsername, password)) { diff --git a/osu.Game/Online/Chat/ExternalLinkOpener.cs b/osu.Game/Online/Chat/ExternalLinkOpener.cs index d8b8adbbad..816025c570 100644 --- a/osu.Game/Online/Chat/ExternalLinkOpener.cs +++ b/osu.Game/Online/Chat/ExternalLinkOpener.cs @@ -18,11 +18,11 @@ namespace osu.Game.Online.Chat private Bindable externalLinkWarning; [BackgroundDependencyLoader(true)] - private void load(GameHost host, DialogOverlay dialogOverlay, OsuConfigManager config) + private void load(GameHost host, DialogOverlay dialogOverlay, GameConfigManager config) { this.host = host; this.dialogOverlay = dialogOverlay; - externalLinkWarning = config.GetBindable(OsuSetting.ExternalLinkWarning); + externalLinkWarning = config.GetBindable(GameSetting.ExternalLinkWarning); } public void OpenUrlExternally(string url) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 3dde3d2c60..c6d90de09f 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -174,17 +174,17 @@ namespace osu.Game dependencies.CacheAs>(ruleset); // bind config int to database RulesetInfo - configRuleset = LocalConfig.GetBindable(OsuSetting.Ruleset); + configRuleset = LocalConfig.GetBindable(GameSetting.Ruleset); ruleset.Value = RulesetStore.GetRuleset(configRuleset.Value) ?? RulesetStore.AvailableRulesets.First(); ruleset.ValueChanged += r => configRuleset.Value = r.ID ?? 0; // bind config int to database SkinInfo - configSkin = LocalConfig.GetBindable(OsuSetting.Skin); + configSkin = LocalConfig.GetBindable(GameSetting.Skin); SkinManager.CurrentSkinInfo.ValueChanged += s => configSkin.Value = s.ID; configSkin.ValueChanged += id => SkinManager.CurrentSkinInfo.Value = SkinManager.Query(s => s.ID == id) ?? SkinInfo.Default; configSkin.TriggerChange(); - LocalConfig.BindWith(OsuSetting.VolumeInactive, inactiveVolumeAdjust); + LocalConfig.BindWith(GameSetting.VolumeInactive, inactiveVolumeAdjust); } private ExternalLinkOpener externalLinkOpener; @@ -631,7 +631,7 @@ namespace osu.Game direct.ToggleVisibility(); return true; case GlobalAction.ToggleGameplayMouseButtons: - LocalConfig.Set(OsuSetting.MouseDisableButtons, !LocalConfig.Get(OsuSetting.MouseDisableButtons)); + LocalConfig.Set(GameSetting.MouseDisableButtons, !LocalConfig.Get(GameSetting.MouseDisableButtons)); return true; } diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index b6c642c9dc..3c166aeeb3 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -43,7 +43,7 @@ namespace osu.Game /// public class OsuGameBase : Framework.Game, ICanAcceptFiles { - protected OsuConfigManager LocalConfig; + protected GameConfigManager LocalConfig; protected BeatmapManager BeatmapManager; @@ -206,7 +206,7 @@ namespace osu.Game // TODO: This is temporary until we reimplement the local FPS display. // It's just to allow end-users to access the framework FPS display without knowing the shortcut key. - fpsDisplayVisible = LocalConfig.GetBindable(OsuSetting.ShowFpsDisplay); + fpsDisplayVisible = LocalConfig.GetBindable(GameSetting.ShowFpsDisplay); fpsDisplayVisible.ValueChanged += val => { FrameStatisticsMode = val ? FrameStatisticsMode.Minimal : FrameStatisticsMode.None; }; fpsDisplayVisible.TriggerChange(); } @@ -237,7 +237,7 @@ namespace osu.Game public override void SetHost(GameHost host) { if (LocalConfig == null) - LocalConfig = new OsuConfigManager(host.Storage); + LocalConfig = new GameConfigManager(host.Storage); base.SetHost(host); } diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index 680e7ac416..6029e80eb0 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -325,9 +325,9 @@ namespace osu.Game.Overlays } [BackgroundDependencyLoader] - private void load(OsuConfigManager config, OsuColour colours, ChannelManager channelManager) + private void load(GameConfigManager config, OsuColour colours, ChannelManager channelManager) { - ChatHeight = config.GetBindable(OsuSetting.ChatDisplayHeight); + ChatHeight = config.GetBindable(GameSetting.ChatDisplayHeight); ChatHeight.ValueChanged += h => { chatContainer.Height = (float)h; diff --git a/osu.Game/Overlays/OnScreenDisplay.cs b/osu.Game/Overlays/OnScreenDisplay.cs index d78bd744f4..4ff7ee8819 100644 --- a/osu.Game/Overlays/OnScreenDisplay.cs +++ b/osu.Game/Overlays/OnScreenDisplay.cs @@ -117,10 +117,10 @@ namespace osu.Game.Overlays } [BackgroundDependencyLoader] - private void load(FrameworkConfigManager frameworkConfig, OsuConfigManager osuConfig) + private void load(FrameworkConfigManager frameworkConfig, GameConfigManager gameConfig) { BeginTracking(this, frameworkConfig); - BeginTracking(this, osuConfig); + BeginTracking(this, gameConfig); } private readonly Dictionary<(object, IConfigManager), TrackedSettings> trackedConfigManagers = new Dictionary<(object, IConfigManager), TrackedSettings>(); diff --git a/osu.Game/Overlays/Settings/Sections/Audio/MainMenuSettings.cs b/osu.Game/Overlays/Settings/Sections/Audio/MainMenuSettings.cs index 35f0a19796..c3b46ca1c2 100644 --- a/osu.Game/Overlays/Settings/Sections/Audio/MainMenuSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Audio/MainMenuSettings.cs @@ -11,19 +11,19 @@ namespace osu.Game.Overlays.Settings.Sections.Audio protected override string Header => "Main Menu"; [BackgroundDependencyLoader] - private void load(OsuConfigManager config) + private void load(GameConfigManager config) { Children = new[] { new SettingsCheckbox { LabelText = "Interface voices", - Bindable = config.GetBindable(OsuSetting.MenuVoice) + Bindable = config.GetBindable(GameSetting.MenuVoice) }, new SettingsCheckbox { LabelText = "osu! music theme", - Bindable = config.GetBindable(OsuSetting.MenuMusic) + Bindable = config.GetBindable(GameSetting.MenuMusic) }, }; } diff --git a/osu.Game/Overlays/Settings/Sections/Audio/OffsetSettings.cs b/osu.Game/Overlays/Settings/Sections/Audio/OffsetSettings.cs index da96c6ef30..89bc193a07 100644 --- a/osu.Game/Overlays/Settings/Sections/Audio/OffsetSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Audio/OffsetSettings.cs @@ -13,14 +13,14 @@ namespace osu.Game.Overlays.Settings.Sections.Audio protected override string Header => "Offset Adjustment"; [BackgroundDependencyLoader] - private void load(OsuConfigManager config) + private void load(GameConfigManager config) { Children = new Drawable[] { new SettingsSlider { LabelText = "Audio offset", - Bindable = config.GetBindable(OsuSetting.AudioOffset), + Bindable = config.GetBindable(GameSetting.AudioOffset), KeyboardStep = 1f }, new SettingsButton diff --git a/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs b/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs index fa4a714ba3..cf79881224 100644 --- a/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs @@ -13,12 +13,12 @@ namespace osu.Game.Overlays.Settings.Sections.Audio protected override string Header => "Volume"; [BackgroundDependencyLoader] - private void load(AudioManager audio, OsuConfigManager config) + private void load(AudioManager audio, GameConfigManager config) { Children = new Drawable[] { new SettingsSlider { LabelText = "Master", Bindable = audio.Volume, KeyboardStep = 0.01f }, - new SettingsSlider { LabelText = "Master (window inactive)", Bindable = config.GetBindable(OsuSetting.VolumeInactive), KeyboardStep = 0.01f }, + new SettingsSlider { LabelText = "Master (window inactive)", Bindable = config.GetBindable(GameSetting.VolumeInactive), KeyboardStep = 0.01f }, new SettingsSlider { LabelText = "Effect", Bindable = audio.VolumeSample, KeyboardStep = 0.01f }, new SettingsSlider { LabelText = "Music", Bindable = audio.VolumeTrack, KeyboardStep = 0.01f }, }; diff --git a/osu.Game/Overlays/Settings/Sections/Gameplay/GeneralSettings.cs b/osu.Game/Overlays/Settings/Sections/Gameplay/GeneralSettings.cs index 21d5d452bf..b11dd71285 100644 --- a/osu.Game/Overlays/Settings/Sections/Gameplay/GeneralSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Gameplay/GeneralSettings.cs @@ -13,36 +13,36 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay protected override string Header => "General"; [BackgroundDependencyLoader] - private void load(OsuConfigManager config) + private void load(GameConfigManager config) { Children = new Drawable[] { new SettingsSlider { LabelText = "Background dim", - Bindable = config.GetBindable(OsuSetting.DimLevel), + Bindable = config.GetBindable(GameSetting.DimLevel), KeyboardStep = 0.01f }, new SettingsSlider { LabelText = "Background blur", - Bindable = config.GetBindable(OsuSetting.BlurLevel), + Bindable = config.GetBindable(GameSetting.BlurLevel), KeyboardStep = 0.01f }, new SettingsCheckbox { LabelText = "Show score overlay", - Bindable = config.GetBindable(OsuSetting.ShowInterface) + Bindable = config.GetBindable(GameSetting.ShowInterface) }, new SettingsCheckbox { LabelText = "Always show key overlay", - Bindable = config.GetBindable(OsuSetting.KeyOverlay) + Bindable = config.GetBindable(GameSetting.KeyOverlay) }, new SettingsEnumDropdown { LabelText = "Score display mode", - Bindable = config.GetBindable(OsuSetting.ScoreDisplayMode) + Bindable = config.GetBindable(GameSetting.ScoreDisplayMode) } }; } diff --git a/osu.Game/Overlays/Settings/Sections/Gameplay/ModsSettings.cs b/osu.Game/Overlays/Settings/Sections/Gameplay/ModsSettings.cs index a9cefa81da..ad274c2095 100644 --- a/osu.Game/Overlays/Settings/Sections/Gameplay/ModsSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Gameplay/ModsSettings.cs @@ -11,14 +11,14 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay protected override string Header => "Mods"; [BackgroundDependencyLoader] - private void load(OsuConfigManager config) + private void load(GameConfigManager config) { Children = new[] { new SettingsCheckbox { LabelText = "Increase visibility of first object with \"Hidden\" mod", - Bindable = config.GetBindable(OsuSetting.IncreaseFirstObjectVisibility) + Bindable = config.GetBindable(GameSetting.IncreaseFirstObjectVisibility) }, }; } diff --git a/osu.Game/Overlays/Settings/Sections/Gameplay/SongSelectSettings.cs b/osu.Game/Overlays/Settings/Sections/Gameplay/SongSelectSettings.cs index 235ff0f319..bc3c3d76ef 100644 --- a/osu.Game/Overlays/Settings/Sections/Gameplay/SongSelectSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Gameplay/SongSelectSettings.cs @@ -13,36 +13,36 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay protected override string Header => "Song Select"; [BackgroundDependencyLoader] - private void load(OsuConfigManager config) + private void load(GameConfigManager config) { Children = new Drawable[] { new SettingsCheckbox { LabelText = "Right mouse drag to absolute scroll", - Bindable = config.GetBindable(OsuSetting.SongSelectRightMouseScroll), + Bindable = config.GetBindable(GameSetting.SongSelectRightMouseScroll), }, new SettingsCheckbox { LabelText = "Show converted beatmaps", - Bindable = config.GetBindable(OsuSetting.ShowConvertedBeatmaps), + Bindable = config.GetBindable(GameSetting.ShowConvertedBeatmaps), }, new SettingsSlider { LabelText = "Display beatmaps from", - Bindable = config.GetBindable(OsuSetting.DisplayStarsMinimum), + Bindable = config.GetBindable(GameSetting.DisplayStarsMinimum), KeyboardStep = 0.1f }, new SettingsSlider { LabelText = "up to", - Bindable = config.GetBindable(OsuSetting.DisplayStarsMaximum), + Bindable = config.GetBindable(GameSetting.DisplayStarsMaximum), KeyboardStep = 0.1f }, new SettingsEnumDropdown { LabelText = "Random selection algorithm", - Bindable = config.GetBindable(OsuSetting.RandomSelectAlgorithm), + Bindable = config.GetBindable(GameSetting.RandomSelectAlgorithm), } }; } diff --git a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs index 163eced103..0c16a0b0e6 100644 --- a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs @@ -206,7 +206,7 @@ namespace osu.Game.Overlays.Settings.Sections.General } [BackgroundDependencyLoader(permitNulls: true)] - private void load(APIAccess api, OsuConfigManager config, AccountCreationOverlay accountCreation) + private void load(APIAccess api, GameConfigManager config, AccountCreationOverlay accountCreation) { this.api = api; Direction = FillDirection.Vertical; @@ -232,12 +232,12 @@ namespace osu.Game.Overlays.Settings.Sections.General new SettingsCheckbox { LabelText = "Remember email address", - Bindable = config.GetBindable(OsuSetting.SaveUsername), + Bindable = config.GetBindable(GameSetting.SaveUsername), }, new SettingsCheckbox { LabelText = "Stay signed in", - Bindable = config.GetBindable(OsuSetting.SavePassword), + Bindable = config.GetBindable(GameSetting.SavePassword), }, new SettingsButton { diff --git a/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs b/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs index 34d13b1462..c54758d569 100644 --- a/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs @@ -13,14 +13,14 @@ namespace osu.Game.Overlays.Settings.Sections.General protected override string Header => "Updates"; [BackgroundDependencyLoader] - private void load(Storage storage, OsuConfigManager config) + private void load(Storage storage, GameConfigManager config) { Children = new Drawable[] { new SettingsEnumDropdown { LabelText = "Release stream", - Bindable = config.GetBindable(OsuSetting.ReleaseStream), + Bindable = config.GetBindable(GameSetting.ReleaseStream), }, new SettingsButton { diff --git a/osu.Game/Overlays/Settings/Sections/Graphics/DetailSettings.cs b/osu.Game/Overlays/Settings/Sections/Graphics/DetailSettings.cs index 54049bfb1f..9abffc3aaf 100644 --- a/osu.Game/Overlays/Settings/Sections/Graphics/DetailSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Graphics/DetailSettings.cs @@ -12,29 +12,29 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics protected override string Header => "Detail Settings"; [BackgroundDependencyLoader] - private void load(OsuConfigManager config) + private void load(GameConfigManager config) { Children = new Drawable[] { new SettingsCheckbox { LabelText = "Storyboards", - Bindable = config.GetBindable(OsuSetting.ShowStoryboard) + Bindable = config.GetBindable(GameSetting.ShowStoryboard) }, new SettingsCheckbox { LabelText = "Rotate cursor when dragging", - Bindable = config.GetBindable(OsuSetting.CursorRotation) + Bindable = config.GetBindable(GameSetting.CursorRotation) }, new SettingsEnumDropdown { LabelText = "Screenshot format", - Bindable = config.GetBindable(OsuSetting.ScreenshotFormat) + Bindable = config.GetBindable(GameSetting.ScreenshotFormat) }, new SettingsCheckbox { LabelText = "Show menu cursor in screenshots", - Bindable = config.GetBindable(OsuSetting.ScreenshotCaptureMenuCursor) + Bindable = config.GetBindable(GameSetting.ScreenshotCaptureMenuCursor) } }; } diff --git a/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs b/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs index d59e2e033e..0ca2b33d87 100644 --- a/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs @@ -38,16 +38,16 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics private const int transition_duration = 400; [BackgroundDependencyLoader] - private void load(FrameworkConfigManager config, OsuConfigManager osuConfig, OsuGameBase game) + private void load(FrameworkConfigManager config, GameConfigManager gameConfig, OsuGameBase game) { this.game = game; - scalingMode = osuConfig.GetBindable(OsuSetting.Scaling); + scalingMode = gameConfig.GetBindable(GameSetting.Scaling); sizeFullscreen = config.GetBindable(FrameworkSetting.SizeFullscreen); - scalingSizeX = osuConfig.GetBindable(OsuSetting.ScalingSizeX); - scalingSizeY = osuConfig.GetBindable(OsuSetting.ScalingSizeY); - scalingPositionX = osuConfig.GetBindable(OsuSetting.ScalingPositionX); - scalingPositionY = osuConfig.GetBindable(OsuSetting.ScalingPositionY); + scalingSizeX = gameConfig.GetBindable(GameSetting.ScalingSizeX); + scalingSizeY = gameConfig.GetBindable(GameSetting.ScalingSizeY); + scalingPositionX = gameConfig.GetBindable(GameSetting.ScalingPositionX); + scalingPositionY = gameConfig.GetBindable(GameSetting.ScalingPositionY); Container resolutionSettingsContainer; @@ -67,13 +67,13 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics { LabelText = "UI Scaling", TransferValueOnCommit = true, - Bindable = osuConfig.GetBindable(OsuSetting.UIScale), + Bindable = gameConfig.GetBindable(GameSetting.UIScale), KeyboardStep = 0.01f }, new SettingsEnumDropdown { LabelText = "Screen Scaling", - Bindable = osuConfig.GetBindable(OsuSetting.Scaling), + Bindable = gameConfig.GetBindable(GameSetting.Scaling), }, scalingSettings = new FillFlowContainer> { diff --git a/osu.Game/Overlays/Settings/Sections/Graphics/MainMenuSettings.cs b/osu.Game/Overlays/Settings/Sections/Graphics/MainMenuSettings.cs index 71d2b31946..501326022a 100644 --- a/osu.Game/Overlays/Settings/Sections/Graphics/MainMenuSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Graphics/MainMenuSettings.cs @@ -11,14 +11,14 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics protected override string Header => "User Interface"; [BackgroundDependencyLoader] - private void load(OsuConfigManager config) + private void load(GameConfigManager config) { Children = new[] { new SettingsCheckbox { LabelText = "Parallax", - Bindable = config.GetBindable(OsuSetting.MenuParallax) + Bindable = config.GetBindable(GameSetting.MenuParallax) }, }; } diff --git a/osu.Game/Overlays/Settings/Sections/Graphics/RendererSettings.cs b/osu.Game/Overlays/Settings/Sections/Graphics/RendererSettings.cs index 5f3c7aa7e9..0e0cb5d683 100644 --- a/osu.Game/Overlays/Settings/Sections/Graphics/RendererSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Graphics/RendererSettings.cs @@ -13,7 +13,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics protected override string Header => "Renderer"; [BackgroundDependencyLoader] - private void load(FrameworkConfigManager config, OsuConfigManager osuConfig) + private void load(FrameworkConfigManager config, GameConfigManager gameConfig) { // NOTE: Compatability mode omitted Children = new Drawable[] @@ -27,7 +27,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics new SettingsCheckbox { LabelText = "Show FPS", - Bindable = osuConfig.GetBindable(OsuSetting.ShowFpsDisplay) + Bindable = gameConfig.GetBindable(GameSetting.ShowFpsDisplay) }, }; } diff --git a/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs b/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs index e5cde37254..0a4f85fec8 100644 --- a/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs @@ -19,7 +19,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input private SensitivitySetting sensitivity; [BackgroundDependencyLoader] - private void load(OsuConfigManager osuConfig, FrameworkConfigManager config) + private void load(GameConfigManager gameConfig, FrameworkConfigManager config) { Children = new Drawable[] { @@ -46,12 +46,12 @@ namespace osu.Game.Overlays.Settings.Sections.Input new SettingsCheckbox { LabelText = "Disable mouse wheel during gameplay", - Bindable = osuConfig.GetBindable(OsuSetting.MouseDisableWheel) + Bindable = gameConfig.GetBindable(GameSetting.MouseDisableWheel) }, new SettingsCheckbox { LabelText = "Disable mouse buttons during gameplay", - Bindable = osuConfig.GetBindable(OsuSetting.MouseDisableButtons) + Bindable = gameConfig.GetBindable(GameSetting.MouseDisableButtons) }, }; diff --git a/osu.Game/Overlays/Settings/Sections/Online/WebSettings.cs b/osu.Game/Overlays/Settings/Sections/Online/WebSettings.cs index 62e307f323..c56e9cd2d4 100644 --- a/osu.Game/Overlays/Settings/Sections/Online/WebSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Online/WebSettings.cs @@ -12,14 +12,14 @@ namespace osu.Game.Overlays.Settings.Sections.Online protected override string Header => "Web"; [BackgroundDependencyLoader] - private void load(OsuConfigManager config) + private void load(GameConfigManager config) { Children = new Drawable[] { new SettingsCheckbox { LabelText = "Warn about opening external links", - Bindable = config.GetBindable(OsuSetting.ExternalLinkWarning) + Bindable = config.GetBindable(GameSetting.ExternalLinkWarning) }, }; } diff --git a/osu.Game/Overlays/Settings/Sections/SkinSection.cs b/osu.Game/Overlays/Settings/Sections/SkinSection.cs index 2cce47b593..b3601d39cc 100644 --- a/osu.Game/Overlays/Settings/Sections/SkinSection.cs +++ b/osu.Game/Overlays/Settings/Sections/SkinSection.cs @@ -27,7 +27,7 @@ namespace osu.Game.Overlays.Settings.Sections private SkinManager skins; [BackgroundDependencyLoader] - private void load(OsuConfigManager config, SkinManager skins) + private void load(GameConfigManager config, SkinManager skins) { this.skins = skins; @@ -38,41 +38,41 @@ namespace osu.Game.Overlays.Settings.Sections new SettingsSlider { LabelText = "Menu cursor size", - Bindable = config.GetBindable(OsuSetting.MenuCursorSize), + Bindable = config.GetBindable(GameSetting.MenuCursorSize), KeyboardStep = 0.01f }, new SettingsSlider { LabelText = "Gameplay cursor size", - Bindable = config.GetBindable(OsuSetting.GameplayCursorSize), + Bindable = config.GetBindable(GameSetting.GameplayCursorSize), KeyboardStep = 0.01f }, new SettingsCheckbox { LabelText = "Adjust gameplay cursor size based on current beatmap", - Bindable = config.GetBindable(OsuSetting.AutoCursorSize) + Bindable = config.GetBindable(GameSetting.AutoCursorSize) }, new SettingsCheckbox { LabelText = "Beatmap skins", - Bindable = config.GetBindable(OsuSetting.BeatmapSkins) + Bindable = config.GetBindable(GameSetting.BeatmapSkins) }, new SettingsCheckbox { LabelText = "Beatmap hitsounds", - Bindable = config.GetBindable(OsuSetting.BeatmapHitsounds) + Bindable = config.GetBindable(GameSetting.BeatmapHitsounds) }, }; skins.ItemAdded += itemAdded; skins.ItemRemoved += itemRemoved; - config.BindWith(OsuSetting.Skin, configBindable); + config.BindWith(GameSetting.Skin, configBindable); skinDropdown.Bindable = dropdownBindable; skinDropdown.Items = skins.GetAllUsableSkins().ToArray(); - // Todo: This should not be necessary when OsuConfigManager is databased + // Todo: This should not be necessary when GameConfigManager is databased if (skinDropdown.Items.All(s => s.ID != configBindable.Value)) configBindable.Value = 0; diff --git a/osu.Game/Rulesets/Mods/IReadFromConfig.cs b/osu.Game/Rulesets/Mods/IReadFromConfig.cs index 93c9ae0c34..2974534c05 100644 --- a/osu.Game/Rulesets/Mods/IReadFromConfig.cs +++ b/osu.Game/Rulesets/Mods/IReadFromConfig.cs @@ -10,6 +10,6 @@ namespace osu.Game.Rulesets.Mods /// public interface IReadFromConfig { - void ReadFromConfig(OsuConfigManager config); + void ReadFromConfig(GameConfigManager config); } } diff --git a/osu.Game/Rulesets/Mods/ModHidden.cs b/osu.Game/Rulesets/Mods/ModHidden.cs index b843171521..f80f19d80c 100644 --- a/osu.Game/Rulesets/Mods/ModHidden.cs +++ b/osu.Game/Rulesets/Mods/ModHidden.cs @@ -20,9 +20,9 @@ namespace osu.Game.Rulesets.Mods protected Bindable IncreaseFirstObjectVisibility = new Bindable(); - public void ReadFromConfig(OsuConfigManager config) + public void ReadFromConfig(GameConfigManager config) { - IncreaseFirstObjectVisibility = config.GetBindable(OsuSetting.IncreaseFirstObjectVisibility); + IncreaseFirstObjectVisibility = config.GetBindable(GameSetting.IncreaseFirstObjectVisibility); } public virtual void ApplyToDrawableHitObjects(IEnumerable drawables) diff --git a/osu.Game/Rulesets/UI/RulesetContainer.cs b/osu.Game/Rulesets/UI/RulesetContainer.cs index 0ea3377952..422d16509f 100644 --- a/osu.Game/Rulesets/UI/RulesetContainer.cs +++ b/osu.Game/Rulesets/UI/RulesetContainer.cs @@ -248,7 +248,7 @@ namespace osu.Game.Rulesets.UI } [BackgroundDependencyLoader] - private void load(OsuConfigManager config) + private void load(GameConfigManager config) { KeyBindingInputManager.AddRange(new Drawable[] { @@ -291,7 +291,7 @@ namespace osu.Game.Rulesets.UI /// Applies the active mods to this RulesetContainer. /// /// - private void applyRulesetMods(IEnumerable mods, OsuConfigManager config) + private void applyRulesetMods(IEnumerable mods, GameConfigManager config) { if (mods == null) return; diff --git a/osu.Game/Rulesets/UI/RulesetInputManager.cs b/osu.Game/Rulesets/UI/RulesetInputManager.cs index e85a048c34..0a4a04558c 100644 --- a/osu.Game/Rulesets/UI/RulesetInputManager.cs +++ b/osu.Game/Rulesets/UI/RulesetInputManager.cs @@ -193,9 +193,9 @@ namespace osu.Game.Rulesets.UI private Bindable mouseDisabled; [BackgroundDependencyLoader] - private void load(OsuConfigManager config) + private void load(GameConfigManager config) { - mouseDisabled = config.GetBindable(OsuSetting.MouseDisableButtons); + mouseDisabled = config.GetBindable(GameSetting.MouseDisableButtons); } protected override bool Handle(UIEvent e) diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index 8d9cd8dbe9..b98229e9e6 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -47,12 +47,12 @@ namespace osu.Game.Screens.Menu private WorkingBeatmap introBeatmap; [BackgroundDependencyLoader] - private void load(AudioManager audio, OsuConfigManager config, BeatmapManager beatmaps, Framework.Game game, BindableBeatmap beatmap) + private void load(AudioManager audio, GameConfigManager config, BeatmapManager beatmaps, Framework.Game game, BindableBeatmap beatmap) { this.beatmap.BindTo(beatmap); - menuVoice = config.GetBindable(OsuSetting.MenuVoice); - menuMusic = config.GetBindable(OsuSetting.MenuMusic); + menuVoice = config.GetBindable(GameSetting.MenuVoice); + menuMusic = config.GetBindable(GameSetting.MenuMusic); BeatmapSetInfo setInfo = null; diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index 2fef8dc4f4..9cf4af4ac7 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -101,9 +101,9 @@ namespace osu.Game.Screens.Play } [BackgroundDependencyLoader(true)] - private void load(OsuConfigManager config, NotificationOverlay notificationOverlay) + private void load(GameConfigManager config, NotificationOverlay notificationOverlay) { - showHud = config.GetBindable(OsuSetting.ShowInterface); + showHud = config.GetBindable(GameSetting.ShowInterface); showHud.ValueChanged += hudVisibility => visibilityContainer.FadeTo(hudVisibility ? 1 : 0, duration); showHud.TriggerChange(); diff --git a/osu.Game/Screens/Play/KeyCounterCollection.cs b/osu.Game/Screens/Play/KeyCounterCollection.cs index ce0e98d032..8a0da52e85 100644 --- a/osu.Game/Screens/Play/KeyCounterCollection.cs +++ b/osu.Game/Screens/Play/KeyCounterCollection.cs @@ -49,9 +49,9 @@ namespace osu.Game.Screens.Play } [BackgroundDependencyLoader] - private void load(OsuConfigManager config) + private void load(GameConfigManager config) { - config.BindWith(OsuSetting.KeyOverlay, configVisibility); + config.BindWith(GameSetting.KeyOverlay, configVisibility); Visible.BindValueChanged(_ => updateVisibility()); configVisibility.BindValueChanged(_ => updateVisibility(), true); diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index a3f46a285e..7140e5a8c6 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -92,7 +92,7 @@ namespace osu.Game.Screens.Play public bool LoadedBeatmapSuccessfully => RulesetContainer?.Objects.Any() == true; [BackgroundDependencyLoader] - private void load(AudioManager audio, APIAccess api, OsuConfigManager config) + private void load(AudioManager audio, APIAccess api, GameConfigManager config) { this.api = api; @@ -102,8 +102,8 @@ namespace osu.Game.Screens.Play sampleRestart = audio.Sample.Get(@"Gameplay/restart"); - mouseWheelDisabled = config.GetBindable(OsuSetting.MouseDisableWheel); - userAudioOffset = config.GetBindable(OsuSetting.AudioOffset); + mouseWheelDisabled = config.GetBindable(GameSetting.MouseDisableWheel); + userAudioOffset = config.GetBindable(GameSetting.AudioOffset); IBeatmap beatmap; @@ -164,7 +164,7 @@ namespace osu.Game.Screens.Play ScoreProcessor = RulesetContainer.CreateScoreProcessor(); if (!ScoreProcessor.Mode.Disabled) - config.BindWith(OsuSetting.ScoreDisplayMode, ScoreProcessor.Mode); + config.BindWith(GameSetting.ScoreDisplayMode, ScoreProcessor.Mode); Children = new Drawable[] { diff --git a/osu.Game/Screens/Play/PlayerSettings/DiscussionSettings.cs b/osu.Game/Screens/Play/PlayerSettings/DiscussionSettings.cs index 31d390effe..11e15b0f1e 100644 --- a/osu.Game/Screens/Play/PlayerSettings/DiscussionSettings.cs +++ b/osu.Game/Screens/Play/PlayerSettings/DiscussionSettings.cs @@ -13,14 +13,14 @@ namespace osu.Game.Screens.Play.PlayerSettings protected override string Title => @"discussions"; [BackgroundDependencyLoader] - private void load(OsuConfigManager config) + private void load(GameConfigManager config) { Children = new Drawable[] { new PlayerCheckbox { LabelText = "Show floating comments", - Bindable = config.GetBindable(OsuSetting.FloatingComments) + Bindable = config.GetBindable(GameSetting.FloatingComments) }, new FocusedTextBox { diff --git a/osu.Game/Screens/Play/PlayerSettings/InputSettings.cs b/osu.Game/Screens/Play/PlayerSettings/InputSettings.cs index 755ba468cc..daf3886ee9 100644 --- a/osu.Game/Screens/Play/PlayerSettings/InputSettings.cs +++ b/osu.Game/Screens/Play/PlayerSettings/InputSettings.cs @@ -25,6 +25,6 @@ namespace osu.Game.Screens.Play.PlayerSettings } [BackgroundDependencyLoader] - private void load(OsuConfigManager config) => mouseButtonsCheckbox.Bindable = config.GetBindable(OsuSetting.MouseDisableButtons); + private void load(GameConfigManager config) => mouseButtonsCheckbox.Bindable = config.GetBindable(GameSetting.MouseDisableButtons); } } diff --git a/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs b/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs index 439e344020..88017cdc38 100644 --- a/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs +++ b/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs @@ -43,13 +43,13 @@ namespace osu.Game.Screens.Play.PlayerSettings } [BackgroundDependencyLoader] - private void load(OsuConfigManager config) + private void load(GameConfigManager config) { - dimSliderBar.Bindable = config.GetBindable(OsuSetting.DimLevel); - blurSliderBar.Bindable = config.GetBindable(OsuSetting.BlurLevel); - showStoryboardToggle.Bindable = config.GetBindable(OsuSetting.ShowStoryboard); - beatmapSkinsToggle.Bindable = config.GetBindable(OsuSetting.BeatmapSkins); - beatmapHitsoundsToggle.Bindable = config.GetBindable(OsuSetting.BeatmapHitsounds); + dimSliderBar.Bindable = config.GetBindable(GameSetting.DimLevel); + blurSliderBar.Bindable = config.GetBindable(GameSetting.BlurLevel); + showStoryboardToggle.Bindable = config.GetBindable(GameSetting.ShowStoryboard); + beatmapSkinsToggle.Bindable = config.GetBindable(GameSetting.BeatmapSkins); + beatmapHitsoundsToggle.Bindable = config.GetBindable(GameSetting.BeatmapHitsounds); } } } diff --git a/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs b/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs index 61dc70c4ae..051e54120f 100644 --- a/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs +++ b/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs @@ -33,11 +33,11 @@ namespace osu.Game.Screens.Play #endregion [BackgroundDependencyLoader] - private void load(OsuConfigManager config) + private void load(GameConfigManager config) { - DimLevel = config.GetBindable(OsuSetting.DimLevel); - BlurLevel = config.GetBindable(OsuSetting.BlurLevel); - ShowStoryboard = config.GetBindable(OsuSetting.ShowStoryboard); + DimLevel = config.GetBindable(GameSetting.DimLevel); + BlurLevel = config.GetBindable(GameSetting.BlurLevel); + ShowStoryboard = config.GetBindable(GameSetting.ShowStoryboard); } protected override void OnEntering(Screen last) diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 63c97f9bd5..ba1a0308f1 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -125,10 +125,10 @@ namespace osu.Game.Screens.Select } [BackgroundDependencyLoader(permitNulls: true)] - private void load(OsuConfigManager config) + private void load(GameConfigManager config) { - config.BindWith(OsuSetting.RandomSelectAlgorithm, RandomAlgorithm); - config.BindWith(OsuSetting.SongSelectRightMouseScroll, RightClickScrollingEnabled); + config.BindWith(GameSetting.RandomSelectAlgorithm, RandomAlgorithm); + config.BindWith(GameSetting.SongSelectRightMouseScroll, RightClickScrollingEnabled); RightClickScrollingEnabled.ValueChanged += v => RightMouseScrollbar = v; RightClickScrollingEnabled.TriggerChange(); diff --git a/osu.Game/Screens/Select/BeatmapDetailAreaTabControl.cs b/osu.Game/Screens/Select/BeatmapDetailAreaTabControl.cs index e18b70a0e0..62e329f479 100644 --- a/osu.Game/Screens/Select/BeatmapDetailAreaTabControl.cs +++ b/osu.Game/Screens/Select/BeatmapDetailAreaTabControl.cs @@ -31,11 +31,11 @@ namespace osu.Game.Screens.Select } [BackgroundDependencyLoader] - private void load(OsuColour colour, OsuConfigManager config) + private void load(OsuColour colour, GameConfigManager config) { modsCheckbox.AccentColour = tabs.AccentColour = colour.YellowLight; - selectedTab = config.GetBindable(OsuSetting.BeatmapDetailTab); + selectedTab = config.GetBindable(GameSetting.BeatmapDetailTab); tabs.Current.BindTo(selectedTab); tabs.Current.TriggerChange(); diff --git a/osu.Game/Screens/Select/FilterControl.cs b/osu.Game/Screens/Select/FilterControl.cs index faffdbf31a..7ff6b3ef6e 100644 --- a/osu.Game/Screens/Select/FilterControl.cs +++ b/osu.Game/Screens/Select/FilterControl.cs @@ -173,11 +173,11 @@ namespace osu.Game.Screens.Select public readonly Box Background; [BackgroundDependencyLoader(permitNulls: true)] - private void load(OsuColour colours, IBindable parentRuleset, OsuConfigManager config) + private void load(OsuColour colours, IBindable parentRuleset, GameConfigManager config) { sortTabs.AccentColour = colours.GreenLight; - showConverted = config.GetBindable(OsuSetting.ShowConvertedBeatmaps); + showConverted = config.GetBindable(GameSetting.ShowConvertedBeatmaps); showConverted.ValueChanged += val => updateCriteria(); ruleset.BindTo(parentRuleset); diff --git a/osu.Game/Skinning/LocalSkinOverrideContainer.cs b/osu.Game/Skinning/LocalSkinOverrideContainer.cs index 2dab671936..19a8ff9baa 100644 --- a/osu.Game/Skinning/LocalSkinOverrideContainer.cs +++ b/osu.Game/Skinning/LocalSkinOverrideContainer.cs @@ -74,10 +74,10 @@ namespace osu.Game.Skinning } [BackgroundDependencyLoader] - private void load(OsuConfigManager config) + private void load(GameConfigManager config) { - config.BindWith(OsuSetting.BeatmapSkins, beatmapSkins); - config.BindWith(OsuSetting.BeatmapHitsounds, beatmapHitsounds); + config.BindWith(GameSetting.BeatmapSkins, beatmapSkins); + config.BindWith(GameSetting.BeatmapHitsounds, beatmapHitsounds); } protected override void LoadComplete()