1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-17 21:12:55 +08:00
osu-lazer/osu.Game/Configuration/OsuConfigManager.cs

111 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
{
2017-05-15 09:56:27 +08:00
public class OsuConfigManager : ConfigManager<OsuSetting>
2016-08-26 11:28:23 +08:00
{
protected override void InitialiseDefaults()
{
// UI/selection defaults
2017-05-15 09:56:27 +08:00
Set(OsuSetting.Ruleset, 0, 0, int.MaxValue);
Set(OsuSetting.BeatmapDetailTab, BeatmapDetailTab.Details);
2017-05-15 09:56:27 +08:00
Set(OsuSetting.DisplayStarsMinimum, 0.0, 0, 10);
Set(OsuSetting.DisplayStarsMaximum, 10.0, 0, 10);
2017-05-15 09:56:27 +08:00
Set(OsuSetting.ChatDisplayHeight, ChatOverlay.DEFAULT_HEIGHT, 0.2, 1);
// Online settings
2017-05-15 09:56:27 +08:00
Set(OsuSetting.Username, string.Empty);
Set(OsuSetting.Token, string.Empty);
2017-05-15 09:56:27 +08:00
Set(OsuSetting.SavePassword, false).ValueChanged += val =>
{
2017-05-15 09:56:27 +08:00
if (val) Set(OsuSetting.SaveUsername, true);
};
2017-05-15 09:56:27 +08:00
Set(OsuSetting.SaveUsername, true).ValueChanged += val =>
{
2017-05-15 09:56:27 +08:00
if (!val) Set(OsuSetting.SavePassword, false);
};
// Audio
2017-04-15 04:52:46 +08:00
2017-05-15 09:56:27 +08:00
Set(OsuSetting.MenuVoice, true);
Set(OsuSetting.MenuMusic, true);
2017-05-15 09:56:27 +08:00
Set(OsuSetting.AudioOffset, 0, -500.0, 500.0);
// Input
2017-05-15 09:56:27 +08:00
Set(OsuSetting.MenuCursorSize, 1.0, 0.5f, 2);
Set(OsuSetting.GameplayCursorSize, 1.0, 0.5f, 2);
Set(OsuSetting.AutoCursorSize, false);
2017-05-15 09:56:27 +08:00
Set(OsuSetting.MouseDisableButtons, false);
Set(OsuSetting.MouseDisableWheel, false);
// Graphics
2017-05-15 09:56:27 +08:00
Set(OsuSetting.ShowFpsDisplay, false);
2017-05-15 09:56:27 +08:00
Set(OsuSetting.MenuParallax, true);
2017-03-01 18:22:01 +08:00
2017-05-15 09:56:27 +08:00
Set(OsuSetting.SnakingInSliders, true);
Set(OsuSetting.SnakingOutSliders, true);
// Gameplay
2017-05-15 09:56:27 +08:00
Set(OsuSetting.DimLevel, 0.3, 0, 1);
2017-05-15 09:56:27 +08:00
Set(OsuSetting.ShowInterface, true);
Set(OsuSetting.KeyOverlay, false);
// Update
2017-05-15 09:56:27 +08:00
Set(OsuSetting.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
}
2017-05-15 09:56:27 +08:00
public enum OsuSetting
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,
2017-05-13 08:46:37 +08:00
AutoCursorSize,
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,
ReleaseStream,
SavePassword,
SaveUsername,
DisplayStarsMinimum,
DisplayStarsMaximum,
SnakingInSliders,
SnakingOutSliders,
ShowFpsDisplay,
ChatDisplayHeight
2016-08-26 11:28:23 +08:00
}
}