From bca05397350e213213aabce18d4c233187809cb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 19 Oct 2020 21:00:49 +0200 Subject: [PATCH] Move setting to osu! ruleset subsection --- .../Configuration/OsuRulesetConfigManager.cs | 4 +++- osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs | 10 +++++----- osu.Game.Rulesets.Osu/UI/OsuSettingsSubsection.cs | 5 +++++ osu.Game/Configuration/OsuConfigManager.cs | 3 --- .../Settings/Sections/Gameplay/GeneralSettings.cs | 5 ----- 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Configuration/OsuRulesetConfigManager.cs b/osu.Game.Rulesets.Osu/Configuration/OsuRulesetConfigManager.cs index f76635a932..da8767c017 100644 --- a/osu.Game.Rulesets.Osu/Configuration/OsuRulesetConfigManager.cs +++ b/osu.Game.Rulesets.Osu/Configuration/OsuRulesetConfigManager.cs @@ -19,6 +19,7 @@ namespace osu.Game.Rulesets.Osu.Configuration Set(OsuRulesetSetting.SnakingInSliders, true); Set(OsuRulesetSetting.SnakingOutSliders, true); Set(OsuRulesetSetting.ShowCursorTrail, true); + Set(OsuRulesetSetting.ShowPlayfieldBorder, false); } } @@ -26,6 +27,7 @@ namespace osu.Game.Rulesets.Osu.Configuration { SnakingInSliders, SnakingOutSliders, - ShowCursorTrail + ShowCursorTrail, + ShowPlayfieldBorder, } } diff --git a/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs b/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs index e536bd1503..26fe686b0d 100644 --- a/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs +++ b/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs @@ -18,8 +18,8 @@ using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; using osu.Game.Skinning; using osu.Framework.Allocation; -using osu.Game.Configuration; using osu.Framework.Bindables; +using osu.Game.Rulesets.Osu.Configuration; using osuTK; namespace osu.Game.Rulesets.Osu.UI @@ -37,7 +37,7 @@ namespace osu.Game.Rulesets.Osu.UI protected override GameplayCursorContainer CreateCursor() => new OsuCursorContainer(); - private Bindable showPlayfieldBorder; + private readonly Bindable showPlayfieldBorder = new BindableBool(); private readonly IDictionary> poolDictionary = new Dictionary>(); @@ -87,10 +87,10 @@ namespace osu.Game.Rulesets.Osu.UI AddRangeInternal(poolDictionary.Values); } - [BackgroundDependencyLoader] - private void load(OsuConfigManager config) + [BackgroundDependencyLoader(true)] + private void load(OsuRulesetConfigManager config) { - showPlayfieldBorder = config.GetBindable(OsuSetting.ShowPlayfieldBorder); + config?.BindWith(OsuRulesetSetting.ShowPlayfieldBorder, showPlayfieldBorder); showPlayfieldBorder.BindValueChanged(updateBorderVisibility, true); } diff --git a/osu.Game.Rulesets.Osu/UI/OsuSettingsSubsection.cs b/osu.Game.Rulesets.Osu/UI/OsuSettingsSubsection.cs index 3870f303b4..28c609f412 100644 --- a/osu.Game.Rulesets.Osu/UI/OsuSettingsSubsection.cs +++ b/osu.Game.Rulesets.Osu/UI/OsuSettingsSubsection.cs @@ -39,6 +39,11 @@ namespace osu.Game.Rulesets.Osu.UI LabelText = "Cursor trail", Current = config.GetBindable(OsuRulesetSetting.ShowCursorTrail) }, + new SettingsCheckbox + { + LabelText = "Show playfield border", + Current = config.GetBindable(OsuRulesetSetting.ShowPlayfieldBorder), + }, }; } } diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index 14be15bb94..78179a781a 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -106,8 +106,6 @@ namespace osu.Game.Configuration Set(OsuSetting.IncreaseFirstObjectVisibility, true); Set(OsuSetting.GameplayDisableWinKey, true); - Set(OsuSetting.ShowPlayfieldBorder, false); - // Update Set(OsuSetting.ReleaseStream, ReleaseStream.Lazer); @@ -241,6 +239,5 @@ namespace osu.Game.Configuration HitLighting, MenuBackgroundSource, GameplayDisableWinKey, - ShowPlayfieldBorder, } } diff --git a/osu.Game/Overlays/Settings/Sections/Gameplay/GeneralSettings.cs b/osu.Game/Overlays/Settings/Sections/Gameplay/GeneralSettings.cs index e8a07fc831..07ad3c6b64 100644 --- a/osu.Game/Overlays/Settings/Sections/Gameplay/GeneralSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Gameplay/GeneralSettings.cs @@ -79,11 +79,6 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay Current = config.GetBindable(OsuSetting.ScoreDisplayMode), Keywords = new[] { "scoring" } }, - new SettingsCheckbox - { - LabelText = "Show playfield border", - Current = config.GetBindable(OsuSetting.ShowPlayfieldBorder), - }, }; if (RuntimeInfo.OS == RuntimeInfo.Platform.Windows)