1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 03:27:24 +08:00
osu-lazer/osu.Game/Configuration/OsuConfigManager.cs

112 lines
3.0 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 11:28:23 +08:00
using osu.Framework.Configuration;
using osu.Framework.Platform;
using osu.Game.Overlays;
using osu.Game.Screens.Select;
2016-08-26 11:28:23 +08:00
namespace osu.Game.Configuration
{
public class OsuConfigManager : ConfigManager<OsuConfig>
2016-08-26 11:28:23 +08: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);
Set(OsuConfig.ChatDisplayHeight, ChatOverlay.DEFAULT_HEIGHT, 0.2, 1);
// Online settings
2016-08-31 18:49:34 +08: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-15 04:52:46 +08: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-22 00:16:23 +08:00
Set(OsuConfig.MenuCursorSize, 1.0, 0.5f, 2);
Set(OsuConfig.GameplayCursorSize, 1.0, 0.5f, 2);
2016-11-03 07:47:54 +08:00
Set(OsuConfig.MouseDisableButtons, false);
2017-02-28 07:08:34 +08:00
Set(OsuConfig.MouseDisableWheel, false);
// Graphics
Set(OsuConfig.ShowFpsDisplay, false);
2017-02-19 04:34:21 +08:00
Set(OsuConfig.MenuParallax, true);
2017-03-01 18:22:01 +08:00
Set(OsuConfig.SnakingInSliders, true);
Set(OsuConfig.SnakingOutSliders, true);
// Gameplay
Set(OsuConfig.DimLevel, 0.3, 0, 1);
2017-03-31 21:43:31 +08:00
Set(OsuConfig.ShowInterface, true);
2017-04-05 00:06:53 +08:00
Set(OsuConfig.KeyOverlay, false);
// Update
Set(OsuConfig.ReleaseStream, ReleaseStream.Lazer);
2017-01-28 18:10:05 +08:00
}
2017-02-23 14:38:17 +08:00
public OsuConfigManager(Storage storage) : base(storage)
{
}
2016-08-26 11:28:23 +08:00
}
public enum OsuConfig
2016-08-26 11:28:23 +08:00
{
2017-04-15 04:22:41 +08:00
Ruleset,
2016-11-03 07:37:52 +08:00
Token,
2017-03-22 00:16:23 +08:00
MenuCursorSize,
GameplayCursorSize,
2016-11-03 07:37:52 +08:00
DimLevel,
KeyOverlay,
ShowInterface,
MouseDisableButtons,
MouseDisableWheel,
AudioOffset,
2016-11-03 07:37:52 +08:00
MenuMusic,
MenuVoice,
MenuParallax,
BeatmapDetailTab,
2016-11-03 07:37:52 +08:00
Username,
AudioDevice,
ReleaseStream,
SavePassword,
SaveUsername,
DisplayStarsMinimum,
DisplayStarsMaximum,
SnakingInSliders,
SnakingOutSliders,
ShowFpsDisplay,
ChatDisplayHeight
2016-08-26 11:28:23 +08:00
}
}