1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 22:02:56 +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
{
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<string>(GameSetting.Version);
var lastVersion = config.Get<string>(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))

View File

@ -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);
}
}
}

View File

@ -8,9 +8,9 @@ using osu.Game.Rulesets.Mania.UI;
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)
{
}
@ -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<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,
ScrollDirection

View File

@ -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);

View File

@ -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<ManiaScrollingDirection>
{
LabelText = "Scrolling direction",
Bindable = config.GetBindable<ManiaScrollingDirection>(ManiaSetting.ScrollDirection)
Bindable = config.GetBindable<ManiaScrollingDirection>(ManiaRulesetSetting.ScrollDirection)
},
new SettingsSlider<double, TimeSlider>
{
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;
protected new ManiaConfigManager Config => (ManiaConfigManager)base.Config;
protected new ManiaRulesetConfigManager Config => (ManiaRulesetConfigManager)base.Config;
private readonly Bindable<ManiaScrollingDirection> configDirection = new Bindable<ManiaScrollingDirection>();
@ -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);
}
/// <summary>

View File

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

View File

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

View File

@ -6,9 +6,9 @@ using osu.Game.Rulesets.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)
{
}
@ -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

View File

@ -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 =>

View File

@ -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)

View File

@ -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<double>(GameSetting.GameplayCursorSize);
cursorScale = config.GetBindable<double>(OsuSetting.GameplayCursorSize);
cursorScale.ValueChanged += v => calculateScale();
autoCursorScale = config.GetBindable<bool>(GameSetting.AutoCursorSize);
autoCursorScale = config.GetBindable<bool>(OsuSetting.AutoCursorSize);
autoCursorScale.ValueChanged += v => calculateScale();
calculateScale();

View File

@ -21,7 +21,7 @@ namespace osu.Game.Rulesets.Osu.UI
{
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)
: 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]
private void load()
{
var config = (OsuConfigManager)Config;
var config = (OsuRulesetConfigManager)Config;
Children = new Drawable[]
{
new SettingsCheckbox
{
LabelText = "Snaking in sliders",
Bindable = config.GetBindable<bool>(OsuSetting.SnakingInSliders)
Bindable = config.GetBindable<bool>(OsuRulesetSetting.SnakingInSliders)
},
new SettingsCheckbox
{
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.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,

View File

@ -40,9 +40,9 @@ namespace osu.Game.Graphics.Containers
protected override Container<Drawable> Content => content;
[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
{
if (!parallaxEnabled)

View File

@ -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<float>(GameSetting.UIScale);
uiScale = gameConfig.GetBindable<float>(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<ScalingMode>(GameSetting.Scaling);
scalingMode = config.GetBindable<ScalingMode>(OsuSetting.Scaling);
scalingMode.ValueChanged += _ => updateSize();
sizeX = config.GetBindable<float>(GameSetting.ScalingSizeX);
sizeX = config.GetBindable<float>(OsuSetting.ScalingSizeX);
sizeX.ValueChanged += _ => updateSize();
sizeY = config.GetBindable<float>(GameSetting.ScalingSizeY);
sizeY = config.GetBindable<float>(OsuSetting.ScalingSizeY);
sizeY.ValueChanged += _ => updateSize();
posX = config.GetBindable<float>(GameSetting.ScalingPositionX);
posX = config.GetBindable<float>(OsuSetting.ScalingPositionX);
posX.ValueChanged += _ => updateSize();
posY = config.GetBindable<float>(GameSetting.ScalingPositionY);
posY = config.GetBindable<float>(OsuSetting.ScalingPositionY);
posY.ValueChanged += _ => updateSize();
}

View File

@ -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<bool>(GameSetting.CursorRotation);
cursorRotate = config.GetBindable<bool>(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<double>(GameSetting.MenuCursorSize);
cursorScale = config.GetBindable<double>(OsuSetting.MenuCursorSize);
cursorScale.ValueChanged += newScale => cursorContainer.Scale = new Vector2((float)newScale * base_scale);
cursorScale.TriggerChange();
}

View File

@ -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<ScreenshotFormat>(GameSetting.ScreenshotFormat);
captureMenuCursor = config.GetBindable<bool>(GameSetting.ScreenshotCaptureMenuCursor);
screenshotFormat = config.GetBindable<ScreenshotFormat>(OsuSetting.ScreenshotFormat);
captureMenuCursor = config.GetBindable<bool>(OsuSetting.ScreenshotCaptureMenuCursor);
shutter = audio.Sample.Get("UI/shutter");
}

View File

@ -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<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;
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<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>();
@ -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<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))
{

View File

@ -18,11 +18,11 @@ namespace osu.Game.Online.Chat
private Bindable<bool> 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<bool>(GameSetting.ExternalLinkWarning);
externalLinkWarning = config.GetBindable<bool>(OsuSetting.ExternalLinkWarning);
}
public void OpenUrlExternally(string url)

View File

@ -174,17 +174,17 @@ namespace osu.Game
dependencies.CacheAs<IBindable<RulesetInfo>>(ruleset);
// 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.ValueChanged += r => configRuleset.Value = r.ID ?? 0;
// 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;
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<bool>(GameSetting.MouseDisableButtons));
LocalConfig.Set(OsuSetting.MouseDisableButtons, !LocalConfig.Get<bool>(OsuSetting.MouseDisableButtons));
return true;
}

View File

@ -43,7 +43,7 @@ namespace osu.Game
/// </summary>
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<bool>(GameSetting.ShowFpsDisplay);
fpsDisplayVisible = LocalConfig.GetBindable<bool>(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);
}

View File

@ -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<double>(GameSetting.ChatDisplayHeight);
ChatHeight = config.GetBindable<double>(OsuSetting.ChatDisplayHeight);
ChatHeight.ValueChanged += h =>
{
chatContainer.Height = (float)h;

View File

@ -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);

View File

@ -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<bool>(GameSetting.MenuVoice)
Bindable = config.GetBindable<bool>(OsuSetting.MenuVoice)
},
new SettingsCheckbox
{
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";
[BackgroundDependencyLoader]
private void load(GameConfigManager config)
private void load(OsuConfigManager config)
{
Children = new Drawable[]
{
new SettingsSlider<double, OffsetSlider>
{
LabelText = "Audio offset",
Bindable = config.GetBindable<double>(GameSetting.AudioOffset),
Bindable = config.GetBindable<double>(OsuSetting.AudioOffset),
KeyboardStep = 1f
},
new SettingsButton

View File

@ -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<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 = "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";
[BackgroundDependencyLoader]
private void load(GameConfigManager config)
private void load(OsuConfigManager config)
{
Children = new Drawable[]
{
new SettingsSlider<double>
{
LabelText = "Background dim",
Bindable = config.GetBindable<double>(GameSetting.DimLevel),
Bindable = config.GetBindable<double>(OsuSetting.DimLevel),
KeyboardStep = 0.01f
},
new SettingsSlider<double>
{
LabelText = "Background blur",
Bindable = config.GetBindable<double>(GameSetting.BlurLevel),
Bindable = config.GetBindable<double>(OsuSetting.BlurLevel),
KeyboardStep = 0.01f
},
new SettingsCheckbox
{
LabelText = "Show score overlay",
Bindable = config.GetBindable<bool>(GameSetting.ShowInterface)
Bindable = config.GetBindable<bool>(OsuSetting.ShowInterface)
},
new SettingsCheckbox
{
LabelText = "Always show key overlay",
Bindable = config.GetBindable<bool>(GameSetting.KeyOverlay)
Bindable = config.GetBindable<bool>(OsuSetting.KeyOverlay)
},
new SettingsEnumDropdown<ScoringMode>
{
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";
[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<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";
[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<bool>(GameSetting.SongSelectRightMouseScroll),
Bindable = config.GetBindable<bool>(OsuSetting.SongSelectRightMouseScroll),
},
new SettingsCheckbox
{
LabelText = "Show converted beatmaps",
Bindable = config.GetBindable<bool>(GameSetting.ShowConvertedBeatmaps),
Bindable = config.GetBindable<bool>(OsuSetting.ShowConvertedBeatmaps),
},
new SettingsSlider<double, StarSlider>
{
LabelText = "Display beatmaps from",
Bindable = config.GetBindable<double>(GameSetting.DisplayStarsMinimum),
Bindable = config.GetBindable<double>(OsuSetting.DisplayStarsMinimum),
KeyboardStep = 0.1f
},
new SettingsSlider<double, StarSlider>
{
LabelText = "up to",
Bindable = config.GetBindable<double>(GameSetting.DisplayStarsMaximum),
Bindable = config.GetBindable<double>(OsuSetting.DisplayStarsMaximum),
KeyboardStep = 0.1f
},
new SettingsEnumDropdown<RandomSelectAlgorithm>
{
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)]
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<bool>(GameSetting.SaveUsername),
Bindable = config.GetBindable<bool>(OsuSetting.SaveUsername),
},
new SettingsCheckbox
{
LabelText = "Stay signed in",
Bindable = config.GetBindable<bool>(GameSetting.SavePassword),
Bindable = config.GetBindable<bool>(OsuSetting.SavePassword),
},
new SettingsButton
{

View File

@ -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<ReleaseStream>
{
LabelText = "Release stream",
Bindable = config.GetBindable<ReleaseStream>(GameSetting.ReleaseStream),
Bindable = config.GetBindable<ReleaseStream>(OsuSetting.ReleaseStream),
},
new SettingsButton
{

View File

@ -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<bool>(GameSetting.ShowStoryboard)
Bindable = config.GetBindable<bool>(OsuSetting.ShowStoryboard)
},
new SettingsCheckbox
{
LabelText = "Rotate cursor when dragging",
Bindable = config.GetBindable<bool>(GameSetting.CursorRotation)
Bindable = config.GetBindable<bool>(OsuSetting.CursorRotation)
},
new SettingsEnumDropdown<ScreenshotFormat>
{
LabelText = "Screenshot format",
Bindable = config.GetBindable<ScreenshotFormat>(GameSetting.ScreenshotFormat)
Bindable = config.GetBindable<ScreenshotFormat>(OsuSetting.ScreenshotFormat)
},
new SettingsCheckbox
{
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;
[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<ScalingMode>(GameSetting.Scaling);
scalingMode = gameConfig.GetBindable<ScalingMode>(OsuSetting.Scaling);
sizeFullscreen = config.GetBindable<Size>(FrameworkSetting.SizeFullscreen);
scalingSizeX = gameConfig.GetBindable<float>(GameSetting.ScalingSizeX);
scalingSizeY = gameConfig.GetBindable<float>(GameSetting.ScalingSizeY);
scalingPositionX = gameConfig.GetBindable<float>(GameSetting.ScalingPositionX);
scalingPositionY = gameConfig.GetBindable<float>(GameSetting.ScalingPositionY);
scalingSizeX = gameConfig.GetBindable<float>(OsuSetting.ScalingSizeX);
scalingSizeY = gameConfig.GetBindable<float>(OsuSetting.ScalingSizeY);
scalingPositionX = gameConfig.GetBindable<float>(OsuSetting.ScalingPositionX);
scalingPositionY = gameConfig.GetBindable<float>(OsuSetting.ScalingPositionY);
Container resolutionSettingsContainer;
@ -67,13 +67,13 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
{
LabelText = "UI Scaling",
TransferValueOnCommit = true,
Bindable = gameConfig.GetBindable<float>(GameSetting.UIScale),
Bindable = gameConfig.GetBindable<float>(OsuSetting.UIScale),
KeyboardStep = 0.01f
},
new SettingsEnumDropdown<ScalingMode>
{
LabelText = "Screen Scaling",
Bindable = gameConfig.GetBindable<ScalingMode>(GameSetting.Scaling),
Bindable = gameConfig.GetBindable<ScalingMode>(OsuSetting.Scaling),
},
scalingSettings = new FillFlowContainer<SettingsSlider<float>>
{

View File

@ -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<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";
[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<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;
[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<bool>(GameSetting.MouseDisableWheel)
Bindable = gameConfig.GetBindable<bool>(OsuSetting.MouseDisableWheel)
},
new SettingsCheckbox
{
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";
[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<bool>(GameSetting.ExternalLinkWarning)
Bindable = config.GetBindable<bool>(OsuSetting.ExternalLinkWarning)
},
};
}

View File

@ -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<double, SizeSlider>
{
LabelText = "Menu cursor size",
Bindable = config.GetBindable<double>(GameSetting.MenuCursorSize),
Bindable = config.GetBindable<double>(OsuSetting.MenuCursorSize),
KeyboardStep = 0.01f
},
new SettingsSlider<double, SizeSlider>
{
LabelText = "Gameplay cursor size",
Bindable = config.GetBindable<double>(GameSetting.GameplayCursorSize),
Bindable = config.GetBindable<double>(OsuSetting.GameplayCursorSize),
KeyboardStep = 0.01f
},
new SettingsCheckbox
{
LabelText = "Adjust gameplay cursor size based on current beatmap",
Bindable = config.GetBindable<bool>(GameSetting.AutoCursorSize)
Bindable = config.GetBindable<bool>(OsuSetting.AutoCursorSize)
},
new SettingsCheckbox
{
LabelText = "Beatmap skins",
Bindable = config.GetBindable<bool>(GameSetting.BeatmapSkins)
Bindable = config.GetBindable<bool>(OsuSetting.BeatmapSkins)
},
new SettingsCheckbox
{
LabelText = "Beatmap hitsounds",
Bindable = config.GetBindable<bool>(GameSetting.BeatmapHitsounds)
Bindable = config.GetBindable<bool>(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;

View File

@ -10,6 +10,6 @@ namespace osu.Game.Rulesets.Mods
/// </summary>
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>();
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)

View File

@ -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.
/// </summary>
/// <param name="mods"></param>
private void applyRulesetMods(IEnumerable<Mod> mods, GameConfigManager config)
private void applyRulesetMods(IEnumerable<Mod> mods, OsuConfigManager config)
{
if (mods == null)
return;

View File

@ -193,9 +193,9 @@ namespace osu.Game.Rulesets.UI
private Bindable<bool> mouseDisabled;
[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)

View File

@ -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<bool>(GameSetting.MenuVoice);
menuMusic = config.GetBindable<bool>(GameSetting.MenuMusic);
menuVoice = config.GetBindable<bool>(OsuSetting.MenuVoice);
menuMusic = config.GetBindable<bool>(OsuSetting.MenuMusic);
BeatmapSetInfo setInfo = null;

View File

@ -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<bool>(GameSetting.ShowInterface);
showHud = config.GetBindable<bool>(OsuSetting.ShowInterface);
showHud.ValueChanged += hudVisibility => visibilityContainer.FadeTo(hudVisibility ? 1 : 0, duration);
showHud.TriggerChange();

View File

@ -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);

View File

@ -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<bool>(GameSetting.MouseDisableWheel);
userAudioOffset = config.GetBindable<double>(GameSetting.AudioOffset);
mouseWheelDisabled = config.GetBindable<bool>(OsuSetting.MouseDisableWheel);
userAudioOffset = config.GetBindable<double>(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[]
{

View File

@ -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<bool>(GameSetting.FloatingComments)
Bindable = config.GetBindable<bool>(OsuSetting.FloatingComments)
},
new FocusedTextBox
{

View File

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

View File

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

View File

@ -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();

View File

@ -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<BeatmapDetailTab>(GameSetting.BeatmapDetailTab);
selectedTab = config.GetBindable<BeatmapDetailTab>(OsuSetting.BeatmapDetailTab);
tabs.Current.BindTo(selectedTab);
tabs.Current.TriggerChange();

View File

@ -173,11 +173,11 @@ namespace osu.Game.Screens.Select
public readonly Box Background;
[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;
showConverted = config.GetBindable<bool>(GameSetting.ShowConvertedBeatmaps);
showConverted = config.GetBindable<bool>(OsuSetting.ShowConvertedBeatmaps);
showConverted.ValueChanged += val => updateCriteria();
ruleset.BindTo(parentRuleset);

View File

@ -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()