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

125 lines
3.7 KiB
C#
Raw Normal View History

2018-01-05 19:21:19 +08:00
// Copyright (c) 2007-2018 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 : IniConfigManager<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);
Set(OsuSetting.ShowConvertedBeatmaps, true);
Set(OsuSetting.DisplayStarsMinimum, 0.0, 0, 10, 0.1);
Set(OsuSetting.DisplayStarsMaximum, 10.0, 0, 10, 0.1);
2017-12-13 17:10:32 +08:00
Set(OsuSetting.RandomSelectAlgorithm, RandomSelectAlgorithm.RandomPermutation);
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-05-15 09:56:27 +08:00
Set(OsuSetting.MenuVoice, true);
Set(OsuSetting.MenuMusic, true);
Set(OsuSetting.AudioOffset, 0, -500.0, 500.0, 1);
// Input
Set(OsuSetting.MenuCursorSize, 1.0, 0.5f, 2, 0.01);
Set(OsuSetting.GameplayCursorSize, 1.0, 0.5f, 2, 0.01);
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-09-14 21:44:36 +08:00
Set(OsuSetting.ShowStoryboard, true);
2017-09-17 06:47:55 +08:00
Set(OsuSetting.CursorRotation, true);
2017-09-14 21:44:36 +08:00
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
Set(OsuSetting.DimLevel, 0.3, 0, 1, 0.01);
2017-12-26 09:11:49 +08:00
Set(OsuSetting.BlurLevel, 0, 0, 1, 0.01);
2017-05-15 09:56:27 +08:00
Set(OsuSetting.ShowInterface, true);
Set(OsuSetting.KeyOverlay, false);
2017-05-17 20:39:26 +08:00
Set(OsuSetting.FloatingComments, false);
Set(OsuSetting.SpeedChangeVisualisation, SpeedChangeVisualisationMethod.Sequential);
// Update
2017-05-15 09:56:27 +08:00
Set(OsuSetting.ReleaseStream, ReleaseStream.Lazer);
Set(OsuSetting.Version, string.Empty);
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,
2017-12-26 09:11:49 +08:00
BlurLevel,
2017-09-14 21:44:36 +08:00
ShowStoryboard,
2016-11-03 07:37:52 +08:00
KeyOverlay,
2017-05-17 20:39:26 +08:00
FloatingComments,
2016-11-03 07:37:52 +08:00
ShowInterface,
MouseDisableButtons,
MouseDisableWheel,
AudioOffset,
2016-11-03 07:37:52 +08:00
MenuMusic,
MenuVoice,
2017-09-17 06:47:55 +08:00
CursorRotation,
2016-11-03 07:37:52 +08:00
MenuParallax,
BeatmapDetailTab,
2016-11-03 07:37:52 +08:00
Username,
ReleaseStream,
SavePassword,
SaveUsername,
DisplayStarsMinimum,
DisplayStarsMaximum,
2017-12-13 17:10:32 +08:00
RandomSelectAlgorithm,
SnakingInSliders,
SnakingOutSliders,
ShowFpsDisplay,
ChatDisplayHeight,
Version,
ShowConvertedBeatmaps,
SpeedChangeVisualisation
2016-08-26 11:28:23 +08:00
}
}