From 33735b15aec08a86b6c9089a6c1fb4d1ee275021 Mon Sep 17 00:00:00 2001 From: Joehu Date: Sun, 20 Jan 2019 09:39:07 -0800 Subject: [PATCH 01/31] Update osu!direct beatmap sections sorting --- osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs b/osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs index ffea7b83e1..d828ad4a99 100644 --- a/osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs +++ b/osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs @@ -36,11 +36,12 @@ namespace osu.Game.Online.API.Requests [Description("Ranked & Approved")] RankedApproved = 0, - Approved = 1, + Qualified = 3, Loved = 8, Favourites = 2, - Qualified = 3, - Pending = 4, + + [Description("Pending & WIP")] + PendingWIP = 4, Graveyard = 5, [Description("My Maps")] From 4a9bcf4937f7f8a1477ac97d5951002342cdb310 Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 23 Jan 2019 11:38:48 +0100 Subject: [PATCH 02/31] rename OsuConfigManager to GameConfigManager also OsuSetting to GameSetting --- osu.Desktop/Overlays/VersionManager.cs | 8 +- .../Objects/Drawables/DrawableSlider.cs | 6 +- .../UI/Cursor/GameplayCursor.cs | 6 +- osu.Game.Rulesets.Osu/UI/OsuSettings.cs | 6 +- osu.Game/Configuration/GameConfigManager.cs | 175 ++++++++++++++++++ osu.Game/Configuration/OsuConfigManager.cs | 175 ------------------ .../Graphics/Containers/ParallaxContainer.cs | 4 +- .../Graphics/Containers/ScalingContainer.cs | 16 +- osu.Game/Graphics/Cursor/MenuCursor.cs | 8 +- osu.Game/Graphics/ScreenshotManager.cs | 6 +- osu.Game/Online/API/APIAccess.cs | 12 +- osu.Game/Online/Chat/ExternalLinkOpener.cs | 4 +- osu.Game/OsuGame.cs | 8 +- osu.Game/OsuGameBase.cs | 6 +- osu.Game/Overlays/ChatOverlay.cs | 4 +- osu.Game/Overlays/OnScreenDisplay.cs | 4 +- .../Sections/Audio/MainMenuSettings.cs | 6 +- .../Settings/Sections/Audio/OffsetSettings.cs | 4 +- .../Settings/Sections/Audio/VolumeSettings.cs | 4 +- .../Sections/Gameplay/GeneralSettings.cs | 12 +- .../Sections/Gameplay/ModsSettings.cs | 4 +- .../Sections/Gameplay/SongSelectSettings.cs | 12 +- .../Sections/General/LoginSettings.cs | 6 +- .../Sections/General/UpdateSettings.cs | 4 +- .../Sections/Graphics/DetailSettings.cs | 10 +- .../Sections/Graphics/LayoutSettings.cs | 16 +- .../Sections/Graphics/MainMenuSettings.cs | 4 +- .../Sections/Graphics/RendererSettings.cs | 4 +- .../Settings/Sections/Input/MouseSettings.cs | 6 +- .../Settings/Sections/Online/WebSettings.cs | 4 +- .../Overlays/Settings/Sections/SkinSection.cs | 16 +- osu.Game/Rulesets/Mods/IReadFromConfig.cs | 2 +- osu.Game/Rulesets/Mods/ModHidden.cs | 4 +- osu.Game/Rulesets/UI/RulesetContainer.cs | 4 +- osu.Game/Rulesets/UI/RulesetInputManager.cs | 4 +- osu.Game/Screens/Menu/Intro.cs | 6 +- osu.Game/Screens/Play/HUDOverlay.cs | 4 +- osu.Game/Screens/Play/KeyCounterCollection.cs | 4 +- osu.Game/Screens/Play/Player.cs | 8 +- .../Play/PlayerSettings/DiscussionSettings.cs | 4 +- .../Play/PlayerSettings/InputSettings.cs | 2 +- .../Play/PlayerSettings/VisualSettings.cs | 12 +- .../Play/ScreenWithBeatmapBackground.cs | 8 +- osu.Game/Screens/Select/BeatmapCarousel.cs | 6 +- .../Select/BeatmapDetailAreaTabControl.cs | 4 +- osu.Game/Screens/Select/FilterControl.cs | 4 +- .../Skinning/LocalSkinOverrideContainer.cs | 6 +- 47 files changed, 321 insertions(+), 321 deletions(-) create mode 100644 osu.Game/Configuration/GameConfigManager.cs delete mode 100644 osu.Game/Configuration/OsuConfigManager.cs 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() From cf147083cd508f6608d19a76358cb3738551e3e7 Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 23 Jan 2019 11:46:53 +0100 Subject: [PATCH 03/31] move osu! settings into its ruleset --- .../Configuration/OsuConfigManager.cs | 30 +++++++++++++++++++ .../Objects/Drawables/DrawableSlider.cs | 8 ++--- osu.Game.Rulesets.Osu/OsuRuleset.cs | 7 ++++- .../UI/OsuRulesetContainer.cs | 3 ++ ...suSettings.cs => OsuSettingsSubsection.cs} | 14 +++++---- 5 files changed, 51 insertions(+), 11 deletions(-) create mode 100644 osu.Game.Rulesets.Osu/Configuration/OsuConfigManager.cs rename osu.Game.Rulesets.Osu/UI/{OsuSettings.cs => OsuSettingsSubsection.cs} (65%) diff --git a/osu.Game.Rulesets.Osu/Configuration/OsuConfigManager.cs b/osu.Game.Rulesets.Osu/Configuration/OsuConfigManager.cs new file mode 100644 index 0000000000..f9039bd190 --- /dev/null +++ b/osu.Game.Rulesets.Osu/Configuration/OsuConfigManager.cs @@ -0,0 +1,30 @@ +// Copyright (c) 2007-2019 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Configuration; +using osu.Game.Rulesets.Configuration; + +namespace osu.Game.Rulesets.Osu.Configuration +{ + public class OsuConfigManager : RulesetConfigManager + { + public OsuConfigManager(SettingsStore settings, RulesetInfo ruleset, int? variant = null) + : base(settings, ruleset, variant) + { + } + + protected override void InitialiseDefaults() + { + base.InitialiseDefaults(); + + Set(OsuSetting.SnakingInSliders, true); + Set(OsuSetting.SnakingOutSliders, true); + } + } + + public enum OsuSetting + { + SnakingInSliders, + SnakingOutSliders + } +} diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index dafb54ff64..cc5d2ac70c 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -10,8 +10,8 @@ using System.Linq; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics.Containers; -using osu.Game.Configuration; using osu.Game.Rulesets.Objects; +using osu.Game.Rulesets.Osu.Configuration; using osu.Game.Rulesets.Scoring; using osuTK.Graphics; using osu.Game.Skinning; @@ -93,10 +93,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables } [BackgroundDependencyLoader] - private void load(GameConfigManager config) + private void load(OsuConfigManager config) { - config.BindWith(GameSetting.SnakingInSliders, Body.SnakingIn); - config.BindWith(GameSetting.SnakingOutSliders, Body.SnakingOut); + config.BindWith(OsuSetting.SnakingInSliders, Body.SnakingIn); + config.BindWith(OsuSetting.SnakingOutSliders, Body.SnakingOut); positionBindable.BindValueChanged(_ => Position = HitObject.StackedPosition); scaleBindable.BindValueChanged(v => diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index 5cfc24bdde..0c0e945668 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -16,8 +16,11 @@ using osu.Game.Rulesets.Edit; using osu.Game.Rulesets.Osu.Replays; using osu.Game.Rulesets.Replays.Types; using osu.Game.Beatmaps.Legacy; +using osu.Game.Configuration; +using osu.Game.Rulesets.Configuration; using osu.Game.Rulesets.Difficulty; using osu.Game.Rulesets.Osu.Beatmaps; +using osu.Game.Rulesets.Osu.Configuration; using osu.Game.Rulesets.Osu.Difficulty; using osu.Game.Scoring; @@ -139,12 +142,14 @@ namespace osu.Game.Rulesets.Osu public override string ShortName => "osu"; - public override RulesetSettingsSubsection CreateSettings() => new OsuSettings(this); + public override RulesetSettingsSubsection CreateSettings() => new OsuSettingsSubsection(this); public override int? LegacyID => 0; public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new OsuReplayFrame(); + public override IRulesetConfigManager CreateConfig(SettingsStore settings) => new OsuConfigManager(settings, RulesetInfo); + public OsuRuleset(RulesetInfo rulesetInfo = null) : base(rulesetInfo) { diff --git a/osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs b/osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs index c0e6eae494..8738fea318 100644 --- a/osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs +++ b/osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs @@ -8,6 +8,7 @@ using osu.Game.Beatmaps; using osu.Game.Input.Handlers; using osu.Game.Replays; using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Osu.Configuration; using osu.Game.Rulesets.Osu.Objects; using osu.Game.Rulesets.Osu.Objects.Drawables; using osu.Game.Rulesets.Osu.Replays; @@ -20,6 +21,8 @@ namespace osu.Game.Rulesets.Osu.UI { public class OsuRulesetContainer : RulesetContainer { + protected new OsuConfigManager Config => (OsuConfigManager)base.Config; + public OsuRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap) : base(ruleset, beatmap) { diff --git a/osu.Game.Rulesets.Osu/UI/OsuSettings.cs b/osu.Game.Rulesets.Osu/UI/OsuSettingsSubsection.cs similarity index 65% rename from osu.Game.Rulesets.Osu/UI/OsuSettings.cs rename to osu.Game.Rulesets.Osu/UI/OsuSettingsSubsection.cs index ae0b3ef4dd..9aa0f4101d 100644 --- a/osu.Game.Rulesets.Osu/UI/OsuSettings.cs +++ b/osu.Game.Rulesets.Osu/UI/OsuSettingsSubsection.cs @@ -3,34 +3,36 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; -using osu.Game.Configuration; using osu.Game.Overlays.Settings; +using osu.Game.Rulesets.Osu.Configuration; namespace osu.Game.Rulesets.Osu.UI { - public class OsuSettings : RulesetSettingsSubsection + public class OsuSettingsSubsection : RulesetSettingsSubsection { protected override string Header => "osu!"; - public OsuSettings(Ruleset ruleset) + public OsuSettingsSubsection(Ruleset ruleset) : base(ruleset) { } [BackgroundDependencyLoader] - private void load(GameConfigManager config) + private void load() { + var config = (OsuConfigManager)Config; + Children = new Drawable[] { new SettingsCheckbox { LabelText = "Snaking in sliders", - Bindable = config.GetBindable(GameSetting.SnakingInSliders) + Bindable = config.GetBindable(OsuSetting.SnakingInSliders) }, new SettingsCheckbox { LabelText = "Snaking out sliders", - Bindable = config.GetBindable(GameSetting.SnakingOutSliders) + Bindable = config.GetBindable(OsuSetting.SnakingOutSliders) }, }; } From 33b46dc4e8bec5ec6cfb6f31646deee7c28ad074 Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 23 Jan 2019 12:07:49 +0100 Subject: [PATCH 04/31] adjust year in license header to match CFS's expectations --- osu.Game.Rulesets.Osu/Configuration/OsuConfigManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Configuration/OsuConfigManager.cs b/osu.Game.Rulesets.Osu/Configuration/OsuConfigManager.cs index f9039bd190..4fa49faf1d 100644 --- a/osu.Game.Rulesets.Osu/Configuration/OsuConfigManager.cs +++ b/osu.Game.Rulesets.Osu/Configuration/OsuConfigManager.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2019 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Configuration; From 4d310c3226c34a68abac1a9ca0b1241dd6601050 Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 23 Jan 2019 14:03:26 +0100 Subject: [PATCH 05/31] fix missing dependency for slider test cases --- osu.Game.Rulesets.Osu.Tests/TestCaseSlider.cs | 12 ++++++++++++ .../TestCaseSliderSelectionBlueprint.cs | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/osu.Game.Rulesets.Osu.Tests/TestCaseSlider.cs b/osu.Game.Rulesets.Osu.Tests/TestCaseSlider.cs index 1895913917..9c72c03ab3 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestCaseSlider.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestCaseSlider.cs @@ -16,11 +16,13 @@ using osuTK.Graphics; using osu.Game.Rulesets.Mods; using System.Linq; using NUnit.Framework; +using osu.Framework.Allocation; using osu.Game.Graphics.Sprites; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Objects.Types; +using osu.Game.Rulesets.Osu.Configuration; using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces; namespace osu.Game.Rulesets.Osu.Tests @@ -39,6 +41,16 @@ namespace osu.Game.Rulesets.Osu.Tests typeof(DrawableOsuHitObject) }; + protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) + { + var dependencies = new DependencyContainer(base.CreateChildDependencies(parent)); + + var configCache = dependencies.Get(); + dependencies.CacheAs((OsuConfigManager)configCache.GetConfigFor(new OsuRuleset())); + + return dependencies; + } + private readonly Container content; protected override Container Content => content; diff --git a/osu.Game.Rulesets.Osu.Tests/TestCaseSliderSelectionBlueprint.cs b/osu.Game.Rulesets.Osu.Tests/TestCaseSliderSelectionBlueprint.cs index cd07369ccf..c139fb4e29 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestCaseSliderSelectionBlueprint.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestCaseSliderSelectionBlueprint.cs @@ -3,11 +3,13 @@ using System; using System.Collections.Generic; +using osu.Framework.Allocation; using osu.Game.Beatmaps; using osu.Game.Beatmaps.ControlPoints; using osu.Game.Rulesets.Edit; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Types; +using osu.Game.Rulesets.Osu.Configuration; using osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders; using osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components; using osu.Game.Rulesets.Osu.Objects; @@ -29,6 +31,16 @@ namespace osu.Game.Rulesets.Osu.Tests typeof(PathControlPointPiece) }; + protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) + { + var dependencies = new DependencyContainer(base.CreateChildDependencies(parent)); + + var configCache = dependencies.Get(); + dependencies.CacheAs((OsuConfigManager)configCache.GetConfigFor(new OsuRuleset())); + + return dependencies; + } + private readonly DrawableSlider drawableObject; public TestCaseSliderSelectionBlueprint() From f07ac8ebd80219875b27ce5c1279d7e3596d0cb4 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 24 Jan 2019 16:11:55 +0100 Subject: [PATCH 06/31] remove osu! specific settings from global config again --- osu.Game/Configuration/GameConfigManager.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/osu.Game/Configuration/GameConfigManager.cs b/osu.Game/Configuration/GameConfigManager.cs index 736273dc35..b2f2a8e971 100644 --- a/osu.Game/Configuration/GameConfigManager.cs +++ b/osu.Game/Configuration/GameConfigManager.cs @@ -72,9 +72,6 @@ namespace osu.Game.Configuration 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); @@ -150,8 +147,6 @@ namespace osu.Game.Configuration DisplayStarsMinimum, DisplayStarsMaximum, RandomSelectAlgorithm, - SnakingInSliders, - SnakingOutSliders, ShowFpsDisplay, ChatDisplayHeight, Version, From 8ddff673b76083a393099bfa274403a0c6e8ce47 Mon Sep 17 00:00:00 2001 From: Unknown Date: Fri, 25 Jan 2019 11:14:37 +0100 Subject: [PATCH 07/31] revert previous rename and rename ruleset specific classes instead --- osu.Desktop/Overlays/VersionManager.cs | 8 +- .../TestCaseEditor.cs | 4 +- ...anager.cs => ManiaRulesetConfigManager.cs} | 12 +- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 2 +- .../ManiaSettingsSubsection.cs | 6 +- .../UI/ManiaRulesetContainer.cs | 6 +- osu.Game.Rulesets.Osu.Tests/TestCaseSlider.cs | 2 +- .../TestCaseSliderSelectionBlueprint.cs | 2 +- ...gManager.cs => OsuRulesetConfigManager.cs} | 10 +- .../Objects/Drawables/DrawableSlider.cs | 6 +- osu.Game.Rulesets.Osu/OsuRuleset.cs | 2 +- .../UI/Cursor/GameplayCursor.cs | 6 +- .../UI/OsuRulesetContainer.cs | 2 +- osu.Game.Rulesets.Osu/UI/OsuSettings.cs | 38 ---- .../UI/OsuSettingsSubsection.cs | 6 +- osu.Game/Configuration/GameConfigManager.cs | 170 ------------------ osu.Game/Configuration/OsuConfigManager.cs | 5 - .../Graphics/Containers/ParallaxContainer.cs | 4 +- .../Graphics/Containers/ScalingContainer.cs | 16 +- osu.Game/Graphics/Cursor/MenuCursor.cs | 8 +- osu.Game/Graphics/ScreenshotManager.cs | 6 +- osu.Game/Online/API/APIAccess.cs | 12 +- osu.Game/Online/Chat/ExternalLinkOpener.cs | 4 +- osu.Game/OsuGame.cs | 8 +- osu.Game/OsuGameBase.cs | 6 +- osu.Game/Overlays/ChatOverlay.cs | 4 +- osu.Game/Overlays/OnScreenDisplay.cs | 2 +- .../Sections/Audio/MainMenuSettings.cs | 6 +- .../Settings/Sections/Audio/OffsetSettings.cs | 4 +- .../Settings/Sections/Audio/VolumeSettings.cs | 4 +- .../Sections/Gameplay/GeneralSettings.cs | 12 +- .../Sections/Gameplay/ModsSettings.cs | 4 +- .../Sections/Gameplay/SongSelectSettings.cs | 12 +- .../Sections/General/LoginSettings.cs | 6 +- .../Sections/General/UpdateSettings.cs | 4 +- .../Sections/Graphics/DetailSettings.cs | 10 +- .../Sections/Graphics/LayoutSettings.cs | 16 +- .../Sections/Graphics/MainMenuSettings.cs | 4 +- .../Sections/Graphics/RendererSettings.cs | 4 +- .../Settings/Sections/Input/MouseSettings.cs | 6 +- .../Settings/Sections/Online/WebSettings.cs | 4 +- .../Overlays/Settings/Sections/SkinSection.cs | 16 +- osu.Game/Rulesets/Mods/IReadFromConfig.cs | 2 +- osu.Game/Rulesets/Mods/ModHidden.cs | 4 +- osu.Game/Rulesets/UI/RulesetContainer.cs | 4 +- osu.Game/Rulesets/UI/RulesetInputManager.cs | 4 +- osu.Game/Screens/Menu/Intro.cs | 6 +- osu.Game/Screens/Play/HUDOverlay.cs | 4 +- osu.Game/Screens/Play/KeyCounterCollection.cs | 4 +- osu.Game/Screens/Play/Player.cs | 8 +- .../Play/PlayerSettings/DiscussionSettings.cs | 4 +- .../Play/PlayerSettings/InputSettings.cs | 2 +- .../Play/PlayerSettings/VisualSettings.cs | 12 +- .../Play/ScreenWithBeatmapBackground.cs | 8 +- osu.Game/Screens/Select/BeatmapCarousel.cs | 6 +- .../Select/BeatmapDetailAreaTabControl.cs | 4 +- osu.Game/Screens/Select/FilterControl.cs | 4 +- .../Skinning/LocalSkinOverrideContainer.cs | 6 +- 58 files changed, 169 insertions(+), 382 deletions(-) rename osu.Game.Rulesets.Mania/Configuration/{ManiaConfigManager.cs => ManiaRulesetConfigManager.cs} (57%) rename osu.Game.Rulesets.Osu/Configuration/{OsuConfigManager.cs => OsuRulesetConfigManager.cs} (60%) delete mode 100644 osu.Game.Rulesets.Osu/UI/OsuSettings.cs delete mode 100644 osu.Game/Configuration/GameConfigManager.cs diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index da9ff79d3a..5b67d528ae 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 GameConfigManager config; + private OsuConfigManager config; private OsuGameBase game; private NotificationOverlay notificationOverlay; private GameHost host; [BackgroundDependencyLoader] - private void load(NotificationOverlay notification, OsuColour colours, TextureStore textures, OsuGameBase game, GameConfigManager config, GameHost host) + private void load(NotificationOverlay notification, OsuColour colours, TextureStore textures, OsuGameBase game, OsuConfigManager 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(GameSetting.Version); + var lastVersion = config.Get(OsuSetting.Version); if (game.IsDeployedBuild && version != lastVersion) { - config.Set(GameSetting.Version, version); + config.Set(OsuSetting.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.Mania.Tests/TestCaseEditor.cs b/osu.Game.Rulesets.Mania.Tests/TestCaseEditor.cs index 32f455bb73..7b865cefa7 100644 --- a/osu.Game.Rulesets.Mania.Tests/TestCaseEditor.cs +++ b/osu.Game.Rulesets.Mania.Tests/TestCaseEditor.cs @@ -25,8 +25,8 @@ namespace osu.Game.Rulesets.Mania.Tests [BackgroundDependencyLoader] private void load(RulesetConfigCache configCache) { - var config = (ManiaConfigManager)configCache.GetConfigFor(Ruleset.Value.CreateInstance()); - config.BindWith(ManiaSetting.ScrollDirection, direction); + var config = (ManiaRulesetConfigManager)configCache.GetConfigFor(Ruleset.Value.CreateInstance()); + config.BindWith(ManiaRulesetSetting.ScrollDirection, direction); } } } diff --git a/osu.Game.Rulesets.Mania/Configuration/ManiaConfigManager.cs b/osu.Game.Rulesets.Mania/Configuration/ManiaRulesetConfigManager.cs similarity index 57% rename from osu.Game.Rulesets.Mania/Configuration/ManiaConfigManager.cs rename to osu.Game.Rulesets.Mania/Configuration/ManiaRulesetConfigManager.cs index 4e0ad31105..b591f9da22 100644 --- a/osu.Game.Rulesets.Mania/Configuration/ManiaConfigManager.cs +++ b/osu.Game.Rulesets.Mania/Configuration/ManiaRulesetConfigManager.cs @@ -8,9 +8,9 @@ using osu.Game.Rulesets.Mania.UI; namespace osu.Game.Rulesets.Mania.Configuration { - public class ManiaConfigManager : RulesetConfigManager + public class ManiaRulesetConfigManager : RulesetConfigManager { - public ManiaConfigManager(SettingsStore settings, RulesetInfo ruleset, int? variant = null) + public ManiaRulesetConfigManager(SettingsStore settings, RulesetInfo ruleset, int? variant = null) : base(settings, ruleset, variant) { } @@ -19,17 +19,17 @@ namespace osu.Game.Rulesets.Mania.Configuration { base.InitialiseDefaults(); - Set(ManiaSetting.ScrollTime, 2250.0, 50.0, 10000.0, 50.0); - Set(ManiaSetting.ScrollDirection, ManiaScrollingDirection.Down); + Set(ManiaRulesetSetting.ScrollTime, 2250.0, 50.0, 10000.0, 50.0); + Set(ManiaRulesetSetting.ScrollDirection, ManiaScrollingDirection.Down); } public override TrackedSettings CreateTrackedSettings() => new TrackedSettings { - new TrackedSetting(ManiaSetting.ScrollTime, v => new SettingDescription(v, "Scroll Time", $"{v}ms")) + new TrackedSetting(ManiaRulesetSetting.ScrollTime, v => new SettingDescription(v, "Scroll Time", $"{v}ms")) }; } - public enum ManiaSetting + public enum ManiaRulesetSetting { ScrollTime, ScrollDirection diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index 57728dd134..c589418450 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -162,7 +162,7 @@ namespace osu.Game.Rulesets.Mania public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new ManiaReplayFrame(); - public override IRulesetConfigManager CreateConfig(SettingsStore settings) => new ManiaConfigManager(settings, RulesetInfo); + public override IRulesetConfigManager CreateConfig(SettingsStore settings) => new ManiaRulesetConfigManager(settings, RulesetInfo); public override RulesetSettingsSubsection CreateSettings() => new ManiaSettingsSubsection(this); diff --git a/osu.Game.Rulesets.Mania/ManiaSettingsSubsection.cs b/osu.Game.Rulesets.Mania/ManiaSettingsSubsection.cs index 2ab40b2bc6..2ebfd0cfc1 100644 --- a/osu.Game.Rulesets.Mania/ManiaSettingsSubsection.cs +++ b/osu.Game.Rulesets.Mania/ManiaSettingsSubsection.cs @@ -22,19 +22,19 @@ namespace osu.Game.Rulesets.Mania [BackgroundDependencyLoader] private void load() { - var config = (ManiaConfigManager)Config; + var config = (ManiaRulesetConfigManager)Config; Children = new Drawable[] { new SettingsEnumDropdown { LabelText = "Scrolling direction", - Bindable = config.GetBindable(ManiaSetting.ScrollDirection) + Bindable = config.GetBindable(ManiaRulesetSetting.ScrollDirection) }, new SettingsSlider { LabelText = "Scroll speed", - Bindable = config.GetBindable(ManiaSetting.ScrollTime) + Bindable = config.GetBindable(ManiaRulesetSetting.ScrollTime) }, }; } diff --git a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs index 892ad584dc..5b9debf42b 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs @@ -35,7 +35,7 @@ namespace osu.Game.Rulesets.Mania.UI public IEnumerable BarLines; - protected new ManiaConfigManager Config => (ManiaConfigManager)base.Config; + protected new ManiaRulesetConfigManager Config => (ManiaRulesetConfigManager)base.Config; private readonly Bindable configDirection = new Bindable(); @@ -75,10 +75,10 @@ namespace osu.Game.Rulesets.Mania.UI { BarLines.ForEach(Playfield.Add); - Config.BindWith(ManiaSetting.ScrollDirection, configDirection); + Config.BindWith(ManiaRulesetSetting.ScrollDirection, configDirection); configDirection.BindValueChanged(v => Direction.Value = (ScrollingDirection)v, true); - Config.BindWith(ManiaSetting.ScrollTime, TimeRange); + Config.BindWith(ManiaRulesetSetting.ScrollTime, TimeRange); } /// diff --git a/osu.Game.Rulesets.Osu.Tests/TestCaseSlider.cs b/osu.Game.Rulesets.Osu.Tests/TestCaseSlider.cs index 6baa02fd1f..5838e1af6a 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestCaseSlider.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestCaseSlider.cs @@ -46,7 +46,7 @@ namespace osu.Game.Rulesets.Osu.Tests var dependencies = new DependencyContainer(base.CreateChildDependencies(parent)); var configCache = dependencies.Get(); - dependencies.CacheAs((OsuConfigManager)configCache.GetConfigFor(new OsuRuleset())); + dependencies.CacheAs((OsuRulesetConfigManager)configCache.GetConfigFor(new OsuRuleset())); return dependencies; } diff --git a/osu.Game.Rulesets.Osu.Tests/TestCaseSliderSelectionBlueprint.cs b/osu.Game.Rulesets.Osu.Tests/TestCaseSliderSelectionBlueprint.cs index a6f7a0b0d7..4279925db5 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestCaseSliderSelectionBlueprint.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestCaseSliderSelectionBlueprint.cs @@ -36,7 +36,7 @@ namespace osu.Game.Rulesets.Osu.Tests var dependencies = new DependencyContainer(base.CreateChildDependencies(parent)); var configCache = dependencies.Get(); - dependencies.CacheAs((OsuConfigManager)configCache.GetConfigFor(new OsuRuleset())); + dependencies.CacheAs((OsuRulesetConfigManager)configCache.GetConfigFor(new OsuRuleset())); return dependencies; } diff --git a/osu.Game.Rulesets.Osu/Configuration/OsuConfigManager.cs b/osu.Game.Rulesets.Osu/Configuration/OsuRulesetConfigManager.cs similarity index 60% rename from osu.Game.Rulesets.Osu/Configuration/OsuConfigManager.cs rename to osu.Game.Rulesets.Osu/Configuration/OsuRulesetConfigManager.cs index 4fa49faf1d..d931fb0eff 100644 --- a/osu.Game.Rulesets.Osu/Configuration/OsuConfigManager.cs +++ b/osu.Game.Rulesets.Osu/Configuration/OsuRulesetConfigManager.cs @@ -6,9 +6,9 @@ using osu.Game.Rulesets.Configuration; namespace osu.Game.Rulesets.Osu.Configuration { - public class OsuConfigManager : RulesetConfigManager + public class OsuRulesetConfigManager : RulesetConfigManager { - public OsuConfigManager(SettingsStore settings, RulesetInfo ruleset, int? variant = null) + public OsuRulesetConfigManager(SettingsStore settings, RulesetInfo ruleset, int? variant = null) : base(settings, ruleset, variant) { } @@ -17,12 +17,12 @@ namespace osu.Game.Rulesets.Osu.Configuration { base.InitialiseDefaults(); - Set(OsuSetting.SnakingInSliders, true); - Set(OsuSetting.SnakingOutSliders, true); + Set(OsuRulesetSetting.SnakingInSliders, true); + Set(OsuRulesetSetting.SnakingOutSliders, true); } } - public enum OsuSetting + public enum OsuRulesetSetting { SnakingInSliders, SnakingOutSliders diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index 5ad47a8c27..b107fcc028 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(OsuRulesetConfigManager rulesetConfig) { - config.BindWith(OsuSetting.SnakingInSliders, Body.SnakingIn); - config.BindWith(OsuSetting.SnakingOutSliders, Body.SnakingOut); + rulesetConfig.BindWith(OsuRulesetSetting.SnakingInSliders, Body.SnakingIn); + rulesetConfig.BindWith(OsuRulesetSetting.SnakingOutSliders, Body.SnakingOut); positionBindable.BindValueChanged(_ => Position = HitObject.StackedPosition); scaleBindable.BindValueChanged(v => diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index 997b2a3c56..8e22d82e30 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -148,7 +148,7 @@ namespace osu.Game.Rulesets.Osu public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new OsuReplayFrame(); - public override IRulesetConfigManager CreateConfig(SettingsStore settings) => new OsuConfigManager(settings, RulesetInfo); + public override IRulesetConfigManager CreateConfig(SettingsStore settings) => new OsuRulesetConfigManager(settings, RulesetInfo); public OsuRuleset(RulesetInfo rulesetInfo = null) : base(rulesetInfo) diff --git a/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs index 0e7566a15d..3fef769174 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(GameConfigManager config, IBindableBeatmap beatmap) + private void load(OsuConfigManager 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(GameSetting.GameplayCursorSize); + cursorScale = config.GetBindable(OsuSetting.GameplayCursorSize); cursorScale.ValueChanged += v => calculateScale(); - autoCursorScale = config.GetBindable(GameSetting.AutoCursorSize); + autoCursorScale = config.GetBindable(OsuSetting.AutoCursorSize); autoCursorScale.ValueChanged += v => calculateScale(); calculateScale(); diff --git a/osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs b/osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs index fcb6b0204d..b096b8992d 100644 --- a/osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs +++ b/osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs @@ -21,7 +21,7 @@ namespace osu.Game.Rulesets.Osu.UI { public class OsuRulesetContainer : RulesetContainer { - protected new OsuConfigManager Config => (OsuConfigManager)base.Config; + protected new OsuRulesetConfigManager Config => (OsuRulesetConfigManager)base.Config; public OsuRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap) : base(ruleset, beatmap) diff --git a/osu.Game.Rulesets.Osu/UI/OsuSettings.cs b/osu.Game.Rulesets.Osu/UI/OsuSettings.cs deleted file mode 100644 index 25c009b117..0000000000 --- a/osu.Game.Rulesets.Osu/UI/OsuSettings.cs +++ /dev/null @@ -1,38 +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.Allocation; -using osu.Framework.Graphics; -using osu.Game.Configuration; -using osu.Game.Overlays.Settings; - -namespace osu.Game.Rulesets.Osu.UI -{ - public class OsuSettings : RulesetSettingsSubsection - { - protected override string Header => "osu!"; - - public OsuSettings(Ruleset ruleset) - : base(ruleset) - { - } - - [BackgroundDependencyLoader] - private void load(OsuConfigManager config) - { - Children = new Drawable[] - { - new SettingsCheckbox - { - LabelText = "Snaking in sliders", - Bindable = config.GetBindable(OsuSetting.SnakingInSliders) - }, - new SettingsCheckbox - { - LabelText = "Snaking out sliders", - Bindable = config.GetBindable(OsuSetting.SnakingOutSliders) - }, - }; - } - } -} diff --git a/osu.Game.Rulesets.Osu/UI/OsuSettingsSubsection.cs b/osu.Game.Rulesets.Osu/UI/OsuSettingsSubsection.cs index 9aa0f4101d..b4c873cf20 100644 --- a/osu.Game.Rulesets.Osu/UI/OsuSettingsSubsection.cs +++ b/osu.Game.Rulesets.Osu/UI/OsuSettingsSubsection.cs @@ -20,19 +20,19 @@ namespace osu.Game.Rulesets.Osu.UI [BackgroundDependencyLoader] private void load() { - var config = (OsuConfigManager)Config; + var config = (OsuRulesetConfigManager)Config; Children = new Drawable[] { new SettingsCheckbox { LabelText = "Snaking in sliders", - Bindable = config.GetBindable(OsuSetting.SnakingInSliders) + Bindable = config.GetBindable(OsuRulesetSetting.SnakingInSliders) }, new SettingsCheckbox { LabelText = "Snaking out sliders", - Bindable = config.GetBindable(OsuSetting.SnakingOutSliders) + Bindable = config.GetBindable(OsuRulesetSetting.SnakingOutSliders) }, }; } diff --git a/osu.Game/Configuration/GameConfigManager.cs b/osu.Game/Configuration/GameConfigManager.cs deleted file mode 100644 index b2f2a8e971..0000000000 --- a/osu.Game/Configuration/GameConfigManager.cs +++ /dev/null @@ -1,170 +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 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); - - // 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, - 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 index 1b279eee44..aed56d79bf 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -72,9 +72,6 @@ namespace osu.Game.Configuration 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); @@ -150,8 +147,6 @@ namespace osu.Game.Configuration DisplayStarsMinimum, DisplayStarsMaximum, RandomSelectAlgorithm, - SnakingInSliders, - SnakingOutSliders, ShowFpsDisplay, ChatDisplayHeight, Version, diff --git a/osu.Game/Graphics/Containers/ParallaxContainer.cs b/osu.Game/Graphics/Containers/ParallaxContainer.cs index d5ac43bfe5..f7d30dc109 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(GameConfigManager config) + private void load(OsuConfigManager config) { - parallaxEnabled = config.GetBindable(GameSetting.MenuParallax); + parallaxEnabled = config.GetBindable(OsuSetting.MenuParallax); parallaxEnabled.ValueChanged += delegate { if (!parallaxEnabled) diff --git a/osu.Game/Graphics/Containers/ScalingContainer.cs b/osu.Game/Graphics/Containers/ScalingContainer.cs index 4abe42b99b..4973cb0608 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(GameConfigManager gameConfig) + private void load(OsuConfigManager gameConfig) { if (applyUIScale) { - uiScale = gameConfig.GetBindable(GameSetting.UIScale); + uiScale = gameConfig.GetBindable(OsuSetting.UIScale); uiScale.BindValueChanged(scaleChanged, true); } } @@ -82,21 +82,21 @@ namespace osu.Game.Graphics.Containers } [BackgroundDependencyLoader] - private void load(GameConfigManager config) + private void load(OsuConfigManager config) { - scalingMode = config.GetBindable(GameSetting.Scaling); + scalingMode = config.GetBindable(OsuSetting.Scaling); scalingMode.ValueChanged += _ => updateSize(); - sizeX = config.GetBindable(GameSetting.ScalingSizeX); + sizeX = config.GetBindable(OsuSetting.ScalingSizeX); sizeX.ValueChanged += _ => updateSize(); - sizeY = config.GetBindable(GameSetting.ScalingSizeY); + sizeY = config.GetBindable(OsuSetting.ScalingSizeY); sizeY.ValueChanged += _ => updateSize(); - posX = config.GetBindable(GameSetting.ScalingPositionX); + posX = config.GetBindable(OsuSetting.ScalingPositionX); posX.ValueChanged += _ => updateSize(); - posY = config.GetBindable(GameSetting.ScalingPositionY); + posY = config.GetBindable(OsuSetting.ScalingPositionY); posY.ValueChanged += _ => updateSize(); } diff --git a/osu.Game/Graphics/Cursor/MenuCursor.cs b/osu.Game/Graphics/Cursor/MenuCursor.cs index d32d06a0fe..76c2345cd5 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] GameConfigManager config, [CanBeNull] ScreenshotManager screenshotManager) + private void load([NotNull] OsuConfigManager config, [CanBeNull] ScreenshotManager screenshotManager) { - cursorRotate = config.GetBindable(GameSetting.CursorRotation); + cursorRotate = config.GetBindable(OsuSetting.CursorRotation); if (screenshotManager != null) screenshotCursorVisibility.BindTo(screenshotManager.CursorVisibility); @@ -131,7 +131,7 @@ namespace osu.Game.Graphics.Cursor } [BackgroundDependencyLoader] - private void load(GameConfigManager config, TextureStore textures, OsuColour colour) + private void load(OsuConfigManager config, TextureStore textures, OsuColour colour) { Children = new Drawable[] { @@ -155,7 +155,7 @@ namespace osu.Game.Graphics.Cursor } }; - cursorScale = config.GetBindable(GameSetting.MenuCursorSize); + cursorScale = config.GetBindable(OsuSetting.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 ce8ee4fff6..ef4209f6f3 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, GameConfigManager config, Storage storage, NotificationOverlay notificationOverlay, AudioManager audio) + private void load(GameHost host, OsuConfigManager config, Storage storage, NotificationOverlay notificationOverlay, AudioManager audio) { this.host = host; this.storage = storage.GetStorageForDirectory(@"screenshots"); this.notificationOverlay = notificationOverlay; - screenshotFormat = config.GetBindable(GameSetting.ScreenshotFormat); - captureMenuCursor = config.GetBindable(GameSetting.ScreenshotCaptureMenuCursor); + screenshotFormat = config.GetBindable(OsuSetting.ScreenshotFormat); + captureMenuCursor = config.GetBindable(OsuSetting.ScreenshotCaptureMenuCursor); shutter = audio.Sample.Get("UI/shutter"); } diff --git a/osu.Game/Online/API/APIAccess.cs b/osu.Game/Online/API/APIAccess.cs index 74dcacc5a5..9f5eb1441c 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 GameConfigManager config; + private readonly OsuConfigManager 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(GameConfigManager config) + public APIAccess(OsuConfigManager config) { this.config = config; authentication = new OAuth(client_id, client_secret, Endpoint); log = Logger.GetLogger(LoggingTarget.Network); - ProvidedUsername = config.Get(GameSetting.Username); + ProvidedUsername = config.Get(OsuSetting.Username); - authentication.TokenString = config.Get(GameSetting.Token); + authentication.TokenString = config.Get(OsuSetting.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(GameSetting.Token, config.Get(GameSetting.SavePassword) ? authentication.TokenString : string.Empty); + private void onTokenChanged(OAuthToken token) => config.Set(OsuSetting.Token, config.Get(OsuSetting.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(GameSetting.Username, config.Get(GameSetting.SaveUsername) ? ProvidedUsername : string.Empty); + config.Set(OsuSetting.Username, config.Get(OsuSetting.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 b82e8d9bd4..a2c5a3cf8c 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, GameConfigManager config) + private void load(GameHost host, DialogOverlay dialogOverlay, OsuConfigManager config) { this.host = host; this.dialogOverlay = dialogOverlay; - externalLinkWarning = config.GetBindable(GameSetting.ExternalLinkWarning); + externalLinkWarning = config.GetBindable(OsuSetting.ExternalLinkWarning); } public void OpenUrlExternally(string url) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index b9f7013db1..771dacfed3 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(GameSetting.Ruleset); + configRuleset = LocalConfig.GetBindable(OsuSetting.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(GameSetting.Skin); + configSkin = LocalConfig.GetBindable(OsuSetting.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(GameSetting.VolumeInactive, inactiveVolumeAdjust); + LocalConfig.BindWith(OsuSetting.VolumeInactive, inactiveVolumeAdjust); } private ExternalLinkOpener externalLinkOpener; @@ -631,7 +631,7 @@ namespace osu.Game direct.ToggleVisibility(); return true; case GlobalAction.ToggleGameplayMouseButtons: - LocalConfig.Set(GameSetting.MouseDisableButtons, !LocalConfig.Get(GameSetting.MouseDisableButtons)); + LocalConfig.Set(OsuSetting.MouseDisableButtons, !LocalConfig.Get(OsuSetting.MouseDisableButtons)); return true; } diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index 17bba66b3f..963d902dc8 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 GameConfigManager LocalConfig; + protected OsuConfigManager 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(GameSetting.ShowFpsDisplay); + fpsDisplayVisible = LocalConfig.GetBindable(OsuSetting.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 GameConfigManager(host.Storage); + LocalConfig = new OsuConfigManager(host.Storage); base.SetHost(host); } diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index 995733ab09..74edf48433 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(GameConfigManager config, OsuColour colours, ChannelManager channelManager) + private void load(OsuConfigManager config, OsuColour colours, ChannelManager channelManager) { - ChatHeight = config.GetBindable(GameSetting.ChatDisplayHeight); + ChatHeight = config.GetBindable(OsuSetting.ChatDisplayHeight); ChatHeight.ValueChanged += h => { chatContainer.Height = (float)h; diff --git a/osu.Game/Overlays/OnScreenDisplay.cs b/osu.Game/Overlays/OnScreenDisplay.cs index 0a7c869968..becf70b03b 100644 --- a/osu.Game/Overlays/OnScreenDisplay.cs +++ b/osu.Game/Overlays/OnScreenDisplay.cs @@ -117,7 +117,7 @@ namespace osu.Game.Overlays } [BackgroundDependencyLoader] - private void load(FrameworkConfigManager frameworkConfig, GameConfigManager gameConfig) + private void load(FrameworkConfigManager frameworkConfig, OsuConfigManager gameConfig) { BeginTracking(this, frameworkConfig); BeginTracking(this, gameConfig); diff --git a/osu.Game/Overlays/Settings/Sections/Audio/MainMenuSettings.cs b/osu.Game/Overlays/Settings/Sections/Audio/MainMenuSettings.cs index 2999824df0..4e43caff23 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(GameConfigManager config) + private void load(OsuConfigManager config) { Children = new[] { new SettingsCheckbox { LabelText = "Interface voices", - Bindable = config.GetBindable(GameSetting.MenuVoice) + Bindable = config.GetBindable(OsuSetting.MenuVoice) }, new SettingsCheckbox { LabelText = "osu! music theme", - Bindable = config.GetBindable(GameSetting.MenuMusic) + Bindable = config.GetBindable(OsuSetting.MenuMusic) }, }; } diff --git a/osu.Game/Overlays/Settings/Sections/Audio/OffsetSettings.cs b/osu.Game/Overlays/Settings/Sections/Audio/OffsetSettings.cs index 514fcac5e4..aaa4302553 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(GameConfigManager config) + private void load(OsuConfigManager config) { Children = new Drawable[] { new SettingsSlider { LabelText = "Audio offset", - Bindable = config.GetBindable(GameSetting.AudioOffset), + Bindable = config.GetBindable(OsuSetting.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 9ad6e6ddf8..0124f7090e 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, GameConfigManager config) + private void load(AudioManager audio, OsuConfigManager config) { Children = new Drawable[] { new SettingsSlider { LabelText = "Master", Bindable = audio.Volume, KeyboardStep = 0.01f }, - new SettingsSlider { LabelText = "Master (window inactive)", Bindable = config.GetBindable(GameSetting.VolumeInactive), KeyboardStep = 0.01f }, + new SettingsSlider { LabelText = "Master (window inactive)", Bindable = config.GetBindable(OsuSetting.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 15a854b0a8..997d1354b3 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(GameConfigManager config) + private void load(OsuConfigManager config) { Children = new Drawable[] { new SettingsSlider { LabelText = "Background dim", - Bindable = config.GetBindable(GameSetting.DimLevel), + Bindable = config.GetBindable(OsuSetting.DimLevel), KeyboardStep = 0.01f }, new SettingsSlider { LabelText = "Background blur", - Bindable = config.GetBindable(GameSetting.BlurLevel), + Bindable = config.GetBindable(OsuSetting.BlurLevel), KeyboardStep = 0.01f }, new SettingsCheckbox { LabelText = "Show score overlay", - Bindable = config.GetBindable(GameSetting.ShowInterface) + Bindable = config.GetBindable(OsuSetting.ShowInterface) }, new SettingsCheckbox { LabelText = "Always show key overlay", - Bindable = config.GetBindable(GameSetting.KeyOverlay) + Bindable = config.GetBindable(OsuSetting.KeyOverlay) }, new SettingsEnumDropdown { LabelText = "Score display mode", - Bindable = config.GetBindable(GameSetting.ScoreDisplayMode) + Bindable = config.GetBindable(OsuSetting.ScoreDisplayMode) } }; } diff --git a/osu.Game/Overlays/Settings/Sections/Gameplay/ModsSettings.cs b/osu.Game/Overlays/Settings/Sections/Gameplay/ModsSettings.cs index 20912da72c..2cf14f5aff 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(GameConfigManager config) + private void load(OsuConfigManager config) { Children = new[] { new SettingsCheckbox { LabelText = "Increase visibility of first object with \"Hidden\" mod", - Bindable = config.GetBindable(GameSetting.IncreaseFirstObjectVisibility) + Bindable = config.GetBindable(OsuSetting.IncreaseFirstObjectVisibility) }, }; } diff --git a/osu.Game/Overlays/Settings/Sections/Gameplay/SongSelectSettings.cs b/osu.Game/Overlays/Settings/Sections/Gameplay/SongSelectSettings.cs index db767ac933..3e2272dba6 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(GameConfigManager config) + private void load(OsuConfigManager config) { Children = new Drawable[] { new SettingsCheckbox { LabelText = "Right mouse drag to absolute scroll", - Bindable = config.GetBindable(GameSetting.SongSelectRightMouseScroll), + Bindable = config.GetBindable(OsuSetting.SongSelectRightMouseScroll), }, new SettingsCheckbox { LabelText = "Show converted beatmaps", - Bindable = config.GetBindable(GameSetting.ShowConvertedBeatmaps), + Bindable = config.GetBindable(OsuSetting.ShowConvertedBeatmaps), }, new SettingsSlider { LabelText = "Display beatmaps from", - Bindable = config.GetBindable(GameSetting.DisplayStarsMinimum), + Bindable = config.GetBindable(OsuSetting.DisplayStarsMinimum), KeyboardStep = 0.1f }, new SettingsSlider { LabelText = "up to", - Bindable = config.GetBindable(GameSetting.DisplayStarsMaximum), + Bindable = config.GetBindable(OsuSetting.DisplayStarsMaximum), KeyboardStep = 0.1f }, new SettingsEnumDropdown { LabelText = "Random selection algorithm", - Bindable = config.GetBindable(GameSetting.RandomSelectAlgorithm), + Bindable = config.GetBindable(OsuSetting.RandomSelectAlgorithm), } }; } diff --git a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs index 23d0dcbe38..4fad999577 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, GameConfigManager config, AccountCreationOverlay accountCreation) + private void load(APIAccess api, OsuConfigManager 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(GameSetting.SaveUsername), + Bindable = config.GetBindable(OsuSetting.SaveUsername), }, new SettingsCheckbox { LabelText = "Stay signed in", - Bindable = config.GetBindable(GameSetting.SavePassword), + Bindable = config.GetBindable(OsuSetting.SavePassword), }, new SettingsButton { diff --git a/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs b/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs index e94d94dd36..4d889856f6 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, GameConfigManager config) + private void load(Storage storage, OsuConfigManager config) { Children = new Drawable[] { new SettingsEnumDropdown { LabelText = "Release stream", - Bindable = config.GetBindable(GameSetting.ReleaseStream), + Bindable = config.GetBindable(OsuSetting.ReleaseStream), }, new SettingsButton { diff --git a/osu.Game/Overlays/Settings/Sections/Graphics/DetailSettings.cs b/osu.Game/Overlays/Settings/Sections/Graphics/DetailSettings.cs index 3917def00b..01cdc9aa32 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(GameConfigManager config) + private void load(OsuConfigManager config) { Children = new Drawable[] { new SettingsCheckbox { LabelText = "Storyboards", - Bindable = config.GetBindable(GameSetting.ShowStoryboard) + Bindable = config.GetBindable(OsuSetting.ShowStoryboard) }, new SettingsCheckbox { LabelText = "Rotate cursor when dragging", - Bindable = config.GetBindable(GameSetting.CursorRotation) + Bindable = config.GetBindable(OsuSetting.CursorRotation) }, new SettingsEnumDropdown { LabelText = "Screenshot format", - Bindable = config.GetBindable(GameSetting.ScreenshotFormat) + Bindable = config.GetBindable(OsuSetting.ScreenshotFormat) }, new SettingsCheckbox { LabelText = "Show menu cursor in screenshots", - Bindable = config.GetBindable(GameSetting.ScreenshotCaptureMenuCursor) + Bindable = config.GetBindable(OsuSetting.ScreenshotCaptureMenuCursor) } }; } diff --git a/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs b/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs index 768335b127..43309990a1 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, GameConfigManager gameConfig, OsuGameBase game) + private void load(FrameworkConfigManager config, OsuConfigManager gameConfig, OsuGameBase game) { this.game = game; - scalingMode = gameConfig.GetBindable(GameSetting.Scaling); + scalingMode = gameConfig.GetBindable(OsuSetting.Scaling); sizeFullscreen = config.GetBindable(FrameworkSetting.SizeFullscreen); - scalingSizeX = gameConfig.GetBindable(GameSetting.ScalingSizeX); - scalingSizeY = gameConfig.GetBindable(GameSetting.ScalingSizeY); - scalingPositionX = gameConfig.GetBindable(GameSetting.ScalingPositionX); - scalingPositionY = gameConfig.GetBindable(GameSetting.ScalingPositionY); + scalingSizeX = gameConfig.GetBindable(OsuSetting.ScalingSizeX); + scalingSizeY = gameConfig.GetBindable(OsuSetting.ScalingSizeY); + scalingPositionX = gameConfig.GetBindable(OsuSetting.ScalingPositionX); + scalingPositionY = gameConfig.GetBindable(OsuSetting.ScalingPositionY); Container resolutionSettingsContainer; @@ -67,13 +67,13 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics { LabelText = "UI Scaling", TransferValueOnCommit = true, - Bindable = gameConfig.GetBindable(GameSetting.UIScale), + Bindable = gameConfig.GetBindable(OsuSetting.UIScale), KeyboardStep = 0.01f }, new SettingsEnumDropdown { LabelText = "Screen Scaling", - Bindable = gameConfig.GetBindable(GameSetting.Scaling), + Bindable = gameConfig.GetBindable(OsuSetting.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 ab50aabe69..92f64d0e14 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(GameConfigManager config) + private void load(OsuConfigManager config) { Children = new[] { new SettingsCheckbox { LabelText = "Parallax", - Bindable = config.GetBindable(GameSetting.MenuParallax) + Bindable = config.GetBindable(OsuSetting.MenuParallax) }, }; } diff --git a/osu.Game/Overlays/Settings/Sections/Graphics/RendererSettings.cs b/osu.Game/Overlays/Settings/Sections/Graphics/RendererSettings.cs index 599f711f92..e988179a5e 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, GameConfigManager gameConfig) + private void load(FrameworkConfigManager config, OsuConfigManager 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 = gameConfig.GetBindable(GameSetting.ShowFpsDisplay) + Bindable = gameConfig.GetBindable(OsuSetting.ShowFpsDisplay) }, }; } diff --git a/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs b/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs index 8c6d4a8591..12c93a8605 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(GameConfigManager gameConfig, FrameworkConfigManager config) + private void load(OsuConfigManager 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 = gameConfig.GetBindable(GameSetting.MouseDisableWheel) + Bindable = gameConfig.GetBindable(OsuSetting.MouseDisableWheel) }, new SettingsCheckbox { LabelText = "Disable mouse buttons during gameplay", - Bindable = gameConfig.GetBindable(GameSetting.MouseDisableButtons) + Bindable = gameConfig.GetBindable(OsuSetting.MouseDisableButtons) }, }; diff --git a/osu.Game/Overlays/Settings/Sections/Online/WebSettings.cs b/osu.Game/Overlays/Settings/Sections/Online/WebSettings.cs index 5d633ade1b..a8b3e45a83 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(GameConfigManager config) + private void load(OsuConfigManager config) { Children = new Drawable[] { new SettingsCheckbox { LabelText = "Warn about opening external links", - Bindable = config.GetBindable(GameSetting.ExternalLinkWarning) + Bindable = config.GetBindable(OsuSetting.ExternalLinkWarning) }, }; } diff --git a/osu.Game/Overlays/Settings/Sections/SkinSection.cs b/osu.Game/Overlays/Settings/Sections/SkinSection.cs index ed8eb1e003..7361d671de 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(GameConfigManager config, SkinManager skins) + private void load(OsuConfigManager 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(GameSetting.MenuCursorSize), + Bindable = config.GetBindable(OsuSetting.MenuCursorSize), KeyboardStep = 0.01f }, new SettingsSlider { LabelText = "Gameplay cursor size", - Bindable = config.GetBindable(GameSetting.GameplayCursorSize), + Bindable = config.GetBindable(OsuSetting.GameplayCursorSize), KeyboardStep = 0.01f }, new SettingsCheckbox { LabelText = "Adjust gameplay cursor size based on current beatmap", - Bindable = config.GetBindable(GameSetting.AutoCursorSize) + Bindable = config.GetBindable(OsuSetting.AutoCursorSize) }, new SettingsCheckbox { LabelText = "Beatmap skins", - Bindable = config.GetBindable(GameSetting.BeatmapSkins) + Bindable = config.GetBindable(OsuSetting.BeatmapSkins) }, new SettingsCheckbox { LabelText = "Beatmap hitsounds", - Bindable = config.GetBindable(GameSetting.BeatmapHitsounds) + Bindable = config.GetBindable(OsuSetting.BeatmapHitsounds) }, }; skins.ItemAdded += itemAdded; skins.ItemRemoved += itemRemoved; - config.BindWith(GameSetting.Skin, configBindable); + config.BindWith(OsuSetting.Skin, configBindable); skinDropdown.Bindable = dropdownBindable; skinDropdown.Items = skins.GetAllUsableSkins().ToArray(); - // Todo: This should not be necessary when GameConfigManager is databased + // Todo: This should not be necessary when OsuConfigManager 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 da8cf43407..d66fabce70 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(GameConfigManager config); + void ReadFromConfig(OsuConfigManager config); } } diff --git a/osu.Game/Rulesets/Mods/ModHidden.cs b/osu.Game/Rulesets/Mods/ModHidden.cs index c8c9347bbd..465ead450c 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(GameConfigManager config) + public void ReadFromConfig(OsuConfigManager config) { - IncreaseFirstObjectVisibility = config.GetBindable(GameSetting.IncreaseFirstObjectVisibility); + IncreaseFirstObjectVisibility = config.GetBindable(OsuSetting.IncreaseFirstObjectVisibility); } public virtual void ApplyToDrawableHitObjects(IEnumerable drawables) diff --git a/osu.Game/Rulesets/UI/RulesetContainer.cs b/osu.Game/Rulesets/UI/RulesetContainer.cs index a63947cd5f..0d020238aa 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(GameConfigManager config) + private void load(OsuConfigManager 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, GameConfigManager config) + private void applyRulesetMods(IEnumerable mods, OsuConfigManager config) { if (mods == null) return; diff --git a/osu.Game/Rulesets/UI/RulesetInputManager.cs b/osu.Game/Rulesets/UI/RulesetInputManager.cs index f3c0699377..274a9475db 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(GameConfigManager config) + private void load(OsuConfigManager config) { - mouseDisabled = config.GetBindable(GameSetting.MouseDisableButtons); + mouseDisabled = config.GetBindable(OsuSetting.MouseDisableButtons); } protected override bool Handle(UIEvent e) diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index 18505fc6dc..93a84ec14d 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, GameConfigManager config, BeatmapManager beatmaps, Framework.Game game, BindableBeatmap beatmap) + private void load(AudioManager audio, OsuConfigManager config, BeatmapManager beatmaps, Framework.Game game, BindableBeatmap beatmap) { this.beatmap.BindTo(beatmap); - menuVoice = config.GetBindable(GameSetting.MenuVoice); - menuMusic = config.GetBindable(GameSetting.MenuMusic); + menuVoice = config.GetBindable(OsuSetting.MenuVoice); + menuMusic = config.GetBindable(OsuSetting.MenuMusic); BeatmapSetInfo setInfo = null; diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index 32bc1390ed..1b1862d587 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(GameConfigManager config, NotificationOverlay notificationOverlay) + private void load(OsuConfigManager config, NotificationOverlay notificationOverlay) { - showHud = config.GetBindable(GameSetting.ShowInterface); + showHud = config.GetBindable(OsuSetting.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 992e3c30b1..f033a20226 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(GameConfigManager config) + private void load(OsuConfigManager config) { - config.BindWith(GameSetting.KeyOverlay, configVisibility); + config.BindWith(OsuSetting.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 099dab7949..54644b8d9c 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, GameConfigManager config) + private void load(AudioManager audio, APIAccess api, OsuConfigManager config) { this.api = api; @@ -102,8 +102,8 @@ namespace osu.Game.Screens.Play sampleRestart = audio.Sample.Get(@"Gameplay/restart"); - mouseWheelDisabled = config.GetBindable(GameSetting.MouseDisableWheel); - userAudioOffset = config.GetBindable(GameSetting.AudioOffset); + mouseWheelDisabled = config.GetBindable(OsuSetting.MouseDisableWheel); + userAudioOffset = config.GetBindable(OsuSetting.AudioOffset); IBeatmap beatmap; @@ -164,7 +164,7 @@ namespace osu.Game.Screens.Play ScoreProcessor = RulesetContainer.CreateScoreProcessor(); if (!ScoreProcessor.Mode.Disabled) - config.BindWith(GameSetting.ScoreDisplayMode, ScoreProcessor.Mode); + config.BindWith(OsuSetting.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 98ae457dbd..5963352e5b 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(GameConfigManager config) + private void load(OsuConfigManager config) { Children = new Drawable[] { new PlayerCheckbox { LabelText = "Show floating comments", - Bindable = config.GetBindable(GameSetting.FloatingComments) + Bindable = config.GetBindable(OsuSetting.FloatingComments) }, new FocusedTextBox { diff --git a/osu.Game/Screens/Play/PlayerSettings/InputSettings.cs b/osu.Game/Screens/Play/PlayerSettings/InputSettings.cs index 16737a53ee..826be792bd 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(GameConfigManager config) => mouseButtonsCheckbox.Bindable = config.GetBindable(GameSetting.MouseDisableButtons); + private void load(OsuConfigManager config) => mouseButtonsCheckbox.Bindable = config.GetBindable(OsuSetting.MouseDisableButtons); } } diff --git a/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs b/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs index b2842957e0..aec42eb024 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(GameConfigManager config) + private void load(OsuConfigManager config) { - 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); + 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); } } } diff --git a/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs b/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs index 09827a9a2c..1c127dbdef 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(GameConfigManager config) + private void load(OsuConfigManager config) { - DimLevel = config.GetBindable(GameSetting.DimLevel); - BlurLevel = config.GetBindable(GameSetting.BlurLevel); - ShowStoryboard = config.GetBindable(GameSetting.ShowStoryboard); + DimLevel = config.GetBindable(OsuSetting.DimLevel); + BlurLevel = config.GetBindable(OsuSetting.BlurLevel); + ShowStoryboard = config.GetBindable(OsuSetting.ShowStoryboard); } protected override void OnEntering(Screen last) diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 086e801496..1670bf4de8 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(GameConfigManager config) + private void load(OsuConfigManager config) { - config.BindWith(GameSetting.RandomSelectAlgorithm, RandomAlgorithm); - config.BindWith(GameSetting.SongSelectRightMouseScroll, RightClickScrollingEnabled); + config.BindWith(OsuSetting.RandomSelectAlgorithm, RandomAlgorithm); + config.BindWith(OsuSetting.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 1b943e432c..002633e8b9 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, GameConfigManager config) + private void load(OsuColour colour, OsuConfigManager config) { modsCheckbox.AccentColour = tabs.AccentColour = colour.YellowLight; - selectedTab = config.GetBindable(GameSetting.BeatmapDetailTab); + selectedTab = config.GetBindable(OsuSetting.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 2fd0794767..42f6606218 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, GameConfigManager config) + private void load(OsuColour colours, IBindable parentRuleset, OsuConfigManager config) { sortTabs.AccentColour = colours.GreenLight; - showConverted = config.GetBindable(GameSetting.ShowConvertedBeatmaps); + showConverted = config.GetBindable(OsuSetting.ShowConvertedBeatmaps); showConverted.ValueChanged += val => updateCriteria(); ruleset.BindTo(parentRuleset); diff --git a/osu.Game/Skinning/LocalSkinOverrideContainer.cs b/osu.Game/Skinning/LocalSkinOverrideContainer.cs index 9f736375a9..8c172ffbcc 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(GameConfigManager config) + private void load(OsuConfigManager config) { - config.BindWith(GameSetting.BeatmapSkins, beatmapSkins); - config.BindWith(GameSetting.BeatmapHitsounds, beatmapHitsounds); + config.BindWith(OsuSetting.BeatmapSkins, beatmapSkins); + config.BindWith(OsuSetting.BeatmapHitsounds, beatmapHitsounds); } protected override void LoadComplete() From 4a916b2dee6c92a02dba9a3f95ef8838190eb2a5 Mon Sep 17 00:00:00 2001 From: Unknown Date: Fri, 25 Jan 2019 11:17:48 +0100 Subject: [PATCH 08/31] replace license headers with new ones --- .../Configuration/OsuRulesetConfigManager.cs | 4 ++-- osu.Game.Rulesets.Osu/UI/OsuSettingsSubsection.cs | 4 ++-- osu.Game/Configuration/OsuConfigManager.cs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Configuration/OsuRulesetConfigManager.cs b/osu.Game.Rulesets.Osu/Configuration/OsuRulesetConfigManager.cs index d931fb0eff..f6edd062e9 100644 --- a/osu.Game.Rulesets.Osu/Configuration/OsuRulesetConfigManager.cs +++ b/osu.Game.Rulesets.Osu/Configuration/OsuRulesetConfigManager.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using osu.Game.Configuration; using osu.Game.Rulesets.Configuration; diff --git a/osu.Game.Rulesets.Osu/UI/OsuSettingsSubsection.cs b/osu.Game.Rulesets.Osu/UI/OsuSettingsSubsection.cs index b4c873cf20..ce3432c73d 100644 --- a/osu.Game.Rulesets.Osu/UI/OsuSettingsSubsection.cs +++ b/osu.Game.Rulesets.Osu/UI/OsuSettingsSubsection.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; using osu.Framework.Graphics; diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index aed56d79bf..0704460bfe 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using osu.Framework.Configuration; using osu.Framework.Configuration.Tracking; From 77763fde8b64b466a6e1a1481c69d8ccee2ca746 Mon Sep 17 00:00:00 2001 From: Unknown Date: Fri, 25 Jan 2019 11:22:05 +0100 Subject: [PATCH 09/31] revert accidentally renamed variables --- .../Objects/Drawables/DrawableSlider.cs | 6 +++--- osu.Game/Graphics/Containers/ScalingContainer.cs | 4 ++-- osu.Game/Overlays/OnScreenDisplay.cs | 4 ++-- .../Settings/Sections/Graphics/LayoutSettings.cs | 16 ++++++++-------- .../Sections/Graphics/RendererSettings.cs | 4 ++-- .../Settings/Sections/Input/MouseSettings.cs | 6 +++--- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index b107fcc028..6bcf6aaf5e 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(OsuRulesetConfigManager rulesetConfig) + private void load(OsuRulesetConfigManager config) { - rulesetConfig.BindWith(OsuRulesetSetting.SnakingInSliders, Body.SnakingIn); - rulesetConfig.BindWith(OsuRulesetSetting.SnakingOutSliders, Body.SnakingOut); + config.BindWith(OsuRulesetSetting.SnakingInSliders, Body.SnakingIn); + config.BindWith(OsuRulesetSetting.SnakingOutSliders, Body.SnakingOut); positionBindable.BindValueChanged(_ => Position = HitObject.StackedPosition); scaleBindable.BindValueChanged(v => diff --git a/osu.Game/Graphics/Containers/ScalingContainer.cs b/osu.Game/Graphics/Containers/ScalingContainer.cs index 4973cb0608..a20c17cc8e 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 gameConfig) + private void load(OsuConfigManager osuConfig) { if (applyUIScale) { - uiScale = gameConfig.GetBindable(OsuSetting.UIScale); + uiScale = osuConfig.GetBindable(OsuSetting.UIScale); uiScale.BindValueChanged(scaleChanged, true); } } diff --git a/osu.Game/Overlays/OnScreenDisplay.cs b/osu.Game/Overlays/OnScreenDisplay.cs index becf70b03b..42031ee07e 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 gameConfig) + private void load(FrameworkConfigManager frameworkConfig, OsuConfigManager osuConfig) { BeginTracking(this, frameworkConfig); - BeginTracking(this, gameConfig); + BeginTracking(this, osuConfig); } private readonly Dictionary<(object, IConfigManager), TrackedSettings> trackedConfigManagers = new Dictionary<(object, IConfigManager), TrackedSettings>(); diff --git a/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs b/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs index 43309990a1..9c5ef32251 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 gameConfig, OsuGameBase game) + private void load(FrameworkConfigManager config, OsuConfigManager osuConfig, OsuGameBase game) { this.game = game; - scalingMode = gameConfig.GetBindable(OsuSetting.Scaling); + scalingMode = osuConfig.GetBindable(OsuSetting.Scaling); sizeFullscreen = config.GetBindable(FrameworkSetting.SizeFullscreen); - scalingSizeX = gameConfig.GetBindable(OsuSetting.ScalingSizeX); - scalingSizeY = gameConfig.GetBindable(OsuSetting.ScalingSizeY); - scalingPositionX = gameConfig.GetBindable(OsuSetting.ScalingPositionX); - scalingPositionY = gameConfig.GetBindable(OsuSetting.ScalingPositionY); + scalingSizeX = osuConfig.GetBindable(OsuSetting.ScalingSizeX); + scalingSizeY = osuConfig.GetBindable(OsuSetting.ScalingSizeY); + scalingPositionX = osuConfig.GetBindable(OsuSetting.ScalingPositionX); + scalingPositionY = osuConfig.GetBindable(OsuSetting.ScalingPositionY); Container resolutionSettingsContainer; @@ -67,13 +67,13 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics { LabelText = "UI Scaling", TransferValueOnCommit = true, - Bindable = gameConfig.GetBindable(OsuSetting.UIScale), + Bindable = osuConfig.GetBindable(OsuSetting.UIScale), KeyboardStep = 0.01f }, new SettingsEnumDropdown { LabelText = "Screen Scaling", - Bindable = gameConfig.GetBindable(OsuSetting.Scaling), + Bindable = osuConfig.GetBindable(OsuSetting.Scaling), }, scalingSettings = new FillFlowContainer> { diff --git a/osu.Game/Overlays/Settings/Sections/Graphics/RendererSettings.cs b/osu.Game/Overlays/Settings/Sections/Graphics/RendererSettings.cs index e988179a5e..7317076c54 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 gameConfig) + private void load(FrameworkConfigManager config, OsuConfigManager osuConfig) { // NOTE: Compatability mode omitted Children = new Drawable[] @@ -27,7 +27,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics new SettingsCheckbox { LabelText = "Show FPS", - Bindable = gameConfig.GetBindable(OsuSetting.ShowFpsDisplay) + Bindable = osuConfig.GetBindable(OsuSetting.ShowFpsDisplay) }, }; } diff --git a/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs b/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs index 12c93a8605..4f53b0a8a6 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 gameConfig, FrameworkConfigManager config) + private void load(OsuConfigManager osuConfig, 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 = gameConfig.GetBindable(OsuSetting.MouseDisableWheel) + Bindable = osuConfig.GetBindable(OsuSetting.MouseDisableWheel) }, new SettingsCheckbox { LabelText = "Disable mouse buttons during gameplay", - Bindable = gameConfig.GetBindable(OsuSetting.MouseDisableButtons) + Bindable = osuConfig.GetBindable(OsuSetting.MouseDisableButtons) }, }; From 66de451b537fee5b965cbc6506e396edce4af747 Mon Sep 17 00:00:00 2001 From: Poyo Date: Thu, 14 Feb 2019 02:19:41 -0800 Subject: [PATCH 10/31] Update difficulty color bracket thresholds --- .../Beatmaps/Drawables/DifficultyColouredContainer.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/osu.Game/Beatmaps/Drawables/DifficultyColouredContainer.cs b/osu.Game/Beatmaps/Drawables/DifficultyColouredContainer.cs index b025b5985c..89c43cc4df 100644 --- a/osu.Game/Beatmaps/Drawables/DifficultyColouredContainer.cs +++ b/osu.Game/Beatmaps/Drawables/DifficultyColouredContainer.cs @@ -48,11 +48,11 @@ namespace osu.Game.Beatmaps.Drawables var rating = beatmap.StarDifficulty; - if (rating < 1.5) return DifficultyRating.Easy; - if (rating < 2.25) return DifficultyRating.Normal; - if (rating < 3.75) return DifficultyRating.Hard; - if (rating < 5.25) return DifficultyRating.Insane; - if (rating < 6.75) return DifficultyRating.Expert; + if (rating < 2.0) return DifficultyRating.Easy; + if (rating < 2.7) return DifficultyRating.Normal; + if (rating < 4.0) return DifficultyRating.Hard; + if (rating < 5.3) return DifficultyRating.Insane; + if (rating < 6.5) return DifficultyRating.Expert; return DifficultyRating.ExpertPlus; } From 56397dbea657759588b762734b39f3bf5ca78a57 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 24 Feb 2019 12:08:27 +0900 Subject: [PATCH 11/31] Ensure beatmap is not disabled before continuing with present --- osu.Game/OsuGame.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 9f6adc373c..7170dc1685 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -248,6 +248,14 @@ namespace osu.Game // navigate to song select if we are not already there. menuScreen.MakeCurrent(); + + if (Beatmap.Disabled) + { + // we may need to wait for a lease to be returned. + Schedule(() => PresentBeatmap(beatmap)); + return; + } + menuScreen.LoadToSolo(); break; } From caef58675d78cade6a33e24136fb2a76aa23c703 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 25 Feb 2019 12:58:58 +0900 Subject: [PATCH 12/31] Tidy up and standardise present logic --- osu.Game/OsuGame.cs | 157 ++++++++++++++++++++------------------------ 1 file changed, 73 insertions(+), 84 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 7170dc1685..006e2abf4b 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -148,7 +148,11 @@ namespace osu.Game { this.frameworkConfig = frameworkConfig; - ScoreManager.ItemAdded += (score, _, silent) => Schedule(() => LoadScore(score, silent)); + ScoreManager.ItemAdded += (score, _, silent) => + { + if (!silent) + Schedule(() => PresentScore(score)); + }; if (!Host.IsPrimaryInstance) { @@ -198,71 +202,12 @@ namespace osu.Game externalLinkOpener.OpenUrlExternally(url); } - private ScheduledDelegate scoreLoad; - /// /// Show a beatmap set as an overlay. /// /// The set to display. public void ShowBeatmapSet(int setId) => beatmapSetOverlay.FetchAndShowBeatmapSet(setId); - /// - /// Present a beatmap at song select. - /// - /// The beatmap to select. - public void PresentBeatmap(BeatmapSetInfo beatmap) - { - if (menuScreen == null) - { - Schedule(() => PresentBeatmap(beatmap)); - return; - } - - CloseAllOverlays(false); - - void setBeatmap() - { - if (Beatmap.Disabled) - { - Schedule(setBeatmap); - return; - } - - var databasedSet = beatmap.OnlineBeatmapSetID != null ? BeatmapManager.QueryBeatmapSet(s => s.OnlineBeatmapSetID == beatmap.OnlineBeatmapSetID) : BeatmapManager.QueryBeatmapSet(s => s.Hash == beatmap.Hash); - - if (databasedSet != null) - { - // Use first beatmap available for current ruleset, else switch ruleset. - var first = databasedSet.Beatmaps.Find(b => b.Ruleset == ruleset.Value) ?? databasedSet.Beatmaps.First(); - - ruleset.Value = first.Ruleset; - Beatmap.Value = BeatmapManager.GetWorkingBeatmap(first); - } - } - - switch (screenStack.CurrentScreen) - { - case SongSelect _: - break; - default: - // navigate to song select if we are not already there. - - menuScreen.MakeCurrent(); - - if (Beatmap.Disabled) - { - // we may need to wait for a lease to be returned. - Schedule(() => PresentBeatmap(beatmap)); - return; - } - - menuScreen.LoadToSolo(); - break; - } - - setBeatmap(); - } - /// /// Show a user's profile as an overlay. /// @@ -275,19 +220,46 @@ namespace osu.Game /// The beatmap to show. public void ShowBeatmap(int beatmapId) => beatmapSetOverlay.FetchAndShowBeatmap(beatmapId); - protected void LoadScore(ScoreInfo score, bool silent) + /// + /// Present a beatmap at song select. + /// + /// The beatmap to select. + public void PresentBeatmap(BeatmapSetInfo beatmap) { - if (silent) - return; + var databasedSet = beatmap.OnlineBeatmapSetID != null + ? BeatmapManager.QueryBeatmapSet(s => s.OnlineBeatmapSetID == beatmap.OnlineBeatmapSetID) + : BeatmapManager.QueryBeatmapSet(s => s.Hash == beatmap.Hash); - scoreLoad?.Cancel(); - - if (menuScreen == null) + if (databasedSet == null) { - scoreLoad = Schedule(() => LoadScore(score, false)); + Logger.Log("The requested beatmap could not be loaded.", LoggingTarget.Information); return; } + if (screenStack.CurrentScreen is PlaySongSelect) + // if we're already at song select then we don't need to return to the main menu. + setBeatmap(); + else + performFromMainMenu(setBeatmap, $"load {beatmap}"); + + void setBeatmap() + { + menuScreen.LoadToSolo(); + + // Use first beatmap available for current ruleset, else switch ruleset. + var first = databasedSet.Beatmaps.Find(b => b.Ruleset == ruleset.Value) ?? databasedSet.Beatmaps.First(); + + ruleset.Value = first.Ruleset; + Beatmap.Value = BeatmapManager.GetWorkingBeatmap(first); + } + } + + /// + /// Present a score's replay. + /// + /// The beatmap to select. + public void PresentScore(ScoreInfo score) + { var databasedScore = ScoreManager.GetScore(score); var databasedScoreInfo = databasedScore.ScoreInfo; if (databasedScore.Replay == null) @@ -303,14 +275,35 @@ namespace osu.Game return; } + performFromMainMenu(() => + { + ruleset.Value = databasedScoreInfo.Ruleset; + + Beatmap.Value = BeatmapManager.GetWorkingBeatmap(databasedBeatmap); + Beatmap.Value.Mods.Value = databasedScoreInfo.Mods; + + menuScreen.Push(new PlayerLoader(() => new ReplayPlayer(databasedScore))); + }, $"watch {databasedScoreInfo.User.Username} play {databasedScoreInfo.Beatmap}"); + } + + private ScheduledDelegate performFromMainMenuTask; + + /// + /// Perform an action only after returning to the main menu. + /// Eagerly tries to exit the current screen until it succeeds. + /// + /// The action to perform once we are in the correct state. + /// The task name to display in a notification (if we can't immediately reach the main menu state). + private void performFromMainMenu(Action action, string taskName) + { if ((screenStack.CurrentScreen as IOsuScreen)?.AllowExternalScreenChange == false) { notifications.Post(new SimpleNotification { - Text = $"Click here to watch {databasedScoreInfo.User.Username} on {databasedScoreInfo.Beatmap}", + Text = $"Click here to {taskName}", Activated = () => { - loadScore(); + action(); return true; } }); @@ -318,24 +311,20 @@ namespace osu.Game return; } - loadScore(); + performFromMainMenuTask?.Cancel(); - void loadScore() + CloseAllOverlays(false); + + if (menuScreen?.IsCurrentScreen() != true || Beatmap.Disabled) { - if (!menuScreen.IsCurrentScreen() || Beatmap.Disabled) - { - menuScreen.MakeCurrent(); - this.Delay(500).Schedule(loadScore, out scoreLoad); - return; - } - - ruleset.Value = databasedScoreInfo.Ruleset; - - Beatmap.Value = BeatmapManager.GetWorkingBeatmap(databasedBeatmap); - Beatmap.Value.Mods.Value = databasedScoreInfo.Mods; - - menuScreen.Push(new PlayerLoader(() => new ReplayPlayer(databasedScore))); + // menuScreen may not be initialised or not be current yet; keep trying. + menuScreen?.MakeCurrent(); + performFromMainMenuTask = Schedule(() => performFromMainMenu(action, taskName)); + return; } + + // success! + action(); } protected override void Dispose(bool isDisposing) From 706da017d71c091de385c14847526a4adc5a5318 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 25 Feb 2019 14:01:51 +0900 Subject: [PATCH 13/31] Add target screen support and user bypass --- osu.Game/OsuGame.cs | 33 ++++++++++++++++++++++----------- osu.Game/Screens/IOsuScreen.cs | 2 +- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 006e2abf4b..499814c5e3 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -294,16 +294,21 @@ namespace osu.Game /// /// The action to perform once we are in the correct state. /// The task name to display in a notification (if we can't immediately reach the main menu state). - private void performFromMainMenu(Action action, string taskName) + /// An optional target screen type. If this screen is already current we can immediately perform the action without returning to the menu. + /// Whether checking should be bypassed. + private void performFromMainMenu(Action action, string taskName, Type targetScreen = null, bool bypassScreenAllowChecks = false) { - if ((screenStack.CurrentScreen as IOsuScreen)?.AllowExternalScreenChange == false) + performFromMainMenuTask?.Cancel(); + + // if the current screen does not allow screen changing, give the user an option to try again later. + if (!bypassScreenAllowChecks && (screenStack.CurrentScreen as IOsuScreen)?.AllowExternalScreenChange == false) { notifications.Post(new SimpleNotification { Text = $"Click here to {taskName}", Activated = () => { - action(); + performFromMainMenu(action, taskName, targetScreen, true); return true; } }); @@ -311,20 +316,26 @@ namespace osu.Game return; } - performFromMainMenuTask?.Cancel(); - CloseAllOverlays(false); - if (menuScreen?.IsCurrentScreen() != true || Beatmap.Disabled) + // we may already be at the target screen type. + if (targetScreen != null && screenStack.CurrentScreen?.GetType() == targetScreen) { - // menuScreen may not be initialised or not be current yet; keep trying. - menuScreen?.MakeCurrent(); - performFromMainMenuTask = Schedule(() => performFromMainMenu(action, taskName)); + action(); return; } - // success! - action(); + // all conditions have been met to continue with the action. + if (menuScreen?.IsCurrentScreen() == true && !Beatmap.Disabled) + { + action(); + return; + } + + // menuScreen may not be initialised yet (null check required). + menuScreen?.MakeCurrent(); + + performFromMainMenuTask = Schedule(() => performFromMainMenu(action, taskName)); } protected override void Dispose(bool isDisposing) diff --git a/osu.Game/Screens/IOsuScreen.cs b/osu.Game/Screens/IOsuScreen.cs index e665f401d9..b25bcdeab1 100644 --- a/osu.Game/Screens/IOsuScreen.cs +++ b/osu.Game/Screens/IOsuScreen.cs @@ -19,7 +19,7 @@ namespace osu.Game.Screens /// /// Whether a top-level component should be allowed to exit the current screen to, for example, - /// complete an import. + /// complete an import. Note that this can be overridden by a user if they specifically request. /// bool AllowExternalScreenChange { get; } From 80737b9ef825dc22470f50fc1897c4936501a861 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 25 Feb 2019 18:24:06 +0900 Subject: [PATCH 14/31] Remove "silent" parameter; consolidate import logic --- .../Beatmaps/IO/ImportBeatmapTest.cs | 2 +- osu.Game/Beatmaps/BeatmapManager.cs | 24 +-------- osu.Game/Database/ArchiveModelManager.cs | 53 +++++++++++-------- .../Database/MutableDatabaseBackedStore.cs | 13 ++--- osu.Game/OsuGame.cs | 32 +++++------ .../Direct/DownloadTrackingComposite.cs | 2 +- osu.Game/Overlays/Music/PlaylistList.cs | 4 +- osu.Game/Overlays/MusicController.cs | 2 +- .../Overlays/Settings/Sections/SkinSection.cs | 2 +- .../Multi/Match/Components/ReadyButton.cs | 2 +- .../Screens/Multi/Match/MatchSubScreen.cs | 2 +- osu.Game/Screens/Play/Player.cs | 2 +- osu.Game/Screens/Select/SongSelect.cs | 2 +- 13 files changed, 60 insertions(+), 82 deletions(-) diff --git a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs index b6a8b3b06c..5b8bdd8a51 100644 --- a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs @@ -101,7 +101,7 @@ namespace osu.Game.Tests.Beatmaps.IO int fireCount = 0; // ReSharper disable once AccessToModifiedClosure - manager.ItemAdded += (_, __, ___) => fireCount++; + manager.ItemAdded += (_, __) => fireCount++; manager.ItemRemoved += _ => fireCount++; var imported = LoadOszIntoOsu(osu); diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index 21739f16c2..002bd2063e 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -11,7 +11,6 @@ using Microsoft.EntityFrameworkCore; using osu.Framework.Audio; using osu.Framework.Audio.Track; using osu.Framework.Extensions; -using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Graphics.Textures; using osu.Framework.Logging; using osu.Framework.Platform; @@ -50,11 +49,6 @@ namespace osu.Game.Beatmaps /// public event Action BeatmapDownloadFailed; - /// - /// Fired when a beatmap load is requested (into the interactive game UI). - /// - public Action PresentBeatmap; - /// /// A default representation of a WorkingBeatmap to use when no beatmap is available. /// @@ -165,20 +159,10 @@ namespace osu.Game.Beatmaps request.Success += filename => { - downloadNotification.Text = $"Importing {beatmapSetInfo.Metadata.Artist} - {beatmapSetInfo.Metadata.Title}"; - Task.Factory.StartNew(() => { // This gets scheduled back to the update thread, but we want the import to run in the background. - var importedBeatmap = Import(filename); - - downloadNotification.CompletionClickAction = () => - { - PresentCompletedImport(importedBeatmap.Yield()); - return true; - }; - downloadNotification.State = ProgressNotificationState.Completed; - + Import(downloadNotification, filename); currentDownloads.Remove(request); }, TaskCreationOptions.LongRunning); }; @@ -211,12 +195,6 @@ namespace osu.Game.Beatmaps return true; } - protected override void PresentCompletedImport(IEnumerable imported) - { - base.PresentCompletedImport(imported); - PresentBeatmap?.Invoke(imported.LastOrDefault()); - } - /// /// Get an existing download request if it exists. /// diff --git a/osu.Game/Database/ArchiveModelManager.cs b/osu.Game/Database/ArchiveModelManager.cs index 6bf9e2ff37..f632865ba3 100644 --- a/osu.Game/Database/ArchiveModelManager.cs +++ b/osu.Game/Database/ArchiveModelManager.cs @@ -32,7 +32,7 @@ namespace osu.Game.Database where TModel : class, IHasFiles, IHasPrimaryKey, ISoftDelete where TFileModel : INamedFileInfo, new() { - public delegate void ItemAddedDelegate(TModel model, bool existing, bool silent); + public delegate void ItemAddedDelegate(TModel model, bool existing); /// /// Set an endpoint for notifications to be posted to. @@ -110,7 +110,7 @@ namespace osu.Game.Database ContextFactory = contextFactory; ModelStore = modelStore; - ModelStore.ItemAdded += (item, silent) => handleEvent(() => ItemAdded?.Invoke(item, false, silent)); + ModelStore.ItemAdded += item => handleEvent(() => ItemAdded?.Invoke(item, false)); ModelStore.ItemRemoved += s => handleEvent(() => ItemRemoved?.Invoke(s)); Files = new FileStore(contextFactory, storage); @@ -128,14 +128,16 @@ namespace osu.Game.Database /// One or more archive locations on disk. public void Import(params string[] paths) { - var notification = new ProgressNotification - { - Text = "Import is initialising...", - Progress = 0, - State = ProgressNotificationState.Active, - }; + var notification = new ProgressNotification { State = ProgressNotificationState.Active }; PostNotification?.Invoke(notification); + Import(notification, paths); + } + + protected void Import(ProgressNotification notification, params string[] paths) + { + notification.Progress = 0; + notification.Text = "Import is initialising..."; List imported = new List(); @@ -168,13 +170,20 @@ namespace osu.Game.Database } else { - notification.CompletionText = $"Imported {current} {typeof(TModel).Name.Replace("Info", "").ToLower()}s!"; - notification.CompletionClickAction += () => + notification.CompletionText = imported.Count == 1 + ? $"Imported {imported.First()}!" + : $"Imported {current} {typeof(TModel).Name.Replace("Info", "").ToLower()}s!"; + + if (imported.Count > 0 && PresentImport != null) { - if (imported.Count > 0) - PresentCompletedImport(imported); - return true; - }; + notification.CompletionText += " Click to view."; + notification.CompletionClickAction = () => + { + PresentImport?.Invoke(imported); + return true; + }; + } + notification.State = ProgressNotificationState.Completed; } } @@ -207,9 +216,10 @@ namespace osu.Game.Database return import; } - protected virtual void PresentCompletedImport(IEnumerable imported) - { - } + /// + /// Fired when the user requests to view the resulting import. + /// + public Action> PresentImport; /// /// Import an item from an . @@ -225,7 +235,7 @@ namespace osu.Game.Database model.Hash = computeHash(archive); - return Import(model, false, archive); + return Import(model, archive); } catch (Exception e) { @@ -259,9 +269,8 @@ namespace osu.Game.Database /// Import an item from a . /// /// The model to be imported. - /// Whether the user should be notified fo the import. /// An optional archive to use for model population. - public TModel Import(TModel item, bool silent = false, ArchiveReader archive = null) + public TModel Import(TModel item, ArchiveReader archive = null) { delayEvents(); @@ -281,7 +290,7 @@ namespace osu.Game.Database { Undelete(existing); Logger.Log($"Found existing {typeof(TModel)} for {item} (ID {existing.ID}). Skipping import.", LoggingTarget.Database); - handleEvent(() => ItemAdded?.Invoke(existing, true, silent)); + handleEvent(() => ItemAdded?.Invoke(existing, true)); return existing; } @@ -291,7 +300,7 @@ namespace osu.Game.Database Populate(item, archive); // import to store - ModelStore.Add(item, silent); + ModelStore.Add(item); } catch (Exception e) { diff --git a/osu.Game/Database/MutableDatabaseBackedStore.cs b/osu.Game/Database/MutableDatabaseBackedStore.cs index 5e820d1478..5bf06d93f1 100644 --- a/osu.Game/Database/MutableDatabaseBackedStore.cs +++ b/osu.Game/Database/MutableDatabaseBackedStore.cs @@ -16,9 +16,7 @@ namespace osu.Game.Database public abstract class MutableDatabaseBackedStore : DatabaseBackedStore where T : class, IHasPrimaryKey, ISoftDelete { - public delegate void ItemAddedDelegate(T model, bool silent); - - public event ItemAddedDelegate ItemAdded; + public event Action ItemAdded; public event Action ItemRemoved; protected MutableDatabaseBackedStore(IDatabaseContextFactory contextFactory, Storage storage = null) @@ -35,8 +33,7 @@ namespace osu.Game.Database /// Add a to the database. /// /// The item to add. - /// Whether the user should be notified of the addition. - public void Add(T item, bool silent) + public void Add(T item) { using (var usage = ContextFactory.GetForWrite()) { @@ -44,7 +41,7 @@ namespace osu.Game.Database context.Attach(item); } - ItemAdded?.Invoke(item, silent); + ItemAdded?.Invoke(item); } /// @@ -57,7 +54,7 @@ namespace osu.Game.Database usage.Context.Update(item); ItemRemoved?.Invoke(item); - ItemAdded?.Invoke(item, true); + ItemAdded?.Invoke(item); } /// @@ -92,7 +89,7 @@ namespace osu.Game.Database item.DeletePending = false; } - ItemAdded?.Invoke(item, true); + ItemAdded?.Invoke(item); return true; } diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 499814c5e3..5aafc11c92 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -148,12 +148,6 @@ namespace osu.Game { this.frameworkConfig = frameworkConfig; - ScoreManager.ItemAdded += (score, _, silent) => - { - if (!silent) - Schedule(() => PresentScore(score)); - }; - if (!Host.IsPrimaryInstance) { Logger.Log(@"osu! does not support multiple running instances.", LoggingTarget.Runtime, LogLevel.Error); @@ -221,7 +215,8 @@ namespace osu.Game public void ShowBeatmap(int beatmapId) => beatmapSetOverlay.FetchAndShowBeatmap(beatmapId); /// - /// Present a beatmap at song select. + /// Present a beatmap at song select immediately.. + /// The user should have already requested this interactively. /// /// The beatmap to select. public void PresentBeatmap(BeatmapSetInfo beatmap) @@ -236,26 +231,23 @@ namespace osu.Game return; } - if (screenStack.CurrentScreen is PlaySongSelect) - // if we're already at song select then we don't need to return to the main menu. - setBeatmap(); - else - performFromMainMenu(setBeatmap, $"load {beatmap}"); - - void setBeatmap() + performFromMainMenu(() => { - menuScreen.LoadToSolo(); + // we might already be at song select, so a check is required before performing the load to solo. + if (menuScreen.IsCurrentScreen()) + menuScreen.LoadToSolo(); // Use first beatmap available for current ruleset, else switch ruleset. var first = databasedSet.Beatmaps.Find(b => b.Ruleset == ruleset.Value) ?? databasedSet.Beatmaps.First(); ruleset.Value = first.Ruleset; Beatmap.Value = BeatmapManager.GetWorkingBeatmap(first); - } + }, $"load {beatmap}", bypassScreenAllowChecks: true, targetScreen: typeof(PlaySongSelect)); } /// - /// Present a score's replay. + /// Present a score's replay immediately. + /// The user should have already requested this interactively. /// /// The beatmap to select. public void PresentScore(ScoreInfo score) @@ -283,7 +275,7 @@ namespace osu.Game Beatmap.Value.Mods.Value = databasedScoreInfo.Mods; menuScreen.Push(new PlayerLoader(() => new ReplayPlayer(databasedScore))); - }, $"watch {databasedScoreInfo.User.Username} play {databasedScoreInfo.Beatmap}"); + }, $"watch {databasedScoreInfo.User.Username} play {databasedScoreInfo.Beatmap}", bypassScreenAllowChecks: true); } private ScheduledDelegate performFromMainMenuTask; @@ -359,8 +351,10 @@ namespace osu.Game BeatmapManager.PostNotification = n => notifications?.Post(n); BeatmapManager.GetStableStorage = GetStorageForStableInstall; + BeatmapManager.PresentImport = items => PresentBeatmap(items.First()); - BeatmapManager.PresentBeatmap = PresentBeatmap; + ScoreManager.PostNotification = n => notifications?.Post(n); + ScoreManager.PresentImport = items => PresentScore(items.First()); Container logoContainer; diff --git a/osu.Game/Overlays/Direct/DownloadTrackingComposite.cs b/osu.Game/Overlays/Direct/DownloadTrackingComposite.cs index 58be491daf..813223dbc3 100644 --- a/osu.Game/Overlays/Direct/DownloadTrackingComposite.cs +++ b/osu.Game/Overlays/Direct/DownloadTrackingComposite.cs @@ -115,7 +115,7 @@ namespace osu.Game.Overlays.Direct private void onRequestFailure(Exception e) => Schedule(() => attachDownload(null)); - private void setAdded(BeatmapSetInfo s, bool existing, bool silent) => setDownloadStateFromManager(s, DownloadState.LocallyAvailable); + private void setAdded(BeatmapSetInfo s, bool existing) => setDownloadStateFromManager(s, DownloadState.LocallyAvailable); private void setRemoved(BeatmapSetInfo s) => setDownloadStateFromManager(s, DownloadState.NotDownloaded); diff --git a/osu.Game/Overlays/Music/PlaylistList.cs b/osu.Game/Overlays/Music/PlaylistList.cs index b02ad242aa..9ace13289b 100644 --- a/osu.Game/Overlays/Music/PlaylistList.cs +++ b/osu.Game/Overlays/Music/PlaylistList.cs @@ -75,7 +75,7 @@ namespace osu.Game.Overlays.Music [BackgroundDependencyLoader] private void load(BeatmapManager beatmaps, IBindable beatmap) { - beatmaps.GetAllUsableBeatmapSets().ForEach(b => addBeatmapSet(b, false, false)); + beatmaps.GetAllUsableBeatmapSets().ForEach(b => addBeatmapSet(b, false)); beatmaps.ItemAdded += addBeatmapSet; beatmaps.ItemRemoved += removeBeatmapSet; @@ -83,7 +83,7 @@ namespace osu.Game.Overlays.Music beatmapBacking.ValueChanged += _ => updateSelectedSet(); } - private void addBeatmapSet(BeatmapSetInfo obj, bool existing, bool silent) => Schedule(() => + private void addBeatmapSet(BeatmapSetInfo obj, bool existing) => Schedule(() => { if (existing) return; diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index ff6bb4ee1a..e0b69a6747 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -212,7 +212,7 @@ namespace osu.Game.Overlays beatmapSets.Insert(index, beatmapSetInfo); } - private void handleBeatmapAdded(BeatmapSetInfo obj, bool existing, bool silent) + private void handleBeatmapAdded(BeatmapSetInfo obj, bool existing) { if (existing) return; diff --git a/osu.Game/Overlays/Settings/Sections/SkinSection.cs b/osu.Game/Overlays/Settings/Sections/SkinSection.cs index d1f47b6016..4b0147eb5d 100644 --- a/osu.Game/Overlays/Settings/Sections/SkinSection.cs +++ b/osu.Game/Overlays/Settings/Sections/SkinSection.cs @@ -82,7 +82,7 @@ namespace osu.Game.Overlays.Settings.Sections private void itemRemoved(SkinInfo s) => Schedule(() => skinDropdown.Items = skinDropdown.Items.Where(i => i.ID != s.ID).ToArray()); - private void itemAdded(SkinInfo s, bool existing, bool silent) + private void itemAdded(SkinInfo s, bool existing) { if (existing) return; diff --git a/osu.Game/Screens/Multi/Match/Components/ReadyButton.cs b/osu.Game/Screens/Multi/Match/Components/ReadyButton.cs index 3e4694e232..795557b968 100644 --- a/osu.Game/Screens/Multi/Match/Components/ReadyButton.cs +++ b/osu.Game/Screens/Multi/Match/Components/ReadyButton.cs @@ -53,7 +53,7 @@ namespace osu.Game.Screens.Multi.Match.Components hasBeatmap = beatmaps.QueryBeatmap(b => b.OnlineBeatmapID == beatmap.OnlineBeatmapID) != null; } - private void beatmapAdded(BeatmapSetInfo model, bool existing, bool silent) + private void beatmapAdded(BeatmapSetInfo model, bool existing) { if (Beatmap.Value == null) return; diff --git a/osu.Game/Screens/Multi/Match/MatchSubScreen.cs b/osu.Game/Screens/Multi/Match/MatchSubScreen.cs index c3f7cea43e..3a7d0f18f5 100644 --- a/osu.Game/Screens/Multi/Match/MatchSubScreen.cs +++ b/osu.Game/Screens/Multi/Match/MatchSubScreen.cs @@ -202,7 +202,7 @@ namespace osu.Game.Screens.Multi.Match /// /// Handle the case where a beatmap is imported (and can be used by this match). /// - private void beatmapAdded(BeatmapSetInfo model, bool existing, bool silent) => Schedule(() => + private void beatmapAdded(BeatmapSetInfo model, bool existing) => Schedule(() => { if (Beatmap.Value != beatmapManager.DefaultBeatmap) return; diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 9198d1a646..fbdc382d18 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -294,7 +294,7 @@ namespace osu.Game.Screens.Play var score = CreateScore(); if (RulesetContainer.ReplayScore == null) - scoreManager.Import(score, true); + scoreManager.Import(score); this.Push(CreateResults(score)); diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 60fcbc9271..f10acfab22 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -587,7 +587,7 @@ namespace osu.Game.Screens.Select } } - private void onBeatmapSetAdded(BeatmapSetInfo s, bool existing, bool silent) => Carousel.UpdateBeatmapSet(s); + private void onBeatmapSetAdded(BeatmapSetInfo s, bool existing) => Carousel.UpdateBeatmapSet(s); private void onBeatmapSetRemoved(BeatmapSetInfo s) => Carousel.RemoveBeatmapSet(s); private void onBeatmapRestored(BeatmapInfo b) => Carousel.UpdateBeatmapSet(beatmaps.QueryBeatmapSet(s => s.ID == b.BeatmapSetInfoID)); private void onBeatmapHidden(BeatmapInfo b) => Carousel.UpdateBeatmapSet(beatmaps.QueryBeatmapSet(s => s.ID == b.BeatmapSetInfoID)); From 314f35b0c51417c2ab91711e1b7ecbacaf415185 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 25 Feb 2019 18:42:08 +0900 Subject: [PATCH 15/31] Further simplify import messaging --- osu.Game/Beatmaps/BeatmapManager.cs | 3 +-- osu.Game/Database/ArchiveModelManager.cs | 17 +++++++++++++++-- osu.Game/OsuGame.cs | 2 +- osu.Game/Scoring/ScoreInfo.cs | 2 ++ 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index 002bd2063e..64dfc497ee 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -145,8 +145,7 @@ namespace osu.Game.Beatmaps var downloadNotification = new DownloadNotification { - CompletionText = $"Imported {beatmapSetInfo.Metadata.Artist} - {beatmapSetInfo.Metadata.Title}!", - Text = $"Downloading {beatmapSetInfo.Metadata.Artist} - {beatmapSetInfo.Metadata.Title}", + Text = $"Downloading {beatmapSetInfo}", }; var request = new DownloadBeatmapSetRequest(beatmapSetInfo, noVideo); diff --git a/osu.Game/Database/ArchiveModelManager.cs b/osu.Game/Database/ArchiveModelManager.cs index f632865ba3..61f0867381 100644 --- a/osu.Game/Database/ArchiveModelManager.cs +++ b/osu.Game/Database/ArchiveModelManager.cs @@ -139,6 +139,8 @@ namespace osu.Game.Database notification.Progress = 0; notification.Text = "Import is initialising..."; + var term = $"{typeof(TModel).Name.Replace("Info", "").ToLower()}"; + List imported = new List(); int current = 0; @@ -150,7 +152,18 @@ namespace osu.Game.Database try { - notification.Text = $"Importing ({++current} of {paths.Length})\n{Path.GetFileName(path)}"; + var text = $"Importing "; + + if (path.Length > 1) + text += $"{++current} of {paths.Length} {term}s.."; + else + text += $"{term}.."; + + // only show the filename if it isn't a temporary one (as those look ugly). + if (!path.Contains(Path.GetTempPath())) + text += $"\n{Path.GetFileName(path)}"; + + notification.Text = text; imported.Add(Import(path)); @@ -172,7 +185,7 @@ namespace osu.Game.Database { notification.CompletionText = imported.Count == 1 ? $"Imported {imported.First()}!" - : $"Imported {current} {typeof(TModel).Name.Replace("Info", "").ToLower()}s!"; + : $"Imported {current} {term}s!"; if (imported.Count > 0 && PresentImport != null) { diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 5aafc11c92..93acc949ef 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -275,7 +275,7 @@ namespace osu.Game Beatmap.Value.Mods.Value = databasedScoreInfo.Mods; menuScreen.Push(new PlayerLoader(() => new ReplayPlayer(databasedScore))); - }, $"watch {databasedScoreInfo.User.Username} play {databasedScoreInfo.Beatmap}", bypassScreenAllowChecks: true); + }, $"watch {databasedScoreInfo}", bypassScreenAllowChecks: true); } private ScheduledDelegate performFromMainMenuTask; diff --git a/osu.Game/Scoring/ScoreInfo.cs b/osu.Game/Scoring/ScoreInfo.cs index c88fd77eb2..6f1466fb6b 100644 --- a/osu.Game/Scoring/ScoreInfo.cs +++ b/osu.Game/Scoring/ScoreInfo.cs @@ -158,5 +158,7 @@ namespace osu.Game.Scoring { public string Acronym { get; set; } } + + public override string ToString() => $"{User} playing {Beatmap}"; } } From f84a84edaacbce252e2a10cf81892a9fa8523732 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 25 Feb 2019 18:59:28 +0900 Subject: [PATCH 16/31] Fix oops --- osu.Game/Database/ArchiveModelManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Database/ArchiveModelManager.cs b/osu.Game/Database/ArchiveModelManager.cs index 61f0867381..42dbdfbd8a 100644 --- a/osu.Game/Database/ArchiveModelManager.cs +++ b/osu.Game/Database/ArchiveModelManager.cs @@ -152,7 +152,7 @@ namespace osu.Game.Database try { - var text = $"Importing "; + var text = "Importing "; if (path.Length > 1) text += $"{++current} of {paths.Length} {term}s.."; From c680d636949521f33b8dc2b134af2cdda1e54253 Mon Sep 17 00:00:00 2001 From: jorolf Date: Mon, 25 Feb 2019 23:44:43 +0100 Subject: [PATCH 17/31] Don't show the supporter text if the user already has supporter status --- osu.Game/Screens/Menu/Disclaimer.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Menu/Disclaimer.cs b/osu.Game/Screens/Menu/Disclaimer.cs index c0ff37cc0b..48f15852ba 100644 --- a/osu.Game/Screens/Menu/Disclaimer.cs +++ b/osu.Game/Screens/Menu/Disclaimer.cs @@ -10,6 +10,7 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Screens; using osu.Game.Graphics; using osu.Game.Graphics.Containers; +using osu.Game.Online.API; using osuTK; using osuTK.Graphics; using osu.Game.Overlays; @@ -39,7 +40,7 @@ namespace osu.Game.Screens.Menu } [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load(OsuColour colours, APIAccess api) { InternalChildren = new Drawable[] { @@ -107,6 +108,12 @@ namespace osu.Game.Screens.Menu t.Origin = Anchor.Centre; }).First()); + api.LocalUser.BindValueChanged(user => + { + if (user.IsSupporter) + textFlow.RemoveRange(supporterDrawables); + }, true); + iconColour = colours.Yellow; } From 796044ee7d3dabf1206947cd1c7a2c9b0c02eb8c Mon Sep 17 00:00:00 2001 From: jorolf Date: Mon, 25 Feb 2019 23:53:44 +0100 Subject: [PATCH 18/31] *I should've rechecked the code after the master merge* --- osu.Game/Screens/Menu/Disclaimer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Menu/Disclaimer.cs b/osu.Game/Screens/Menu/Disclaimer.cs index ccf49d7bd2..09f71da4bc 100644 --- a/osu.Game/Screens/Menu/Disclaimer.cs +++ b/osu.Game/Screens/Menu/Disclaimer.cs @@ -98,7 +98,7 @@ namespace osu.Game.Screens.Menu api.LocalUser.BindValueChanged(user => { - if (user.IsSupporter) + if (user.NewValue.IsSupporter) textFlow.RemoveRange(supporterDrawables); }, true); From 32b8bb2ccc8a5f5cd9f862709cc1b9005ca19778 Mon Sep 17 00:00:00 2001 From: Dan Balasescu <1329837+smoogipoo@users.noreply.github.com> Date: Tue, 26 Feb 2019 12:28:49 +0900 Subject: [PATCH 19/31] Fix broken grammar Co-Authored-By: peppy --- osu.Game/OsuGame.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 93acc949ef..f9676933cf 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -215,7 +215,7 @@ namespace osu.Game public void ShowBeatmap(int beatmapId) => beatmapSetOverlay.FetchAndShowBeatmap(beatmapId); /// - /// Present a beatmap at song select immediately.. + /// Present a beatmap at song select immediately. /// The user should have already requested this interactively. /// /// The beatmap to select. From 4c10185f5b5a2fbd22bb35e34539491279970401 Mon Sep 17 00:00:00 2001 From: jorolf Date: Tue, 26 Feb 2019 15:26:00 +0100 Subject: [PATCH 20/31] Fade out text instead of removing it immediately --- osu.Game/Screens/Menu/Disclaimer.cs | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/osu.Game/Screens/Menu/Disclaimer.cs b/osu.Game/Screens/Menu/Disclaimer.cs index 09f71da4bc..ea6abd260a 100644 --- a/osu.Game/Screens/Menu/Disclaimer.cs +++ b/osu.Game/Screens/Menu/Disclaimer.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Linq; using osu.Framework.Allocation; +using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Screens; @@ -14,6 +15,7 @@ using osu.Game.Online.API; using osuTK; using osuTK.Graphics; using osu.Game.Overlays; +using osu.Game.Users; namespace osu.Game.Screens.Menu { @@ -34,13 +36,16 @@ namespace osu.Game.Screens.Menu private const float icon_y = -85; + [Resolved] + private APIAccess api { get; set; } + public Disclaimer() { ValidForResume = false; } [BackgroundDependencyLoader] - private void load(OsuColour colours, APIAccess api) + private void load(OsuColour colours) { InternalChildren = new Drawable[] { @@ -96,12 +101,6 @@ namespace osu.Game.Screens.Menu t.Origin = Anchor.Centre; }).First()); - api.LocalUser.BindValueChanged(user => - { - if (user.NewValue.IsSupporter) - textFlow.RemoveRange(supporterDrawables); - }, true); - iconColour = colours.Yellow; } @@ -109,6 +108,8 @@ namespace osu.Game.Screens.Menu { base.LoadComplete(); LoadComponentAsync(intro = new Intro()); + + api.LocalUser.BindValueChanged(userChanged, true); } public override void OnEntering(IScreen last) @@ -134,5 +135,17 @@ namespace osu.Game.Screens.Menu heart.FlashColour(Color4.White, 750, Easing.OutQuint).Loop(); } + + public override void OnSuspending(IScreen next) + { + base.OnSuspending(next); + + api.LocalUser.ValueChanged -= userChanged; + } + + private void userChanged(ValueChangedEvent user) + { + if (user.NewValue.IsSupporter) supporterDrawables.ForEach(d => d.FadeOut(200, Easing.OutQuint).Expire()); + } } } From 73ba91bbad2dd77e19fbb017a03e5f55bd3624ce Mon Sep 17 00:00:00 2001 From: HoLLy Date: Sat, 2 Mar 2019 14:05:56 +0100 Subject: [PATCH 21/31] Add failing test case --- .../TestCaseHyperDash.cs | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Catch.Tests/TestCaseHyperDash.cs b/osu.Game.Rulesets.Catch.Tests/TestCaseHyperDash.cs index 0851fbed87..5df8f2c2c1 100644 --- a/osu.Game.Rulesets.Catch.Tests/TestCaseHyperDash.cs +++ b/osu.Game.Rulesets.Catch.Tests/TestCaseHyperDash.cs @@ -1,9 +1,11 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; using NUnit.Framework; using osu.Game.Beatmaps; using osu.Game.Rulesets.Catch.Objects; +using osu.Game.Screens.Play; namespace osu.Game.Rulesets.Catch.Tests { @@ -11,19 +13,34 @@ namespace osu.Game.Rulesets.Catch.Tests public class TestCaseHyperDash : Game.Tests.Visual.TestCasePlayer { public TestCaseHyperDash() - : base(new CatchRuleset()) - { - } + : base(new CatchRuleset()) { } protected override IBeatmap CreateBeatmap(Ruleset ruleset) { - var beatmap = new Beatmap { BeatmapInfo = { Ruleset = ruleset.RulesetInfo } }; + var beatmap = new Beatmap + { + BeatmapInfo = + { + Ruleset = ruleset.RulesetInfo, + BaseDifficulty = new BeatmapDifficulty { CircleSize = 3.6f } + } + }; + + // Should produce a hperdash + beatmap.HitObjects.Add(new Fruit { StartTime = 816, X = 308 / 512f, NewCombo = true }); + beatmap.HitObjects.Add(new Fruit { StartTime = 1008, X = 56 / 512f, }); for (int i = 0; i < 512; i++) if (i % 5 < 3) - beatmap.HitObjects.Add(new Fruit { X = i % 10 < 5 ? 0.02f : 0.98f, StartTime = i * 100, NewCombo = i % 8 == 0 }); + beatmap.HitObjects.Add(new Fruit { X = i % 10 < 5 ? 0.02f : 0.98f, StartTime = 2000 + i * 100, NewCombo = i % 8 == 0 }); return beatmap; } + + protected override void AddCheckSteps(Func player) + { + base.AddCheckSteps(player); + AddAssert("First note is hyperdash", () => Beatmap.Value.Beatmap.HitObjects[0] is Fruit f && f.HyperDash); + } } } From 5ff47924ab9d0f97124a9c1030e105e80f05b183 Mon Sep 17 00:00:00 2001 From: HoLLy Date: Sat, 2 Mar 2019 14:06:53 +0100 Subject: [PATCH 22/31] Add missing grace time in hyperdash calculation --- osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs index 5f1e0b97da..fac08cd0e1 100644 --- a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs +++ b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs @@ -100,7 +100,7 @@ namespace osu.Game.Rulesets.Catch.Beatmaps CatchHitObject nextObject = objectWithDroplets[i + 1]; int thisDirection = nextObject.X > currentObject.X ? 1 : -1; - double timeToNext = nextObject.StartTime - currentObject.StartTime; + double timeToNext = nextObject.StartTime - currentObject.StartTime - 1000f / 60f / 4; // 4 frames of grace time, taken from osu-stable double distanceToNext = Math.Abs(nextObject.X - currentObject.X) - (lastDirection == thisDirection ? lastExcess : halfCatcherWidth); float distanceToHyper = (float)(timeToNext * CatcherArea.Catcher.BASE_SPEED - distanceToNext); if (distanceToHyper < 0) From e8d568470dd21ecc2b8b72ad2dd1f378444953ee Mon Sep 17 00:00:00 2001 From: jorolf Date: Sat, 2 Mar 2019 19:13:38 +0100 Subject: [PATCH 23/31] use a bindable instead --- osu.Game/Screens/Menu/Disclaimer.cs | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/osu.Game/Screens/Menu/Disclaimer.cs b/osu.Game/Screens/Menu/Disclaimer.cs index a4736e8c60..b8b372fa24 100644 --- a/osu.Game/Screens/Menu/Disclaimer.cs +++ b/osu.Game/Screens/Menu/Disclaimer.cs @@ -36,8 +36,7 @@ namespace osu.Game.Screens.Menu private const float icon_y = -85; - [Resolved] - private APIAccess api { get; set; } + private readonly Bindable currentUser = new Bindable(); public Disclaimer() { @@ -45,7 +44,7 @@ namespace osu.Game.Screens.Menu } [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load(OsuColour colours, APIAccess api) { InternalChildren = new Drawable[] { @@ -102,14 +101,19 @@ namespace osu.Game.Screens.Menu }).First()); iconColour = colours.Yellow; + + currentUser.BindTo(api.LocalUser); + currentUser.BindValueChanged(e => + { + if (e.NewValue.IsSupporter) + supporterDrawables.ForEach(d => d.FadeOut(200, Easing.OutQuint).Expire()); + }, true); } protected override void LoadComplete() { base.LoadComplete(); LoadComponentAsync(intro = new Intro()); - - api.LocalUser.BindValueChanged(userChanged, true); } public override void OnEntering(IScreen last) @@ -140,12 +144,7 @@ namespace osu.Game.Screens.Menu { base.OnSuspending(next); - api.LocalUser.ValueChanged -= userChanged; - } - - private void userChanged(ValueChangedEvent user) - { - if (user.NewValue.IsSupporter) supporterDrawables.ForEach(d => d.FadeOut(200, Easing.OutQuint).Expire()); + currentUser.UnbindAll(); } } } From 1ea4781188c8614684650bd8afa6504435320f3c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 3 Mar 2019 13:50:36 +0900 Subject: [PATCH 24/31] Fix code styling --- osu.Game.Rulesets.Catch.Tests/TestCaseHyperDash.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Catch.Tests/TestCaseHyperDash.cs b/osu.Game.Rulesets.Catch.Tests/TestCaseHyperDash.cs index 5df8f2c2c1..7451986a8b 100644 --- a/osu.Game.Rulesets.Catch.Tests/TestCaseHyperDash.cs +++ b/osu.Game.Rulesets.Catch.Tests/TestCaseHyperDash.cs @@ -13,7 +13,9 @@ namespace osu.Game.Rulesets.Catch.Tests public class TestCaseHyperDash : Game.Tests.Visual.TestCasePlayer { public TestCaseHyperDash() - : base(new CatchRuleset()) { } + : base(new CatchRuleset()) + { + } protected override IBeatmap CreateBeatmap(Ruleset ruleset) { From 6ffa139ea8ee7dcbc33a667885c29335d2a0e3d0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 3 Mar 2019 20:02:56 +0900 Subject: [PATCH 25/31] Adjust transition length slightly --- osu.Game/Screens/Menu/Disclaimer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Menu/Disclaimer.cs b/osu.Game/Screens/Menu/Disclaimer.cs index b8b372fa24..35a1e18097 100644 --- a/osu.Game/Screens/Menu/Disclaimer.cs +++ b/osu.Game/Screens/Menu/Disclaimer.cs @@ -106,7 +106,7 @@ namespace osu.Game.Screens.Menu currentUser.BindValueChanged(e => { if (e.NewValue.IsSupporter) - supporterDrawables.ForEach(d => d.FadeOut(200, Easing.OutQuint).Expire()); + supporterDrawables.ForEach(d => d.FadeOut(500, Easing.OutQuint).Expire()); }, true); } From 08e153208d2340119c54cb59224db9547e14993b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 3 Mar 2019 20:03:22 +0900 Subject: [PATCH 26/31] Unbinds are automatic --- osu.Game/Screens/Menu/Disclaimer.cs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/osu.Game/Screens/Menu/Disclaimer.cs b/osu.Game/Screens/Menu/Disclaimer.cs index 35a1e18097..89f4f92092 100644 --- a/osu.Game/Screens/Menu/Disclaimer.cs +++ b/osu.Game/Screens/Menu/Disclaimer.cs @@ -139,12 +139,5 @@ namespace osu.Game.Screens.Menu heart.FlashColour(Color4.White, 750, Easing.OutQuint).Loop(); } - - public override void OnSuspending(IScreen next) - { - base.OnSuspending(next); - - currentUser.UnbindAll(); - } } } From 679d30d08a6fe0ced3ed0914d9e11388bd5fd897 Mon Sep 17 00:00:00 2001 From: HoLLy Date: Sun, 3 Mar 2019 11:21:39 +0000 Subject: [PATCH 27/31] Fix comment mentioning 4 frames instead of 1/4 --- osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs index fac08cd0e1..78b5a510b2 100644 --- a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs +++ b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs @@ -100,7 +100,7 @@ namespace osu.Game.Rulesets.Catch.Beatmaps CatchHitObject nextObject = objectWithDroplets[i + 1]; int thisDirection = nextObject.X > currentObject.X ? 1 : -1; - double timeToNext = nextObject.StartTime - currentObject.StartTime - 1000f / 60f / 4; // 4 frames of grace time, taken from osu-stable + double timeToNext = nextObject.StartTime - currentObject.StartTime - 1000f / 60f / 4; // 1/4th of a frame of grace time, taken from osu-stable double distanceToNext = Math.Abs(nextObject.X - currentObject.X) - (lastDirection == thisDirection ? lastExcess : halfCatcherWidth); float distanceToHyper = (float)(timeToNext * CatcherArea.Catcher.BASE_SPEED - distanceToNext); if (distanceToHyper < 0) From b076ac95f047612a5296ed65f5f24bf712f1976a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 4 Mar 2019 13:02:43 +0900 Subject: [PATCH 28/31] Enforce max consecutive blank lines --- osu.sln.DotSettings | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.sln.DotSettings b/osu.sln.DotSettings index 5363d6dddf..3c6a6dd2a9 100644 --- a/osu.sln.DotSettings +++ b/osu.sln.DotSettings @@ -230,6 +230,8 @@ True NEXT_LINE NEXT_LINE + 1 + 1 True NEVER NEVER From 3f197935d70e9a0042b89d1d44381cbe306783c2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 4 Mar 2019 14:03:59 +0900 Subject: [PATCH 29/31] Fix remaining case --- osu.Game/Graphics/UserInterface/RollingCounter.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Graphics/UserInterface/RollingCounter.cs b/osu.Game/Graphics/UserInterface/RollingCounter.cs index 47e12f5f15..cd244ed7e6 100644 --- a/osu.Game/Graphics/UserInterface/RollingCounter.cs +++ b/osu.Game/Graphics/UserInterface/RollingCounter.cs @@ -59,7 +59,6 @@ namespace osu.Game.Graphics.UserInterface public abstract void Increment(T amount); - public float TextSize { get => DisplayedCountSpriteText.Font.Size; From 5bb0511f0a857b9adbd6228ef8e472b5d0e5f1f2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 5 Mar 2019 13:16:41 +0900 Subject: [PATCH 30/31] Fix SquareGraph not correctly filling columns when loaded with a non-zero time --- osu.Game/Screens/Play/SquareGraph.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osu.Game/Screens/Play/SquareGraph.cs b/osu.Game/Screens/Play/SquareGraph.cs index 95ac35baa7..d10034d552 100644 --- a/osu.Game/Screens/Play/SquareGraph.cs +++ b/osu.Game/Screens/Play/SquareGraph.cs @@ -242,7 +242,11 @@ namespace osu.Game.Screens.Play // Reverse drawableRows so when iterating through them they start at the bottom drawableRows.Reverse(); + } + protected override void LoadComplete() + { + base.LoadComplete(); fillActive(); } From 0322bd88120aba791daf21d208ee29fdc4b77ba6 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 5 Mar 2019 14:40:27 +0900 Subject: [PATCH 31/31] Make config nullable, removing testcase code --- osu.Game.Rulesets.Osu.Tests/TestCaseSlider.cs | 12 ------------ .../TestCaseSliderSelectionBlueprint.cs | 12 ------------ .../Objects/Drawables/DrawableSlider.cs | 9 ++++++--- 3 files changed, 6 insertions(+), 27 deletions(-) diff --git a/osu.Game.Rulesets.Osu.Tests/TestCaseSlider.cs b/osu.Game.Rulesets.Osu.Tests/TestCaseSlider.cs index d216d88c0d..35e8f3e17e 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestCaseSlider.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestCaseSlider.cs @@ -16,14 +16,12 @@ using osuTK.Graphics; using osu.Game.Rulesets.Mods; using System.Linq; using NUnit.Framework; -using osu.Framework.Allocation; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Objects.Types; -using osu.Game.Rulesets.Osu.Configuration; using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces; namespace osu.Game.Rulesets.Osu.Tests @@ -42,16 +40,6 @@ namespace osu.Game.Rulesets.Osu.Tests typeof(DrawableOsuHitObject) }; - protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) - { - var dependencies = new DependencyContainer(base.CreateChildDependencies(parent)); - - var configCache = dependencies.Get(); - dependencies.CacheAs((OsuRulesetConfigManager)configCache.GetConfigFor(new OsuRuleset())); - - return dependencies; - } - private readonly Container content; protected override Container Content => content; diff --git a/osu.Game.Rulesets.Osu.Tests/TestCaseSliderSelectionBlueprint.cs b/osu.Game.Rulesets.Osu.Tests/TestCaseSliderSelectionBlueprint.cs index 4279925db5..a7386ba48b 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestCaseSliderSelectionBlueprint.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestCaseSliderSelectionBlueprint.cs @@ -3,13 +3,11 @@ using System; using System.Collections.Generic; -using osu.Framework.Allocation; using osu.Game.Beatmaps; using osu.Game.Beatmaps.ControlPoints; using osu.Game.Rulesets.Edit; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Types; -using osu.Game.Rulesets.Osu.Configuration; using osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders; using osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components; using osu.Game.Rulesets.Osu.Objects; @@ -31,16 +29,6 @@ namespace osu.Game.Rulesets.Osu.Tests typeof(PathControlPointPiece) }; - protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) - { - var dependencies = new DependencyContainer(base.CreateChildDependencies(parent)); - - var configCache = dependencies.Get(); - dependencies.CacheAs((OsuRulesetConfigManager)configCache.GetConfigFor(new OsuRuleset())); - - return dependencies; - } - private readonly DrawableSlider drawableObject; public TestCaseSliderSelectionBlueprint() diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index f9aa1c6b54..ff74954552 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -33,6 +33,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables private readonly IBindable scaleBindable = new Bindable(); private readonly IBindable pathBindable = new Bindable(); + [Resolved(CanBeNull = true)] + private OsuRulesetConfigManager config { get; set; } + public DrawableSlider(Slider s) : base(s) { @@ -94,10 +97,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables } [BackgroundDependencyLoader] - private void load(OsuRulesetConfigManager config) + private void load() { - config.BindWith(OsuRulesetSetting.SnakingInSliders, Body.SnakingIn); - config.BindWith(OsuRulesetSetting.SnakingOutSliders, Body.SnakingOut); + config?.BindWith(OsuRulesetSetting.SnakingInSliders, Body.SnakingIn); + config?.BindWith(OsuRulesetSetting.SnakingOutSliders, Body.SnakingOut); positionBindable.BindValueChanged(_ => Position = HitObject.StackedPosition); scaleBindable.BindValueChanged(scale =>