osu/osu.Game/Configuration/OsuConfigManager.cs

131 lines
3.9 KiB
C#
Raw Normal View History

2018-01-05 11:21:19 +00: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 03:28:23 +00:00
using osu.Framework.Configuration;
using osu.Framework.Platform;
using osu.Game.Overlays;
using osu.Game.Screens.Select;
2016-08-26 03:28:23 +00:00
namespace osu.Game.Configuration
{
public class OsuConfigManager : IniConfigManager<OsuSetting>
2016-08-26 03:28:23 +00:00
{
protected override void InitialiseDefaults()
{
// UI/selection defaults
2017-05-15 01:56:27 +00:00
Set(OsuSetting.Ruleset, 0, 0, int.MaxValue);
2018-02-22 07:29:05 +00:00
Set(OsuSetting.Skin, 0, 0, int.MaxValue);
2017-05-15 01:56:27 +00:00
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 09:10:32 +00:00
Set(OsuSetting.RandomSelectAlgorithm, RandomSelectAlgorithm.RandomPermutation);
Set(OsuSetting.ChatDisplayHeight, ChatOverlay.DEFAULT_HEIGHT, 0.2, 1);
// Online settings
2017-05-15 01:56:27 +00:00
Set(OsuSetting.Username, string.Empty);
Set(OsuSetting.Token, string.Empty);
2017-05-15 01:56:27 +00:00
Set(OsuSetting.SavePassword, false).ValueChanged += val =>
{
2017-05-15 01:56:27 +00:00
if (val) Set(OsuSetting.SaveUsername, true);
};
2017-05-15 01:56:27 +00:00
Set(OsuSetting.SaveUsername, true).ValueChanged += val =>
{
2017-05-15 01:56:27 +00:00
if (!val) Set(OsuSetting.SavePassword, false);
};
// Audio
Set(OsuSetting.VolumeInactive, 0.25, 0, 1, 0.01);
2017-05-15 01:56:27 +00: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 01:56:27 +00:00
Set(OsuSetting.MouseDisableButtons, false);
Set(OsuSetting.MouseDisableWheel, false);
// Graphics
2017-05-15 01:56:27 +00:00
Set(OsuSetting.ShowFpsDisplay, false);
2017-09-14 13:44:36 +00:00
Set(OsuSetting.ShowStoryboard, true);
2017-09-16 22:47:55 +00:00
Set(OsuSetting.CursorRotation, true);
2017-09-14 13:44:36 +00:00
2017-05-15 01:56:27 +00:00
Set(OsuSetting.MenuParallax, true);
2017-03-01 10:22:01 +00:00
2017-05-15 01:56:27 +00:00
Set(OsuSetting.SnakingInSliders, true);
Set(OsuSetting.SnakingOutSliders, true);
// Gameplay
Set(OsuSetting.DimLevel, 0.3, 0, 1, 0.01);
2017-12-26 01:11:49 +00:00
Set(OsuSetting.BlurLevel, 0, 0, 1, 0.01);
2017-05-15 01:56:27 +00:00
Set(OsuSetting.ShowInterface, true);
Set(OsuSetting.KeyOverlay, false);
2017-05-17 12:39:26 +00:00
Set(OsuSetting.FloatingComments, false);
Set(OsuSetting.SpeedChangeVisualisation, SpeedChangeVisualisationMethod.Sequential);
// Update
2017-05-15 01:56:27 +00:00
Set(OsuSetting.ReleaseStream, ReleaseStream.Lazer);
Set(OsuSetting.Version, string.Empty);
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
}
2017-05-15 01:56:27 +00:00
public enum OsuSetting
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,
2017-05-13 00:46:37 +00:00
AutoCursorSize,
2016-11-02 23:37:52 +00:00
DimLevel,
2017-12-26 01:11:49 +00:00
BlurLevel,
2017-09-14 13:44:36 +00:00
ShowStoryboard,
2016-11-02 23:37:52 +00:00
KeyOverlay,
2017-05-17 12:39:26 +00:00
FloatingComments,
2016-11-02 23:37:52 +00:00
ShowInterface,
MouseDisableButtons,
MouseDisableWheel,
AudioOffset,
VolumeInactive,
2016-11-02 23:37:52 +00:00
MenuMusic,
MenuVoice,
2017-09-16 22:47:55 +00:00
CursorRotation,
2016-11-02 23:37:52 +00:00
MenuParallax,
BeatmapDetailTab,
2016-11-02 23:37:52 +00:00
Username,
ReleaseStream,
SavePassword,
SaveUsername,
DisplayStarsMinimum,
DisplayStarsMaximum,
2017-12-13 09:10:32 +00:00
RandomSelectAlgorithm,
SnakingInSliders,
SnakingOutSliders,
ShowFpsDisplay,
ChatDisplayHeight,
Version,
ShowConvertedBeatmaps,
2018-02-22 07:29:05 +00:00
SpeedChangeVisualisation,
Skin
2016-08-26 03:28:23 +00:00
}
}