2017-02-07 12:59:30 +08:00
|
|
|
|
// 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;
|
2016-11-01 02:44:20 +08:00
|
|
|
|
using osu.Framework.Platform;
|
2017-05-12 12:54:02 +08:00
|
|
|
|
using osu.Game.Overlays;
|
2017-04-24 18:25:27 +08:00
|
|
|
|
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()
|
|
|
|
|
{
|
2017-05-02 16:45:22 +08:00
|
|
|
|
// 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-02 16:45:22 +08:00
|
|
|
|
|
2017-05-15 09:56:27 +08:00
|
|
|
|
Set(OsuSetting.DisplayStarsMinimum, 0.0, 0, 10);
|
|
|
|
|
Set(OsuSetting.DisplayStarsMaximum, 10.0, 0, 10);
|
2017-05-02 18:40:30 +08:00
|
|
|
|
|
2017-06-01 14:54:48 +08:00
|
|
|
|
Set(OsuSetting.SelectionRandomType, SelectionRandomType.RandomPermutation);
|
2017-06-01 00:41:15 +08:00
|
|
|
|
|
2017-05-15 09:56:27 +08:00
|
|
|
|
Set(OsuSetting.ChatDisplayHeight, ChatOverlay.DEFAULT_HEIGHT, 0.2, 1);
|
2017-05-12 12:54:02 +08:00
|
|
|
|
|
2017-05-02 16:45:22 +08:00
|
|
|
|
// Online settings
|
2017-04-06 16:21:18 +08:00
|
|
|
|
|
2017-05-15 09:56:27 +08:00
|
|
|
|
Set(OsuSetting.Username, string.Empty);
|
|
|
|
|
Set(OsuSetting.Token, string.Empty);
|
2016-10-04 16:15:03 +08:00
|
|
|
|
|
2017-05-15 09:56:27 +08:00
|
|
|
|
Set(OsuSetting.SavePassword, false).ValueChanged += val =>
|
2017-05-02 16:45:22 +08:00
|
|
|
|
{
|
2017-05-15 09:56:27 +08:00
|
|
|
|
if (val) Set(OsuSetting.SaveUsername, true);
|
2017-05-02 16:45:22 +08:00
|
|
|
|
};
|
|
|
|
|
|
2017-05-15 09:56:27 +08:00
|
|
|
|
Set(OsuSetting.SaveUsername, true).ValueChanged += val =>
|
2017-05-02 16:45:22 +08:00
|
|
|
|
{
|
2017-05-15 09:56:27 +08:00
|
|
|
|
if (!val) Set(OsuSetting.SavePassword, false);
|
2017-05-02 16:45:22 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 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-02 16:45:22 +08:00
|
|
|
|
|
2017-05-15 09:56:27 +08:00
|
|
|
|
Set(OsuSetting.AudioOffset, 0, -500.0, 500.0);
|
2017-05-02 16:45:22 +08:00
|
|
|
|
|
|
|
|
|
// Input
|
2017-02-13 23:35:24 +08:00
|
|
|
|
|
2017-05-15 09:56:27 +08:00
|
|
|
|
Set(OsuSetting.MenuCursorSize, 1.0, 0.5f, 2);
|
|
|
|
|
Set(OsuSetting.GameplayCursorSize, 1.0, 0.5f, 2);
|
2017-05-15 11:21:43 +08:00
|
|
|
|
Set(OsuSetting.AutoCursorSize, false);
|
2017-02-13 23:35:24 +08:00
|
|
|
|
|
2017-05-15 09:56:27 +08:00
|
|
|
|
Set(OsuSetting.MouseDisableButtons, false);
|
|
|
|
|
Set(OsuSetting.MouseDisableWheel, false);
|
2017-02-13 23:35:24 +08:00
|
|
|
|
|
2017-05-02 16:45:22 +08:00
|
|
|
|
// Graphics
|
2017-02-13 23:35:24 +08:00
|
|
|
|
|
2017-05-15 09:56:27 +08:00
|
|
|
|
Set(OsuSetting.ShowFpsDisplay, false);
|
2017-05-03 19:34:53 +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);
|
2017-04-25 11:48:25 +08:00
|
|
|
|
|
2017-05-02 17:40:30 +08:00
|
|
|
|
// Gameplay
|
2017-05-02 16:45:22 +08:00
|
|
|
|
|
2017-05-15 09:56:27 +08:00
|
|
|
|
Set(OsuSetting.DimLevel, 0.3, 0, 1);
|
2017-04-24 18:25:27 +08:00
|
|
|
|
|
2017-05-15 09:56:27 +08:00
|
|
|
|
Set(OsuSetting.ShowInterface, true);
|
|
|
|
|
Set(OsuSetting.KeyOverlay, false);
|
2017-02-13 23:35:24 +08:00
|
|
|
|
|
2017-05-17 20:39:26 +08:00
|
|
|
|
Set(OsuSetting.FloatingComments, false);
|
2017-05-17 21:10:49 +08:00
|
|
|
|
Set(OsuSetting.PlaybackSpeed, 1.0, 0.5f, 2);
|
2017-05-17 20:39:26 +08:00
|
|
|
|
|
2017-05-02 17:40:30 +08:00
|
|
|
|
// Update
|
|
|
|
|
|
2017-05-15 09:56:27 +08:00
|
|
|
|
Set(OsuSetting.ReleaseStream, ReleaseStream.Lazer);
|
2017-01-28 18:10:05 +08:00
|
|
|
|
}
|
2016-11-01 02:44:20 +08:00
|
|
|
|
|
2017-02-23 14:38:17 +08:00
|
|
|
|
public OsuConfigManager(Storage storage) : base(storage)
|
2016-11-01 02:44:20 +08:00
|
|
|
|
{
|
|
|
|
|
}
|
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,
|
2017-03-18 01:40:03 +08:00
|
|
|
|
GameplayCursorSize,
|
2017-05-13 08:46:37 +08:00
|
|
|
|
AutoCursorSize,
|
2016-11-03 07:37:52 +08:00
|
|
|
|
DimLevel,
|
|
|
|
|
KeyOverlay,
|
2017-05-17 20:39:26 +08:00
|
|
|
|
FloatingComments,
|
2017-05-17 21:10:49 +08:00
|
|
|
|
PlaybackSpeed,
|
2016-11-03 07:37:52 +08:00
|
|
|
|
ShowInterface,
|
|
|
|
|
MouseDisableButtons,
|
|
|
|
|
MouseDisableWheel,
|
2017-04-21 15:19:40 +08:00
|
|
|
|
AudioOffset,
|
2016-11-03 07:37:52 +08:00
|
|
|
|
MenuMusic,
|
|
|
|
|
MenuVoice,
|
|
|
|
|
MenuParallax,
|
2017-04-24 18:25:27 +08:00
|
|
|
|
BeatmapDetailTab,
|
2016-11-03 07:37:52 +08:00
|
|
|
|
Username,
|
|
|
|
|
ReleaseStream,
|
|
|
|
|
SavePassword,
|
|
|
|
|
SaveUsername,
|
2017-05-02 18:40:30 +08:00
|
|
|
|
DisplayStarsMinimum,
|
|
|
|
|
DisplayStarsMaximum,
|
2017-06-01 00:41:15 +08:00
|
|
|
|
SelectionRandomType,
|
2017-05-02 18:40:30 +08:00
|
|
|
|
SnakingInSliders,
|
2017-05-03 19:34:53 +08:00
|
|
|
|
SnakingOutSliders,
|
2017-05-12 12:54:02 +08:00
|
|
|
|
ShowFpsDisplay,
|
|
|
|
|
ChatDisplayHeight
|
2016-08-26 11:28:23 +08:00
|
|
|
|
}
|
|
|
|
|
}
|