1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 14:53:01 +08:00

revert previous rename and rename ruleset specific classes instead

This commit is contained in:
Unknown 2019-01-25 11:14:37 +01:00
parent 5446c99f22
commit 8ddff673b7
58 changed files with 169 additions and 382 deletions

View File

@ -22,13 +22,13 @@ namespace osu.Desktop.Overlays
{ {
public class VersionManager : OverlayContainer public class VersionManager : OverlayContainer
{ {
private GameConfigManager config; private OsuConfigManager config;
private OsuGameBase game; private OsuGameBase game;
private NotificationOverlay notificationOverlay; private NotificationOverlay notificationOverlay;
private GameHost host; private GameHost host;
[BackgroundDependencyLoader] [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; notificationOverlay = notification;
this.config = config; this.config = config;
@ -95,10 +95,10 @@ namespace osu.Desktop.Overlays
base.LoadComplete(); base.LoadComplete();
var version = game.Version; var version = game.Version;
var lastVersion = config.Get<string>(GameSetting.Version); var lastVersion = config.Get<string>(OsuSetting.Version);
if (game.IsDeployedBuild && version != lastVersion) 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). // only show a notification if we've previously saved a version to the config file (ie. not the first run).
if (!string.IsNullOrEmpty(lastVersion)) if (!string.IsNullOrEmpty(lastVersion))

View File

@ -25,8 +25,8 @@ namespace osu.Game.Rulesets.Mania.Tests
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(RulesetConfigCache configCache) private void load(RulesetConfigCache configCache)
{ {
var config = (ManiaConfigManager)configCache.GetConfigFor(Ruleset.Value.CreateInstance()); var config = (ManiaRulesetConfigManager)configCache.GetConfigFor(Ruleset.Value.CreateInstance());
config.BindWith(ManiaSetting.ScrollDirection, direction); config.BindWith(ManiaRulesetSetting.ScrollDirection, direction);
} }
} }
} }

View File

@ -8,9 +8,9 @@ using osu.Game.Rulesets.Mania.UI;
namespace osu.Game.Rulesets.Mania.Configuration namespace osu.Game.Rulesets.Mania.Configuration
{ {
public class ManiaConfigManager : RulesetConfigManager<ManiaSetting> public class ManiaRulesetConfigManager : RulesetConfigManager<ManiaRulesetSetting>
{ {
public ManiaConfigManager(SettingsStore settings, RulesetInfo ruleset, int? variant = null) public ManiaRulesetConfigManager(SettingsStore settings, RulesetInfo ruleset, int? variant = null)
: base(settings, ruleset, variant) : base(settings, ruleset, variant)
{ {
} }
@ -19,17 +19,17 @@ namespace osu.Game.Rulesets.Mania.Configuration
{ {
base.InitialiseDefaults(); base.InitialiseDefaults();
Set(ManiaSetting.ScrollTime, 2250.0, 50.0, 10000.0, 50.0); Set(ManiaRulesetSetting.ScrollTime, 2250.0, 50.0, 10000.0, 50.0);
Set(ManiaSetting.ScrollDirection, ManiaScrollingDirection.Down); Set(ManiaRulesetSetting.ScrollDirection, ManiaScrollingDirection.Down);
} }
public override TrackedSettings CreateTrackedSettings() => new TrackedSettings public override TrackedSettings CreateTrackedSettings() => new TrackedSettings
{ {
new TrackedSetting<double>(ManiaSetting.ScrollTime, v => new SettingDescription(v, "Scroll Time", $"{v}ms")) new TrackedSetting<double>(ManiaRulesetSetting.ScrollTime, v => new SettingDescription(v, "Scroll Time", $"{v}ms"))
}; };
} }
public enum ManiaSetting public enum ManiaRulesetSetting
{ {
ScrollTime, ScrollTime,
ScrollDirection ScrollDirection

View File

@ -162,7 +162,7 @@ namespace osu.Game.Rulesets.Mania
public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new ManiaReplayFrame(); 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); public override RulesetSettingsSubsection CreateSettings() => new ManiaSettingsSubsection(this);

View File

@ -22,19 +22,19 @@ namespace osu.Game.Rulesets.Mania
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
{ {
var config = (ManiaConfigManager)Config; var config = (ManiaRulesetConfigManager)Config;
Children = new Drawable[] Children = new Drawable[]
{ {
new SettingsEnumDropdown<ManiaScrollingDirection> new SettingsEnumDropdown<ManiaScrollingDirection>
{ {
LabelText = "Scrolling direction", LabelText = "Scrolling direction",
Bindable = config.GetBindable<ManiaScrollingDirection>(ManiaSetting.ScrollDirection) Bindable = config.GetBindable<ManiaScrollingDirection>(ManiaRulesetSetting.ScrollDirection)
}, },
new SettingsSlider<double, TimeSlider> new SettingsSlider<double, TimeSlider>
{ {
LabelText = "Scroll speed", LabelText = "Scroll speed",
Bindable = config.GetBindable<double>(ManiaSetting.ScrollTime) Bindable = config.GetBindable<double>(ManiaRulesetSetting.ScrollTime)
}, },
}; };
} }

View File

@ -35,7 +35,7 @@ namespace osu.Game.Rulesets.Mania.UI
public IEnumerable<BarLine> BarLines; public IEnumerable<BarLine> BarLines;
protected new ManiaConfigManager Config => (ManiaConfigManager)base.Config; protected new ManiaRulesetConfigManager Config => (ManiaRulesetConfigManager)base.Config;
private readonly Bindable<ManiaScrollingDirection> configDirection = new Bindable<ManiaScrollingDirection>(); private readonly Bindable<ManiaScrollingDirection> configDirection = new Bindable<ManiaScrollingDirection>();
@ -75,10 +75,10 @@ namespace osu.Game.Rulesets.Mania.UI
{ {
BarLines.ForEach(Playfield.Add); BarLines.ForEach(Playfield.Add);
Config.BindWith(ManiaSetting.ScrollDirection, configDirection); Config.BindWith(ManiaRulesetSetting.ScrollDirection, configDirection);
configDirection.BindValueChanged(v => Direction.Value = (ScrollingDirection)v, true); configDirection.BindValueChanged(v => Direction.Value = (ScrollingDirection)v, true);
Config.BindWith(ManiaSetting.ScrollTime, TimeRange); Config.BindWith(ManiaRulesetSetting.ScrollTime, TimeRange);
} }
/// <summary> /// <summary>

View File

@ -46,7 +46,7 @@ namespace osu.Game.Rulesets.Osu.Tests
var dependencies = new DependencyContainer(base.CreateChildDependencies(parent)); var dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
var configCache = dependencies.Get<RulesetConfigCache>(); var configCache = dependencies.Get<RulesetConfigCache>();
dependencies.CacheAs((OsuConfigManager)configCache.GetConfigFor(new OsuRuleset())); dependencies.CacheAs((OsuRulesetConfigManager)configCache.GetConfigFor(new OsuRuleset()));
return dependencies; return dependencies;
} }

View File

@ -36,7 +36,7 @@ namespace osu.Game.Rulesets.Osu.Tests
var dependencies = new DependencyContainer(base.CreateChildDependencies(parent)); var dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
var configCache = dependencies.Get<RulesetConfigCache>(); var configCache = dependencies.Get<RulesetConfigCache>();
dependencies.CacheAs((OsuConfigManager)configCache.GetConfigFor(new OsuRuleset())); dependencies.CacheAs((OsuRulesetConfigManager)configCache.GetConfigFor(new OsuRuleset()));
return dependencies; return dependencies;
} }

View File

@ -6,9 +6,9 @@ using osu.Game.Rulesets.Configuration;
namespace osu.Game.Rulesets.Osu.Configuration namespace osu.Game.Rulesets.Osu.Configuration
{ {
public class OsuConfigManager : RulesetConfigManager<OsuSetting> public class OsuRulesetConfigManager : RulesetConfigManager<OsuRulesetSetting>
{ {
public OsuConfigManager(SettingsStore settings, RulesetInfo ruleset, int? variant = null) public OsuRulesetConfigManager(SettingsStore settings, RulesetInfo ruleset, int? variant = null)
: base(settings, ruleset, variant) : base(settings, ruleset, variant)
{ {
} }
@ -17,12 +17,12 @@ namespace osu.Game.Rulesets.Osu.Configuration
{ {
base.InitialiseDefaults(); base.InitialiseDefaults();
Set(OsuSetting.SnakingInSliders, true); Set(OsuRulesetSetting.SnakingInSliders, true);
Set(OsuSetting.SnakingOutSliders, true); Set(OsuRulesetSetting.SnakingOutSliders, true);
} }
} }
public enum OsuSetting public enum OsuRulesetSetting
{ {
SnakingInSliders, SnakingInSliders,
SnakingOutSliders SnakingOutSliders

View File

@ -93,10 +93,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuConfigManager config) private void load(OsuRulesetConfigManager rulesetConfig)
{ {
config.BindWith(OsuSetting.SnakingInSliders, Body.SnakingIn); rulesetConfig.BindWith(OsuRulesetSetting.SnakingInSliders, Body.SnakingIn);
config.BindWith(OsuSetting.SnakingOutSliders, Body.SnakingOut); rulesetConfig.BindWith(OsuRulesetSetting.SnakingOutSliders, Body.SnakingOut);
positionBindable.BindValueChanged(_ => Position = HitObject.StackedPosition); positionBindable.BindValueChanged(_ => Position = HitObject.StackedPosition);
scaleBindable.BindValueChanged(v => scaleBindable.BindValueChanged(v =>

View File

@ -148,7 +148,7 @@ namespace osu.Game.Rulesets.Osu
public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new OsuReplayFrame(); 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) public OsuRuleset(RulesetInfo rulesetInfo = null)
: base(rulesetInfo) : base(rulesetInfo)

View File

@ -112,7 +112,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(GameConfigManager config, IBindableBeatmap beatmap) private void load(OsuConfigManager config, IBindableBeatmap beatmap)
{ {
InternalChild = expandTarget = new Container InternalChild = expandTarget = new Container
{ {
@ -185,10 +185,10 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
this.beatmap.BindTo(beatmap); this.beatmap.BindTo(beatmap);
this.beatmap.ValueChanged += v => calculateScale(); this.beatmap.ValueChanged += v => calculateScale();
cursorScale = config.GetBindable<double>(GameSetting.GameplayCursorSize); cursorScale = config.GetBindable<double>(OsuSetting.GameplayCursorSize);
cursorScale.ValueChanged += v => calculateScale(); cursorScale.ValueChanged += v => calculateScale();
autoCursorScale = config.GetBindable<bool>(GameSetting.AutoCursorSize); autoCursorScale = config.GetBindable<bool>(OsuSetting.AutoCursorSize);
autoCursorScale.ValueChanged += v => calculateScale(); autoCursorScale.ValueChanged += v => calculateScale();
calculateScale(); calculateScale();

View File

@ -21,7 +21,7 @@ namespace osu.Game.Rulesets.Osu.UI
{ {
public class OsuRulesetContainer : RulesetContainer<OsuPlayfield, OsuHitObject> public class OsuRulesetContainer : RulesetContainer<OsuPlayfield, OsuHitObject>
{ {
protected new OsuConfigManager Config => (OsuConfigManager)base.Config; protected new OsuRulesetConfigManager Config => (OsuRulesetConfigManager)base.Config;
public OsuRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap) public OsuRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap)
: base(ruleset, beatmap) : base(ruleset, beatmap)

View File

@ -1,38 +0,0 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// 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<bool>(OsuSetting.SnakingInSliders)
},
new SettingsCheckbox
{
LabelText = "Snaking out sliders",
Bindable = config.GetBindable<bool>(OsuSetting.SnakingOutSliders)
},
};
}
}
}

View File

@ -20,19 +20,19 @@ namespace osu.Game.Rulesets.Osu.UI
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
{ {
var config = (OsuConfigManager)Config; var config = (OsuRulesetConfigManager)Config;
Children = new Drawable[] Children = new Drawable[]
{ {
new SettingsCheckbox new SettingsCheckbox
{ {
LabelText = "Snaking in sliders", LabelText = "Snaking in sliders",
Bindable = config.GetBindable<bool>(OsuSetting.SnakingInSliders) Bindable = config.GetBindable<bool>(OsuRulesetSetting.SnakingInSliders)
}, },
new SettingsCheckbox new SettingsCheckbox
{ {
LabelText = "Snaking out sliders", LabelText = "Snaking out sliders",
Bindable = config.GetBindable<bool>(OsuSetting.SnakingOutSliders) Bindable = config.GetBindable<bool>(OsuRulesetSetting.SnakingOutSliders)
}, },
}; };
} }

View File

@ -1,170 +0,0 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// 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<GameSetting>
{
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<bool>(GameSetting.MouseDisableButtons, v => new SettingDescription(!v, "gameplay mouse buttons", v ? "disabled" : "enabled")),
new TrackedSetting<ScalingMode>(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
}
}

View File

@ -72,9 +72,6 @@ namespace osu.Game.Configuration
Set(OsuSetting.MenuParallax, true); Set(OsuSetting.MenuParallax, true);
Set(OsuSetting.SnakingInSliders, true);
Set(OsuSetting.SnakingOutSliders, true);
// Gameplay // Gameplay
Set(OsuSetting.DimLevel, 0.3, 0, 1, 0.01); Set(OsuSetting.DimLevel, 0.3, 0, 1, 0.01);
Set(OsuSetting.BlurLevel, 0, 0, 1, 0.01); Set(OsuSetting.BlurLevel, 0, 0, 1, 0.01);
@ -150,8 +147,6 @@ namespace osu.Game.Configuration
DisplayStarsMinimum, DisplayStarsMinimum,
DisplayStarsMaximum, DisplayStarsMaximum,
RandomSelectAlgorithm, RandomSelectAlgorithm,
SnakingInSliders,
SnakingOutSliders,
ShowFpsDisplay, ShowFpsDisplay,
ChatDisplayHeight, ChatDisplayHeight,
Version, Version,

View File

@ -40,9 +40,9 @@ namespace osu.Game.Graphics.Containers
protected override Container<Drawable> Content => content; protected override Container<Drawable> Content => content;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(GameConfigManager config) private void load(OsuConfigManager config)
{ {
parallaxEnabled = config.GetBindable<bool>(GameSetting.MenuParallax); parallaxEnabled = config.GetBindable<bool>(OsuSetting.MenuParallax);
parallaxEnabled.ValueChanged += delegate parallaxEnabled.ValueChanged += delegate
{ {
if (!parallaxEnabled) if (!parallaxEnabled)

View File

@ -65,11 +65,11 @@ namespace osu.Game.Graphics.Containers
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(GameConfigManager gameConfig) private void load(OsuConfigManager gameConfig)
{ {
if (applyUIScale) if (applyUIScale)
{ {
uiScale = gameConfig.GetBindable<float>(GameSetting.UIScale); uiScale = gameConfig.GetBindable<float>(OsuSetting.UIScale);
uiScale.BindValueChanged(scaleChanged, true); uiScale.BindValueChanged(scaleChanged, true);
} }
} }
@ -82,21 +82,21 @@ namespace osu.Game.Graphics.Containers
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(GameConfigManager config) private void load(OsuConfigManager config)
{ {
scalingMode = config.GetBindable<ScalingMode>(GameSetting.Scaling); scalingMode = config.GetBindable<ScalingMode>(OsuSetting.Scaling);
scalingMode.ValueChanged += _ => updateSize(); scalingMode.ValueChanged += _ => updateSize();
sizeX = config.GetBindable<float>(GameSetting.ScalingSizeX); sizeX = config.GetBindable<float>(OsuSetting.ScalingSizeX);
sizeX.ValueChanged += _ => updateSize(); sizeX.ValueChanged += _ => updateSize();
sizeY = config.GetBindable<float>(GameSetting.ScalingSizeY); sizeY = config.GetBindable<float>(OsuSetting.ScalingSizeY);
sizeY.ValueChanged += _ => updateSize(); sizeY.ValueChanged += _ => updateSize();
posX = config.GetBindable<float>(GameSetting.ScalingPositionX); posX = config.GetBindable<float>(OsuSetting.ScalingPositionX);
posX.ValueChanged += _ => updateSize(); posX.ValueChanged += _ => updateSize();
posY = config.GetBindable<float>(GameSetting.ScalingPositionY); posY = config.GetBindable<float>(OsuSetting.ScalingPositionY);
posY.ValueChanged += _ => updateSize(); posY.ValueChanged += _ => updateSize();
} }

View File

@ -31,9 +31,9 @@ namespace osu.Game.Graphics.Cursor
private Vector2 positionMouseDown; private Vector2 positionMouseDown;
[BackgroundDependencyLoader(true)] [BackgroundDependencyLoader(true)]
private void load([NotNull] GameConfigManager config, [CanBeNull] ScreenshotManager screenshotManager) private void load([NotNull] OsuConfigManager config, [CanBeNull] ScreenshotManager screenshotManager)
{ {
cursorRotate = config.GetBindable<bool>(GameSetting.CursorRotation); cursorRotate = config.GetBindable<bool>(OsuSetting.CursorRotation);
if (screenshotManager != null) if (screenshotManager != null)
screenshotCursorVisibility.BindTo(screenshotManager.CursorVisibility); screenshotCursorVisibility.BindTo(screenshotManager.CursorVisibility);
@ -131,7 +131,7 @@ namespace osu.Game.Graphics.Cursor
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(GameConfigManager config, TextureStore textures, OsuColour colour) private void load(OsuConfigManager config, TextureStore textures, OsuColour colour)
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
@ -155,7 +155,7 @@ namespace osu.Game.Graphics.Cursor
} }
}; };
cursorScale = config.GetBindable<double>(GameSetting.MenuCursorSize); cursorScale = config.GetBindable<double>(OsuSetting.MenuCursorSize);
cursorScale.ValueChanged += newScale => cursorContainer.Scale = new Vector2((float)newScale * base_scale); cursorScale.ValueChanged += newScale => cursorContainer.Scale = new Vector2((float)newScale * base_scale);
cursorScale.TriggerChange(); cursorScale.TriggerChange();
} }

View File

@ -42,14 +42,14 @@ namespace osu.Game.Graphics
private SampleChannel shutter; private SampleChannel shutter;
[BackgroundDependencyLoader] [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.host = host;
this.storage = storage.GetStorageForDirectory(@"screenshots"); this.storage = storage.GetStorageForDirectory(@"screenshots");
this.notificationOverlay = notificationOverlay; this.notificationOverlay = notificationOverlay;
screenshotFormat = config.GetBindable<ScreenshotFormat>(GameSetting.ScreenshotFormat); screenshotFormat = config.GetBindable<ScreenshotFormat>(OsuSetting.ScreenshotFormat);
captureMenuCursor = config.GetBindable<bool>(GameSetting.ScreenshotCaptureMenuCursor); captureMenuCursor = config.GetBindable<bool>(OsuSetting.ScreenshotCaptureMenuCursor);
shutter = audio.Sample.Get("UI/shutter"); shutter = audio.Sample.Get("UI/shutter");
} }

View File

@ -19,7 +19,7 @@ namespace osu.Game.Online.API
{ {
public class APIAccess : Component, IAPIProvider public class APIAccess : Component, IAPIProvider
{ {
private readonly GameConfigManager config; private readonly OsuConfigManager config;
private readonly OAuth authentication; private readonly OAuth authentication;
public string Endpoint = @"https://osu.ppy.sh"; public string Endpoint = @"https://osu.ppy.sh";
@ -43,16 +43,16 @@ namespace osu.Game.Online.API
private readonly Logger log; private readonly Logger log;
public APIAccess(GameConfigManager config) public APIAccess(OsuConfigManager config)
{ {
this.config = config; this.config = config;
authentication = new OAuth(client_id, client_secret, Endpoint); authentication = new OAuth(client_id, client_secret, Endpoint);
log = Logger.GetLogger(LoggingTarget.Network); log = Logger.GetLogger(LoggingTarget.Network);
ProvidedUsername = config.Get<string>(GameSetting.Username); ProvidedUsername = config.Get<string>(OsuSetting.Username);
authentication.TokenString = config.Get<string>(GameSetting.Token); authentication.TokenString = config.Get<string>(OsuSetting.Token);
authentication.Token.ValueChanged += onTokenChanged; authentication.Token.ValueChanged += onTokenChanged;
var thread = new Thread(run) var thread = new Thread(run)
@ -64,7 +64,7 @@ namespace osu.Game.Online.API
thread.Start(); thread.Start();
} }
private void onTokenChanged(OAuthToken token) => config.Set(GameSetting.Token, config.Get<bool>(GameSetting.SavePassword) ? authentication.TokenString : string.Empty); private void onTokenChanged(OAuthToken token) => config.Set(OsuSetting.Token, config.Get<bool>(OsuSetting.SavePassword) ? authentication.TokenString : string.Empty);
private readonly List<IOnlineComponent> components = new List<IOnlineComponent>(); private readonly List<IOnlineComponent> components = new List<IOnlineComponent>();
@ -124,7 +124,7 @@ namespace osu.Game.Online.API
State = APIState.Connecting; State = APIState.Connecting;
// save the username at this point, if the user requested for it to be. // save the username at this point, if the user requested for it to be.
config.Set(GameSetting.Username, config.Get<bool>(GameSetting.SaveUsername) ? ProvidedUsername : string.Empty); config.Set(OsuSetting.Username, config.Get<bool>(OsuSetting.SaveUsername) ? ProvidedUsername : string.Empty);
if (!authentication.HasValidAccessToken && !authentication.AuthenticateWithLogin(ProvidedUsername, password)) if (!authentication.HasValidAccessToken && !authentication.AuthenticateWithLogin(ProvidedUsername, password))
{ {

View File

@ -18,11 +18,11 @@ namespace osu.Game.Online.Chat
private Bindable<bool> externalLinkWarning; private Bindable<bool> externalLinkWarning;
[BackgroundDependencyLoader(true)] [BackgroundDependencyLoader(true)]
private void load(GameHost host, DialogOverlay dialogOverlay, GameConfigManager config) private void load(GameHost host, DialogOverlay dialogOverlay, OsuConfigManager config)
{ {
this.host = host; this.host = host;
this.dialogOverlay = dialogOverlay; this.dialogOverlay = dialogOverlay;
externalLinkWarning = config.GetBindable<bool>(GameSetting.ExternalLinkWarning); externalLinkWarning = config.GetBindable<bool>(OsuSetting.ExternalLinkWarning);
} }
public void OpenUrlExternally(string url) public void OpenUrlExternally(string url)

View File

@ -174,17 +174,17 @@ namespace osu.Game
dependencies.CacheAs<IBindable<RulesetInfo>>(ruleset); dependencies.CacheAs<IBindable<RulesetInfo>>(ruleset);
// bind config int to database RulesetInfo // bind config int to database RulesetInfo
configRuleset = LocalConfig.GetBindable<int>(GameSetting.Ruleset); configRuleset = LocalConfig.GetBindable<int>(OsuSetting.Ruleset);
ruleset.Value = RulesetStore.GetRuleset(configRuleset.Value) ?? RulesetStore.AvailableRulesets.First(); ruleset.Value = RulesetStore.GetRuleset(configRuleset.Value) ?? RulesetStore.AvailableRulesets.First();
ruleset.ValueChanged += r => configRuleset.Value = r.ID ?? 0; ruleset.ValueChanged += r => configRuleset.Value = r.ID ?? 0;
// bind config int to database SkinInfo // bind config int to database SkinInfo
configSkin = LocalConfig.GetBindable<int>(GameSetting.Skin); configSkin = LocalConfig.GetBindable<int>(OsuSetting.Skin);
SkinManager.CurrentSkinInfo.ValueChanged += s => configSkin.Value = s.ID; SkinManager.CurrentSkinInfo.ValueChanged += s => configSkin.Value = s.ID;
configSkin.ValueChanged += id => SkinManager.CurrentSkinInfo.Value = SkinManager.Query(s => s.ID == id) ?? SkinInfo.Default; configSkin.ValueChanged += id => SkinManager.CurrentSkinInfo.Value = SkinManager.Query(s => s.ID == id) ?? SkinInfo.Default;
configSkin.TriggerChange(); configSkin.TriggerChange();
LocalConfig.BindWith(GameSetting.VolumeInactive, inactiveVolumeAdjust); LocalConfig.BindWith(OsuSetting.VolumeInactive, inactiveVolumeAdjust);
} }
private ExternalLinkOpener externalLinkOpener; private ExternalLinkOpener externalLinkOpener;
@ -631,7 +631,7 @@ namespace osu.Game
direct.ToggleVisibility(); direct.ToggleVisibility();
return true; return true;
case GlobalAction.ToggleGameplayMouseButtons: case GlobalAction.ToggleGameplayMouseButtons:
LocalConfig.Set(GameSetting.MouseDisableButtons, !LocalConfig.Get<bool>(GameSetting.MouseDisableButtons)); LocalConfig.Set(OsuSetting.MouseDisableButtons, !LocalConfig.Get<bool>(OsuSetting.MouseDisableButtons));
return true; return true;
} }

View File

@ -43,7 +43,7 @@ namespace osu.Game
/// </summary> /// </summary>
public class OsuGameBase : Framework.Game, ICanAcceptFiles public class OsuGameBase : Framework.Game, ICanAcceptFiles
{ {
protected GameConfigManager LocalConfig; protected OsuConfigManager LocalConfig;
protected BeatmapManager BeatmapManager; protected BeatmapManager BeatmapManager;
@ -206,7 +206,7 @@ namespace osu.Game
// TODO: This is temporary until we reimplement the local FPS display. // 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. // It's just to allow end-users to access the framework FPS display without knowing the shortcut key.
fpsDisplayVisible = LocalConfig.GetBindable<bool>(GameSetting.ShowFpsDisplay); fpsDisplayVisible = LocalConfig.GetBindable<bool>(OsuSetting.ShowFpsDisplay);
fpsDisplayVisible.ValueChanged += val => { FrameStatisticsMode = val ? FrameStatisticsMode.Minimal : FrameStatisticsMode.None; }; fpsDisplayVisible.ValueChanged += val => { FrameStatisticsMode = val ? FrameStatisticsMode.Minimal : FrameStatisticsMode.None; };
fpsDisplayVisible.TriggerChange(); fpsDisplayVisible.TriggerChange();
} }
@ -237,7 +237,7 @@ namespace osu.Game
public override void SetHost(GameHost host) public override void SetHost(GameHost host)
{ {
if (LocalConfig == null) if (LocalConfig == null)
LocalConfig = new GameConfigManager(host.Storage); LocalConfig = new OsuConfigManager(host.Storage);
base.SetHost(host); base.SetHost(host);
} }

View File

@ -325,9 +325,9 @@ namespace osu.Game.Overlays
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(GameConfigManager config, OsuColour colours, ChannelManager channelManager) private void load(OsuConfigManager config, OsuColour colours, ChannelManager channelManager)
{ {
ChatHeight = config.GetBindable<double>(GameSetting.ChatDisplayHeight); ChatHeight = config.GetBindable<double>(OsuSetting.ChatDisplayHeight);
ChatHeight.ValueChanged += h => ChatHeight.ValueChanged += h =>
{ {
chatContainer.Height = (float)h; chatContainer.Height = (float)h;

View File

@ -117,7 +117,7 @@ namespace osu.Game.Overlays
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(FrameworkConfigManager frameworkConfig, GameConfigManager gameConfig) private void load(FrameworkConfigManager frameworkConfig, OsuConfigManager gameConfig)
{ {
BeginTracking(this, frameworkConfig); BeginTracking(this, frameworkConfig);
BeginTracking(this, gameConfig); BeginTracking(this, gameConfig);

View File

@ -11,19 +11,19 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
protected override string Header => "Main Menu"; protected override string Header => "Main Menu";
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(GameConfigManager config) private void load(OsuConfigManager config)
{ {
Children = new[] Children = new[]
{ {
new SettingsCheckbox new SettingsCheckbox
{ {
LabelText = "Interface voices", LabelText = "Interface voices",
Bindable = config.GetBindable<bool>(GameSetting.MenuVoice) Bindable = config.GetBindable<bool>(OsuSetting.MenuVoice)
}, },
new SettingsCheckbox new SettingsCheckbox
{ {
LabelText = "osu! music theme", LabelText = "osu! music theme",
Bindable = config.GetBindable<bool>(GameSetting.MenuMusic) Bindable = config.GetBindable<bool>(OsuSetting.MenuMusic)
}, },
}; };
} }

View File

@ -13,14 +13,14 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
protected override string Header => "Offset Adjustment"; protected override string Header => "Offset Adjustment";
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(GameConfigManager config) private void load(OsuConfigManager config)
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new SettingsSlider<double, OffsetSlider> new SettingsSlider<double, OffsetSlider>
{ {
LabelText = "Audio offset", LabelText = "Audio offset",
Bindable = config.GetBindable<double>(GameSetting.AudioOffset), Bindable = config.GetBindable<double>(OsuSetting.AudioOffset),
KeyboardStep = 1f KeyboardStep = 1f
}, },
new SettingsButton new SettingsButton

View File

@ -13,12 +13,12 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
protected override string Header => "Volume"; protected override string Header => "Volume";
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(AudioManager audio, GameConfigManager config) private void load(AudioManager audio, OsuConfigManager config)
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new SettingsSlider<double> { LabelText = "Master", Bindable = audio.Volume, KeyboardStep = 0.01f }, new SettingsSlider<double> { LabelText = "Master", Bindable = audio.Volume, KeyboardStep = 0.01f },
new SettingsSlider<double> { LabelText = "Master (window inactive)", Bindable = config.GetBindable<double>(GameSetting.VolumeInactive), KeyboardStep = 0.01f }, new SettingsSlider<double> { LabelText = "Master (window inactive)", Bindable = config.GetBindable<double>(OsuSetting.VolumeInactive), KeyboardStep = 0.01f },
new SettingsSlider<double> { LabelText = "Effect", Bindable = audio.VolumeSample, KeyboardStep = 0.01f }, new SettingsSlider<double> { LabelText = "Effect", Bindable = audio.VolumeSample, KeyboardStep = 0.01f },
new SettingsSlider<double> { LabelText = "Music", Bindable = audio.VolumeTrack, KeyboardStep = 0.01f }, new SettingsSlider<double> { LabelText = "Music", Bindable = audio.VolumeTrack, KeyboardStep = 0.01f },
}; };

View File

@ -13,36 +13,36 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
protected override string Header => "General"; protected override string Header => "General";
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(GameConfigManager config) private void load(OsuConfigManager config)
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new SettingsSlider<double> new SettingsSlider<double>
{ {
LabelText = "Background dim", LabelText = "Background dim",
Bindable = config.GetBindable<double>(GameSetting.DimLevel), Bindable = config.GetBindable<double>(OsuSetting.DimLevel),
KeyboardStep = 0.01f KeyboardStep = 0.01f
}, },
new SettingsSlider<double> new SettingsSlider<double>
{ {
LabelText = "Background blur", LabelText = "Background blur",
Bindable = config.GetBindable<double>(GameSetting.BlurLevel), Bindable = config.GetBindable<double>(OsuSetting.BlurLevel),
KeyboardStep = 0.01f KeyboardStep = 0.01f
}, },
new SettingsCheckbox new SettingsCheckbox
{ {
LabelText = "Show score overlay", LabelText = "Show score overlay",
Bindable = config.GetBindable<bool>(GameSetting.ShowInterface) Bindable = config.GetBindable<bool>(OsuSetting.ShowInterface)
}, },
new SettingsCheckbox new SettingsCheckbox
{ {
LabelText = "Always show key overlay", LabelText = "Always show key overlay",
Bindable = config.GetBindable<bool>(GameSetting.KeyOverlay) Bindable = config.GetBindable<bool>(OsuSetting.KeyOverlay)
}, },
new SettingsEnumDropdown<ScoringMode> new SettingsEnumDropdown<ScoringMode>
{ {
LabelText = "Score display mode", LabelText = "Score display mode",
Bindable = config.GetBindable<ScoringMode>(GameSetting.ScoreDisplayMode) Bindable = config.GetBindable<ScoringMode>(OsuSetting.ScoreDisplayMode)
} }
}; };
} }

View File

@ -11,14 +11,14 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
protected override string Header => "Mods"; protected override string Header => "Mods";
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(GameConfigManager config) private void load(OsuConfigManager config)
{ {
Children = new[] Children = new[]
{ {
new SettingsCheckbox new SettingsCheckbox
{ {
LabelText = "Increase visibility of first object with \"Hidden\" mod", LabelText = "Increase visibility of first object with \"Hidden\" mod",
Bindable = config.GetBindable<bool>(GameSetting.IncreaseFirstObjectVisibility) Bindable = config.GetBindable<bool>(OsuSetting.IncreaseFirstObjectVisibility)
}, },
}; };
} }

View File

@ -13,36 +13,36 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
protected override string Header => "Song Select"; protected override string Header => "Song Select";
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(GameConfigManager config) private void load(OsuConfigManager config)
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new SettingsCheckbox new SettingsCheckbox
{ {
LabelText = "Right mouse drag to absolute scroll", LabelText = "Right mouse drag to absolute scroll",
Bindable = config.GetBindable<bool>(GameSetting.SongSelectRightMouseScroll), Bindable = config.GetBindable<bool>(OsuSetting.SongSelectRightMouseScroll),
}, },
new SettingsCheckbox new SettingsCheckbox
{ {
LabelText = "Show converted beatmaps", LabelText = "Show converted beatmaps",
Bindable = config.GetBindable<bool>(GameSetting.ShowConvertedBeatmaps), Bindable = config.GetBindable<bool>(OsuSetting.ShowConvertedBeatmaps),
}, },
new SettingsSlider<double, StarSlider> new SettingsSlider<double, StarSlider>
{ {
LabelText = "Display beatmaps from", LabelText = "Display beatmaps from",
Bindable = config.GetBindable<double>(GameSetting.DisplayStarsMinimum), Bindable = config.GetBindable<double>(OsuSetting.DisplayStarsMinimum),
KeyboardStep = 0.1f KeyboardStep = 0.1f
}, },
new SettingsSlider<double, StarSlider> new SettingsSlider<double, StarSlider>
{ {
LabelText = "up to", LabelText = "up to",
Bindable = config.GetBindable<double>(GameSetting.DisplayStarsMaximum), Bindable = config.GetBindable<double>(OsuSetting.DisplayStarsMaximum),
KeyboardStep = 0.1f KeyboardStep = 0.1f
}, },
new SettingsEnumDropdown<RandomSelectAlgorithm> new SettingsEnumDropdown<RandomSelectAlgorithm>
{ {
LabelText = "Random selection algorithm", LabelText = "Random selection algorithm",
Bindable = config.GetBindable<RandomSelectAlgorithm>(GameSetting.RandomSelectAlgorithm), Bindable = config.GetBindable<RandomSelectAlgorithm>(OsuSetting.RandomSelectAlgorithm),
} }
}; };
} }

View File

@ -206,7 +206,7 @@ namespace osu.Game.Overlays.Settings.Sections.General
} }
[BackgroundDependencyLoader(permitNulls: true)] [BackgroundDependencyLoader(permitNulls: true)]
private void load(APIAccess api, GameConfigManager config, AccountCreationOverlay accountCreation) private void load(APIAccess api, OsuConfigManager config, AccountCreationOverlay accountCreation)
{ {
this.api = api; this.api = api;
Direction = FillDirection.Vertical; Direction = FillDirection.Vertical;
@ -232,12 +232,12 @@ namespace osu.Game.Overlays.Settings.Sections.General
new SettingsCheckbox new SettingsCheckbox
{ {
LabelText = "Remember email address", LabelText = "Remember email address",
Bindable = config.GetBindable<bool>(GameSetting.SaveUsername), Bindable = config.GetBindable<bool>(OsuSetting.SaveUsername),
}, },
new SettingsCheckbox new SettingsCheckbox
{ {
LabelText = "Stay signed in", LabelText = "Stay signed in",
Bindable = config.GetBindable<bool>(GameSetting.SavePassword), Bindable = config.GetBindable<bool>(OsuSetting.SavePassword),
}, },
new SettingsButton new SettingsButton
{ {

View File

@ -13,14 +13,14 @@ namespace osu.Game.Overlays.Settings.Sections.General
protected override string Header => "Updates"; protected override string Header => "Updates";
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(Storage storage, GameConfigManager config) private void load(Storage storage, OsuConfigManager config)
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new SettingsEnumDropdown<ReleaseStream> new SettingsEnumDropdown<ReleaseStream>
{ {
LabelText = "Release stream", LabelText = "Release stream",
Bindable = config.GetBindable<ReleaseStream>(GameSetting.ReleaseStream), Bindable = config.GetBindable<ReleaseStream>(OsuSetting.ReleaseStream),
}, },
new SettingsButton new SettingsButton
{ {

View File

@ -12,29 +12,29 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
protected override string Header => "Detail Settings"; protected override string Header => "Detail Settings";
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(GameConfigManager config) private void load(OsuConfigManager config)
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new SettingsCheckbox new SettingsCheckbox
{ {
LabelText = "Storyboards", LabelText = "Storyboards",
Bindable = config.GetBindable<bool>(GameSetting.ShowStoryboard) Bindable = config.GetBindable<bool>(OsuSetting.ShowStoryboard)
}, },
new SettingsCheckbox new SettingsCheckbox
{ {
LabelText = "Rotate cursor when dragging", LabelText = "Rotate cursor when dragging",
Bindable = config.GetBindable<bool>(GameSetting.CursorRotation) Bindable = config.GetBindable<bool>(OsuSetting.CursorRotation)
}, },
new SettingsEnumDropdown<ScreenshotFormat> new SettingsEnumDropdown<ScreenshotFormat>
{ {
LabelText = "Screenshot format", LabelText = "Screenshot format",
Bindable = config.GetBindable<ScreenshotFormat>(GameSetting.ScreenshotFormat) Bindable = config.GetBindable<ScreenshotFormat>(OsuSetting.ScreenshotFormat)
}, },
new SettingsCheckbox new SettingsCheckbox
{ {
LabelText = "Show menu cursor in screenshots", LabelText = "Show menu cursor in screenshots",
Bindable = config.GetBindable<bool>(GameSetting.ScreenshotCaptureMenuCursor) Bindable = config.GetBindable<bool>(OsuSetting.ScreenshotCaptureMenuCursor)
} }
}; };
} }

View File

@ -38,16 +38,16 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
private const int transition_duration = 400; private const int transition_duration = 400;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(FrameworkConfigManager config, GameConfigManager gameConfig, OsuGameBase game) private void load(FrameworkConfigManager config, OsuConfigManager gameConfig, OsuGameBase game)
{ {
this.game = game; this.game = game;
scalingMode = gameConfig.GetBindable<ScalingMode>(GameSetting.Scaling); scalingMode = gameConfig.GetBindable<ScalingMode>(OsuSetting.Scaling);
sizeFullscreen = config.GetBindable<Size>(FrameworkSetting.SizeFullscreen); sizeFullscreen = config.GetBindable<Size>(FrameworkSetting.SizeFullscreen);
scalingSizeX = gameConfig.GetBindable<float>(GameSetting.ScalingSizeX); scalingSizeX = gameConfig.GetBindable<float>(OsuSetting.ScalingSizeX);
scalingSizeY = gameConfig.GetBindable<float>(GameSetting.ScalingSizeY); scalingSizeY = gameConfig.GetBindable<float>(OsuSetting.ScalingSizeY);
scalingPositionX = gameConfig.GetBindable<float>(GameSetting.ScalingPositionX); scalingPositionX = gameConfig.GetBindable<float>(OsuSetting.ScalingPositionX);
scalingPositionY = gameConfig.GetBindable<float>(GameSetting.ScalingPositionY); scalingPositionY = gameConfig.GetBindable<float>(OsuSetting.ScalingPositionY);
Container resolutionSettingsContainer; Container resolutionSettingsContainer;
@ -67,13 +67,13 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
{ {
LabelText = "UI Scaling", LabelText = "UI Scaling",
TransferValueOnCommit = true, TransferValueOnCommit = true,
Bindable = gameConfig.GetBindable<float>(GameSetting.UIScale), Bindable = gameConfig.GetBindable<float>(OsuSetting.UIScale),
KeyboardStep = 0.01f KeyboardStep = 0.01f
}, },
new SettingsEnumDropdown<ScalingMode> new SettingsEnumDropdown<ScalingMode>
{ {
LabelText = "Screen Scaling", LabelText = "Screen Scaling",
Bindable = gameConfig.GetBindable<ScalingMode>(GameSetting.Scaling), Bindable = gameConfig.GetBindable<ScalingMode>(OsuSetting.Scaling),
}, },
scalingSettings = new FillFlowContainer<SettingsSlider<float>> scalingSettings = new FillFlowContainer<SettingsSlider<float>>
{ {

View File

@ -11,14 +11,14 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
protected override string Header => "User Interface"; protected override string Header => "User Interface";
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(GameConfigManager config) private void load(OsuConfigManager config)
{ {
Children = new[] Children = new[]
{ {
new SettingsCheckbox new SettingsCheckbox
{ {
LabelText = "Parallax", LabelText = "Parallax",
Bindable = config.GetBindable<bool>(GameSetting.MenuParallax) Bindable = config.GetBindable<bool>(OsuSetting.MenuParallax)
}, },
}; };
} }

View File

@ -13,7 +13,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
protected override string Header => "Renderer"; protected override string Header => "Renderer";
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(FrameworkConfigManager config, GameConfigManager gameConfig) private void load(FrameworkConfigManager config, OsuConfigManager gameConfig)
{ {
// NOTE: Compatability mode omitted // NOTE: Compatability mode omitted
Children = new Drawable[] Children = new Drawable[]
@ -27,7 +27,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
new SettingsCheckbox new SettingsCheckbox
{ {
LabelText = "Show FPS", LabelText = "Show FPS",
Bindable = gameConfig.GetBindable<bool>(GameSetting.ShowFpsDisplay) Bindable = gameConfig.GetBindable<bool>(OsuSetting.ShowFpsDisplay)
}, },
}; };
} }

View File

@ -19,7 +19,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
private SensitivitySetting sensitivity; private SensitivitySetting sensitivity;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(GameConfigManager gameConfig, FrameworkConfigManager config) private void load(OsuConfigManager gameConfig, FrameworkConfigManager config)
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
@ -46,12 +46,12 @@ namespace osu.Game.Overlays.Settings.Sections.Input
new SettingsCheckbox new SettingsCheckbox
{ {
LabelText = "Disable mouse wheel during gameplay", LabelText = "Disable mouse wheel during gameplay",
Bindable = gameConfig.GetBindable<bool>(GameSetting.MouseDisableWheel) Bindable = gameConfig.GetBindable<bool>(OsuSetting.MouseDisableWheel)
}, },
new SettingsCheckbox new SettingsCheckbox
{ {
LabelText = "Disable mouse buttons during gameplay", LabelText = "Disable mouse buttons during gameplay",
Bindable = gameConfig.GetBindable<bool>(GameSetting.MouseDisableButtons) Bindable = gameConfig.GetBindable<bool>(OsuSetting.MouseDisableButtons)
}, },
}; };

View File

@ -12,14 +12,14 @@ namespace osu.Game.Overlays.Settings.Sections.Online
protected override string Header => "Web"; protected override string Header => "Web";
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(GameConfigManager config) private void load(OsuConfigManager config)
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new SettingsCheckbox new SettingsCheckbox
{ {
LabelText = "Warn about opening external links", LabelText = "Warn about opening external links",
Bindable = config.GetBindable<bool>(GameSetting.ExternalLinkWarning) Bindable = config.GetBindable<bool>(OsuSetting.ExternalLinkWarning)
}, },
}; };
} }

View File

@ -27,7 +27,7 @@ namespace osu.Game.Overlays.Settings.Sections
private SkinManager skins; private SkinManager skins;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(GameConfigManager config, SkinManager skins) private void load(OsuConfigManager config, SkinManager skins)
{ {
this.skins = skins; this.skins = skins;
@ -38,41 +38,41 @@ namespace osu.Game.Overlays.Settings.Sections
new SettingsSlider<double, SizeSlider> new SettingsSlider<double, SizeSlider>
{ {
LabelText = "Menu cursor size", LabelText = "Menu cursor size",
Bindable = config.GetBindable<double>(GameSetting.MenuCursorSize), Bindable = config.GetBindable<double>(OsuSetting.MenuCursorSize),
KeyboardStep = 0.01f KeyboardStep = 0.01f
}, },
new SettingsSlider<double, SizeSlider> new SettingsSlider<double, SizeSlider>
{ {
LabelText = "Gameplay cursor size", LabelText = "Gameplay cursor size",
Bindable = config.GetBindable<double>(GameSetting.GameplayCursorSize), Bindable = config.GetBindable<double>(OsuSetting.GameplayCursorSize),
KeyboardStep = 0.01f KeyboardStep = 0.01f
}, },
new SettingsCheckbox new SettingsCheckbox
{ {
LabelText = "Adjust gameplay cursor size based on current beatmap", LabelText = "Adjust gameplay cursor size based on current beatmap",
Bindable = config.GetBindable<bool>(GameSetting.AutoCursorSize) Bindable = config.GetBindable<bool>(OsuSetting.AutoCursorSize)
}, },
new SettingsCheckbox new SettingsCheckbox
{ {
LabelText = "Beatmap skins", LabelText = "Beatmap skins",
Bindable = config.GetBindable<bool>(GameSetting.BeatmapSkins) Bindable = config.GetBindable<bool>(OsuSetting.BeatmapSkins)
}, },
new SettingsCheckbox new SettingsCheckbox
{ {
LabelText = "Beatmap hitsounds", LabelText = "Beatmap hitsounds",
Bindable = config.GetBindable<bool>(GameSetting.BeatmapHitsounds) Bindable = config.GetBindable<bool>(OsuSetting.BeatmapHitsounds)
}, },
}; };
skins.ItemAdded += itemAdded; skins.ItemAdded += itemAdded;
skins.ItemRemoved += itemRemoved; skins.ItemRemoved += itemRemoved;
config.BindWith(GameSetting.Skin, configBindable); config.BindWith(OsuSetting.Skin, configBindable);
skinDropdown.Bindable = dropdownBindable; skinDropdown.Bindable = dropdownBindable;
skinDropdown.Items = skins.GetAllUsableSkins().ToArray(); 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)) if (skinDropdown.Items.All(s => s.ID != configBindable.Value))
configBindable.Value = 0; configBindable.Value = 0;

View File

@ -10,6 +10,6 @@ namespace osu.Game.Rulesets.Mods
/// </summary> /// </summary>
public interface IReadFromConfig public interface IReadFromConfig
{ {
void ReadFromConfig(GameConfigManager config); void ReadFromConfig(OsuConfigManager config);
} }
} }

View File

@ -20,9 +20,9 @@ namespace osu.Game.Rulesets.Mods
protected Bindable<bool> IncreaseFirstObjectVisibility = new Bindable<bool>(); protected Bindable<bool> IncreaseFirstObjectVisibility = new Bindable<bool>();
public void ReadFromConfig(GameConfigManager config) public void ReadFromConfig(OsuConfigManager config)
{ {
IncreaseFirstObjectVisibility = config.GetBindable<bool>(GameSetting.IncreaseFirstObjectVisibility); IncreaseFirstObjectVisibility = config.GetBindable<bool>(OsuSetting.IncreaseFirstObjectVisibility);
} }
public virtual void ApplyToDrawableHitObjects(IEnumerable<DrawableHitObject> drawables) public virtual void ApplyToDrawableHitObjects(IEnumerable<DrawableHitObject> drawables)

View File

@ -248,7 +248,7 @@ namespace osu.Game.Rulesets.UI
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(GameConfigManager config) private void load(OsuConfigManager config)
{ {
KeyBindingInputManager.AddRange(new Drawable[] KeyBindingInputManager.AddRange(new Drawable[]
{ {
@ -291,7 +291,7 @@ namespace osu.Game.Rulesets.UI
/// Applies the active mods to this RulesetContainer. /// Applies the active mods to this RulesetContainer.
/// </summary> /// </summary>
/// <param name="mods"></param> /// <param name="mods"></param>
private void applyRulesetMods(IEnumerable<Mod> mods, GameConfigManager config) private void applyRulesetMods(IEnumerable<Mod> mods, OsuConfigManager config)
{ {
if (mods == null) if (mods == null)
return; return;

View File

@ -193,9 +193,9 @@ namespace osu.Game.Rulesets.UI
private Bindable<bool> mouseDisabled; private Bindable<bool> mouseDisabled;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(GameConfigManager config) private void load(OsuConfigManager config)
{ {
mouseDisabled = config.GetBindable<bool>(GameSetting.MouseDisableButtons); mouseDisabled = config.GetBindable<bool>(OsuSetting.MouseDisableButtons);
} }
protected override bool Handle(UIEvent e) protected override bool Handle(UIEvent e)

View File

@ -47,12 +47,12 @@ namespace osu.Game.Screens.Menu
private WorkingBeatmap introBeatmap; private WorkingBeatmap introBeatmap;
[BackgroundDependencyLoader] [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); this.beatmap.BindTo(beatmap);
menuVoice = config.GetBindable<bool>(GameSetting.MenuVoice); menuVoice = config.GetBindable<bool>(OsuSetting.MenuVoice);
menuMusic = config.GetBindable<bool>(GameSetting.MenuMusic); menuMusic = config.GetBindable<bool>(OsuSetting.MenuMusic);
BeatmapSetInfo setInfo = null; BeatmapSetInfo setInfo = null;

View File

@ -101,9 +101,9 @@ namespace osu.Game.Screens.Play
} }
[BackgroundDependencyLoader(true)] [BackgroundDependencyLoader(true)]
private void load(GameConfigManager config, NotificationOverlay notificationOverlay) private void load(OsuConfigManager config, NotificationOverlay notificationOverlay)
{ {
showHud = config.GetBindable<bool>(GameSetting.ShowInterface); showHud = config.GetBindable<bool>(OsuSetting.ShowInterface);
showHud.ValueChanged += hudVisibility => visibilityContainer.FadeTo(hudVisibility ? 1 : 0, duration); showHud.ValueChanged += hudVisibility => visibilityContainer.FadeTo(hudVisibility ? 1 : 0, duration);
showHud.TriggerChange(); showHud.TriggerChange();

View File

@ -49,9 +49,9 @@ namespace osu.Game.Screens.Play
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(GameConfigManager config) private void load(OsuConfigManager config)
{ {
config.BindWith(GameSetting.KeyOverlay, configVisibility); config.BindWith(OsuSetting.KeyOverlay, configVisibility);
Visible.BindValueChanged(_ => updateVisibility()); Visible.BindValueChanged(_ => updateVisibility());
configVisibility.BindValueChanged(_ => updateVisibility(), true); configVisibility.BindValueChanged(_ => updateVisibility(), true);

View File

@ -92,7 +92,7 @@ namespace osu.Game.Screens.Play
public bool LoadedBeatmapSuccessfully => RulesetContainer?.Objects.Any() == true; public bool LoadedBeatmapSuccessfully => RulesetContainer?.Objects.Any() == true;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(AudioManager audio, APIAccess api, GameConfigManager config) private void load(AudioManager audio, APIAccess api, OsuConfigManager config)
{ {
this.api = api; this.api = api;
@ -102,8 +102,8 @@ namespace osu.Game.Screens.Play
sampleRestart = audio.Sample.Get(@"Gameplay/restart"); sampleRestart = audio.Sample.Get(@"Gameplay/restart");
mouseWheelDisabled = config.GetBindable<bool>(GameSetting.MouseDisableWheel); mouseWheelDisabled = config.GetBindable<bool>(OsuSetting.MouseDisableWheel);
userAudioOffset = config.GetBindable<double>(GameSetting.AudioOffset); userAudioOffset = config.GetBindable<double>(OsuSetting.AudioOffset);
IBeatmap beatmap; IBeatmap beatmap;
@ -164,7 +164,7 @@ namespace osu.Game.Screens.Play
ScoreProcessor = RulesetContainer.CreateScoreProcessor(); ScoreProcessor = RulesetContainer.CreateScoreProcessor();
if (!ScoreProcessor.Mode.Disabled) if (!ScoreProcessor.Mode.Disabled)
config.BindWith(GameSetting.ScoreDisplayMode, ScoreProcessor.Mode); config.BindWith(OsuSetting.ScoreDisplayMode, ScoreProcessor.Mode);
Children = new Drawable[] Children = new Drawable[]
{ {

View File

@ -13,14 +13,14 @@ namespace osu.Game.Screens.Play.PlayerSettings
protected override string Title => @"discussions"; protected override string Title => @"discussions";
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(GameConfigManager config) private void load(OsuConfigManager config)
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new PlayerCheckbox new PlayerCheckbox
{ {
LabelText = "Show floating comments", LabelText = "Show floating comments",
Bindable = config.GetBindable<bool>(GameSetting.FloatingComments) Bindable = config.GetBindable<bool>(OsuSetting.FloatingComments)
}, },
new FocusedTextBox new FocusedTextBox
{ {

View File

@ -25,6 +25,6 @@ namespace osu.Game.Screens.Play.PlayerSettings
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(GameConfigManager config) => mouseButtonsCheckbox.Bindable = config.GetBindable<bool>(GameSetting.MouseDisableButtons); private void load(OsuConfigManager config) => mouseButtonsCheckbox.Bindable = config.GetBindable<bool>(OsuSetting.MouseDisableButtons);
} }
} }

View File

@ -43,13 +43,13 @@ namespace osu.Game.Screens.Play.PlayerSettings
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(GameConfigManager config) private void load(OsuConfigManager config)
{ {
dimSliderBar.Bindable = config.GetBindable<double>(GameSetting.DimLevel); dimSliderBar.Bindable = config.GetBindable<double>(OsuSetting.DimLevel);
blurSliderBar.Bindable = config.GetBindable<double>(GameSetting.BlurLevel); blurSliderBar.Bindable = config.GetBindable<double>(OsuSetting.BlurLevel);
showStoryboardToggle.Bindable = config.GetBindable<bool>(GameSetting.ShowStoryboard); showStoryboardToggle.Bindable = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
beatmapSkinsToggle.Bindable = config.GetBindable<bool>(GameSetting.BeatmapSkins); beatmapSkinsToggle.Bindable = config.GetBindable<bool>(OsuSetting.BeatmapSkins);
beatmapHitsoundsToggle.Bindable = config.GetBindable<bool>(GameSetting.BeatmapHitsounds); beatmapHitsoundsToggle.Bindable = config.GetBindable<bool>(OsuSetting.BeatmapHitsounds);
} }
} }
} }

View File

@ -33,11 +33,11 @@ namespace osu.Game.Screens.Play
#endregion #endregion
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(GameConfigManager config) private void load(OsuConfigManager config)
{ {
DimLevel = config.GetBindable<double>(GameSetting.DimLevel); DimLevel = config.GetBindable<double>(OsuSetting.DimLevel);
BlurLevel = config.GetBindable<double>(GameSetting.BlurLevel); BlurLevel = config.GetBindable<double>(OsuSetting.BlurLevel);
ShowStoryboard = config.GetBindable<bool>(GameSetting.ShowStoryboard); ShowStoryboard = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
} }
protected override void OnEntering(Screen last) protected override void OnEntering(Screen last)

View File

@ -125,10 +125,10 @@ namespace osu.Game.Screens.Select
} }
[BackgroundDependencyLoader(permitNulls: true)] [BackgroundDependencyLoader(permitNulls: true)]
private void load(GameConfigManager config) private void load(OsuConfigManager config)
{ {
config.BindWith(GameSetting.RandomSelectAlgorithm, RandomAlgorithm); config.BindWith(OsuSetting.RandomSelectAlgorithm, RandomAlgorithm);
config.BindWith(GameSetting.SongSelectRightMouseScroll, RightClickScrollingEnabled); config.BindWith(OsuSetting.SongSelectRightMouseScroll, RightClickScrollingEnabled);
RightClickScrollingEnabled.ValueChanged += v => RightMouseScrollbar = v; RightClickScrollingEnabled.ValueChanged += v => RightMouseScrollbar = v;
RightClickScrollingEnabled.TriggerChange(); RightClickScrollingEnabled.TriggerChange();

View File

@ -31,11 +31,11 @@ namespace osu.Game.Screens.Select
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colour, GameConfigManager config) private void load(OsuColour colour, OsuConfigManager config)
{ {
modsCheckbox.AccentColour = tabs.AccentColour = colour.YellowLight; modsCheckbox.AccentColour = tabs.AccentColour = colour.YellowLight;
selectedTab = config.GetBindable<BeatmapDetailTab>(GameSetting.BeatmapDetailTab); selectedTab = config.GetBindable<BeatmapDetailTab>(OsuSetting.BeatmapDetailTab);
tabs.Current.BindTo(selectedTab); tabs.Current.BindTo(selectedTab);
tabs.Current.TriggerChange(); tabs.Current.TriggerChange();

View File

@ -173,11 +173,11 @@ namespace osu.Game.Screens.Select
public readonly Box Background; public readonly Box Background;
[BackgroundDependencyLoader(permitNulls: true)] [BackgroundDependencyLoader(permitNulls: true)]
private void load(OsuColour colours, IBindable<RulesetInfo> parentRuleset, GameConfigManager config) private void load(OsuColour colours, IBindable<RulesetInfo> parentRuleset, OsuConfigManager config)
{ {
sortTabs.AccentColour = colours.GreenLight; sortTabs.AccentColour = colours.GreenLight;
showConverted = config.GetBindable<bool>(GameSetting.ShowConvertedBeatmaps); showConverted = config.GetBindable<bool>(OsuSetting.ShowConvertedBeatmaps);
showConverted.ValueChanged += val => updateCriteria(); showConverted.ValueChanged += val => updateCriteria();
ruleset.BindTo(parentRuleset); ruleset.BindTo(parentRuleset);

View File

@ -74,10 +74,10 @@ namespace osu.Game.Skinning
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(GameConfigManager config) private void load(OsuConfigManager config)
{ {
config.BindWith(GameSetting.BeatmapSkins, beatmapSkins); config.BindWith(OsuSetting.BeatmapSkins, beatmapSkins);
config.BindWith(GameSetting.BeatmapHitsounds, beatmapHitsounds); config.BindWith(OsuSetting.BeatmapHitsounds, beatmapHitsounds);
} }
protected override void LoadComplete() protected override void LoadComplete()