osu/osu.Game/Configuration/OsuConfigManager.cs

108 lines
2.8 KiB
C#
Raw Normal View History

// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
2016-08-26 03:28:23 +00:00
using osu.Framework.Configuration;
using osu.Framework.Platform;
using osu.Game.Screens.Select;
2016-08-26 03:28:23 +00:00
namespace osu.Game.Configuration
{
public class OsuConfigManager : ConfigManager<OsuConfig>
2016-08-26 03:28:23 +00:00
{
protected override void InitialiseDefaults()
{
// UI/selection defaults
Set(OsuConfig.Ruleset, 0, 0, int.MaxValue);
Set(OsuConfig.BeatmapDetailTab, BeatmapDetailTab.Details);
Set(OsuConfig.DisplayStarsMinimum, 0.0, 0, 10);
Set(OsuConfig.DisplayStarsMaximum, 10.0, 0, 10);
// Online settings
2016-08-31 10:49:34 +00:00
Set(OsuConfig.Username, string.Empty);
Set(OsuConfig.Token, string.Empty);
Set(OsuConfig.SavePassword, false).ValueChanged += val =>
{
if (val) Set(OsuConfig.SaveUsername, true);
};
Set(OsuConfig.SaveUsername, true).ValueChanged += val =>
{
if (!val) Set(OsuConfig.SavePassword, false);
};
// Audio
2017-04-14 20:52:46 +00:00
Set(OsuConfig.AudioDevice, string.Empty);
Set(OsuConfig.MenuVoice, true);
Set(OsuConfig.MenuMusic, true);
Set(OsuConfig.AudioOffset, 0, -500.0, 500.0);
// Input
2017-03-21 16:16:23 +00:00
Set(OsuConfig.MenuCursorSize, 1.0, 0.5f, 2);
Set(OsuConfig.GameplayCursorSize, 1.0, 0.5f, 2);
2016-11-02 23:47:54 +00:00
Set(OsuConfig.MouseDisableButtons, false);
2017-02-27 23:08:34 +00:00
Set(OsuConfig.MouseDisableWheel, false);
// Graphics
Set(OsuConfig.ShowFpsDisplay, false);
2017-02-18 20:34:21 +00:00
Set(OsuConfig.MenuParallax, true);
2017-03-01 10:22:01 +00:00
Set(OsuConfig.SnakingInSliders, true);
Set(OsuConfig.SnakingOutSliders, true);
// Gameplay
Set(OsuConfig.DimLevel, 0.3, 0, 1);
2017-03-31 13:43:31 +00:00
Set(OsuConfig.ShowInterface, true);
2017-04-04 16:06:53 +00:00
Set(OsuConfig.KeyOverlay, false);
// Update
Set(OsuConfig.ReleaseStream, ReleaseStream.Lazer);
2017-01-28 10:10:05 +00:00
}
2017-02-23 06:38:17 +00:00
public OsuConfigManager(Storage storage) : base(storage)
{
}
2016-08-26 03:28:23 +00:00
}
public enum OsuConfig
2016-08-26 03:28:23 +00:00
{
2017-04-14 20:22:41 +00:00
Ruleset,
2016-11-02 23:37:52 +00:00
Token,
2017-03-21 16:16:23 +00:00
MenuCursorSize,
GameplayCursorSize,
2016-11-02 23:37:52 +00:00
DimLevel,
KeyOverlay,
ShowInterface,
MouseDisableButtons,
MouseDisableWheel,
AudioOffset,
2016-11-02 23:37:52 +00:00
MenuMusic,
MenuVoice,
MenuParallax,
BeatmapDetailTab,
2016-11-02 23:37:52 +00:00
Username,
AudioDevice,
ReleaseStream,
SavePassword,
SaveUsername,
DisplayStarsMinimum,
DisplayStarsMaximum,
SnakingInSliders,
SnakingOutSliders,
ShowFpsDisplay
2016-08-26 03:28:23 +00:00
}
}