2019-01-24 16:43:03 +08:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
using osu.Framework.Configuration;
|
2018-05-02 18:37:47 +08:00
|
|
|
|
using osu.Framework.Configuration.Tracking;
|
2019-01-04 13:18:29 +08:00
|
|
|
|
using osu.Framework.Extensions;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
using osu.Framework.Platform;
|
|
|
|
|
using osu.Game.Overlays;
|
2018-06-08 02:17:12 +08:00
|
|
|
|
using osu.Game.Rulesets.Scoring;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
using osu.Game.Screens.Select;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Configuration
|
|
|
|
|
{
|
|
|
|
|
public class OsuConfigManager : IniConfigManager<OsuSetting>
|
|
|
|
|
{
|
|
|
|
|
protected override void InitialiseDefaults()
|
|
|
|
|
{
|
|
|
|
|
// UI/selection defaults
|
|
|
|
|
Set(OsuSetting.Ruleset, 0, 0, int.MaxValue);
|
|
|
|
|
Set(OsuSetting.Skin, 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);
|
|
|
|
|
|
|
|
|
|
Set(OsuSetting.RandomSelectAlgorithm, RandomSelectAlgorithm.RandomPermutation);
|
|
|
|
|
|
|
|
|
|
Set(OsuSetting.ChatDisplayHeight, ChatOverlay.DEFAULT_HEIGHT, 0.2, 1);
|
|
|
|
|
|
|
|
|
|
// Online settings
|
|
|
|
|
Set(OsuSetting.Username, string.Empty);
|
|
|
|
|
Set(OsuSetting.Token, string.Empty);
|
|
|
|
|
|
2019-02-22 16:51:39 +08:00
|
|
|
|
Set(OsuSetting.SavePassword, false).ValueChanged += enabled =>
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
2019-02-22 16:51:39 +08:00
|
|
|
|
if (enabled.NewValue) Set(OsuSetting.SaveUsername, true);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
};
|
|
|
|
|
|
2019-02-22 16:51:39 +08:00
|
|
|
|
Set(OsuSetting.SaveUsername, true).ValueChanged += enabled =>
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
2019-02-22 16:51:39 +08:00
|
|
|
|
if (!enabled.NewValue) Set(OsuSetting.SavePassword, false);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
};
|
|
|
|
|
|
2018-11-02 04:52:07 +08:00
|
|
|
|
Set(OsuSetting.ExternalLinkWarning, true);
|
2018-10-23 04:57:37 +08:00
|
|
|
|
|
2018-04-13 17:19:50 +08:00
|
|
|
|
// Audio
|
|
|
|
|
Set(OsuSetting.VolumeInactive, 0.25, 0, 1, 0.01);
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
Set(OsuSetting.MouseDisableButtons, false);
|
|
|
|
|
Set(OsuSetting.MouseDisableWheel, false);
|
|
|
|
|
|
|
|
|
|
// Graphics
|
|
|
|
|
Set(OsuSetting.ShowFpsDisplay, false);
|
|
|
|
|
|
|
|
|
|
Set(OsuSetting.ShowStoryboard, true);
|
2018-04-25 15:15:23 +08:00
|
|
|
|
Set(OsuSetting.BeatmapSkins, true);
|
|
|
|
|
Set(OsuSetting.BeatmapHitsounds, true);
|
|
|
|
|
|
2018-04-13 17:19:50 +08:00
|
|
|
|
Set(OsuSetting.CursorRotation, true);
|
|
|
|
|
|
|
|
|
|
Set(OsuSetting.MenuParallax, true);
|
|
|
|
|
|
|
|
|
|
Set(OsuSetting.SnakingInSliders, true);
|
|
|
|
|
Set(OsuSetting.SnakingOutSliders, true);
|
|
|
|
|
|
|
|
|
|
// Gameplay
|
|
|
|
|
Set(OsuSetting.DimLevel, 0.3, 0, 1, 0.01);
|
|
|
|
|
Set(OsuSetting.BlurLevel, 0, 0, 1, 0.01);
|
|
|
|
|
|
|
|
|
|
Set(OsuSetting.ShowInterface, true);
|
|
|
|
|
Set(OsuSetting.KeyOverlay, false);
|
|
|
|
|
|
|
|
|
|
Set(OsuSetting.FloatingComments, false);
|
|
|
|
|
|
2018-06-08 02:17:12 +08:00
|
|
|
|
Set(OsuSetting.ScoreDisplayMode, ScoringMode.Standardised);
|
|
|
|
|
|
2018-04-25 16:15:53 +08:00
|
|
|
|
Set(OsuSetting.IncreaseFirstObjectVisibility, true);
|
|
|
|
|
|
2018-04-13 17:19:50 +08:00
|
|
|
|
// Update
|
|
|
|
|
Set(OsuSetting.ReleaseStream, ReleaseStream.Lazer);
|
|
|
|
|
|
|
|
|
|
Set(OsuSetting.Version, string.Empty);
|
|
|
|
|
|
|
|
|
|
Set(OsuSetting.ScreenshotFormat, ScreenshotFormat.Jpg);
|
2018-04-13 20:13:09 +08:00
|
|
|
|
Set(OsuSetting.ScreenshotCaptureMenuCursor, false);
|
2018-04-13 18:50:37 +08:00
|
|
|
|
|
2018-04-18 18:26:54 +08:00
|
|
|
|
Set(OsuSetting.SongSelectRightMouseScroll, false);
|
2019-01-04 12:29:37 +08:00
|
|
|
|
|
|
|
|
|
Set(OsuSetting.Scaling, ScalingMode.Off);
|
|
|
|
|
|
|
|
|
|
Set(OsuSetting.ScalingSizeX, 0.8f, 0.2f, 1f);
|
|
|
|
|
Set(OsuSetting.ScalingSizeY, 0.8f, 0.2f, 1f);
|
|
|
|
|
|
|
|
|
|
Set(OsuSetting.ScalingPositionX, 0.5f, 0f, 1f);
|
|
|
|
|
Set(OsuSetting.ScalingPositionY, 0.5f, 0f, 1f);
|
2019-01-09 18:01:33 +08:00
|
|
|
|
|
|
|
|
|
Set(OsuSetting.UIScale, 1f, 0.8f, 1.6f, 0.01f);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
2019-01-04 13:18:29 +08:00
|
|
|
|
public OsuConfigManager(Storage storage)
|
|
|
|
|
: base(storage)
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
}
|
2018-05-02 18:37:47 +08:00
|
|
|
|
|
2019-01-04 14:34:32 +08:00
|
|
|
|
public override TrackedSettings CreateTrackedSettings() => new TrackedSettings
|
|
|
|
|
{
|
|
|
|
|
new TrackedSetting<bool>(OsuSetting.MouseDisableButtons, v => new SettingDescription(!v, "gameplay mouse buttons", v ? "disabled" : "enabled")),
|
|
|
|
|
new TrackedSetting<ScalingMode>(OsuSetting.Scaling, m => new SettingDescription(m, "scaling", m.GetDescription())),
|
|
|
|
|
};
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public enum OsuSetting
|
|
|
|
|
{
|
|
|
|
|
Ruleset,
|
|
|
|
|
Token,
|
|
|
|
|
MenuCursorSize,
|
|
|
|
|
GameplayCursorSize,
|
|
|
|
|
AutoCursorSize,
|
|
|
|
|
DimLevel,
|
|
|
|
|
BlurLevel,
|
|
|
|
|
ShowStoryboard,
|
|
|
|
|
KeyOverlay,
|
|
|
|
|
FloatingComments,
|
|
|
|
|
ShowInterface,
|
|
|
|
|
MouseDisableButtons,
|
|
|
|
|
MouseDisableWheel,
|
|
|
|
|
AudioOffset,
|
|
|
|
|
VolumeInactive,
|
|
|
|
|
MenuMusic,
|
|
|
|
|
MenuVoice,
|
|
|
|
|
CursorRotation,
|
|
|
|
|
MenuParallax,
|
|
|
|
|
BeatmapDetailTab,
|
|
|
|
|
Username,
|
|
|
|
|
ReleaseStream,
|
|
|
|
|
SavePassword,
|
|
|
|
|
SaveUsername,
|
|
|
|
|
DisplayStarsMinimum,
|
|
|
|
|
DisplayStarsMaximum,
|
|
|
|
|
RandomSelectAlgorithm,
|
|
|
|
|
SnakingInSliders,
|
|
|
|
|
SnakingOutSliders,
|
|
|
|
|
ShowFpsDisplay,
|
|
|
|
|
ChatDisplayHeight,
|
|
|
|
|
Version,
|
|
|
|
|
ShowConvertedBeatmaps,
|
|
|
|
|
Skin,
|
2018-04-13 18:50:37 +08:00
|
|
|
|
ScreenshotFormat,
|
2018-04-18 17:10:40 +08:00
|
|
|
|
ScreenshotCaptureMenuCursor,
|
2018-04-20 23:17:57 +08:00
|
|
|
|
SongSelectRightMouseScroll,
|
2018-04-25 15:15:23 +08:00
|
|
|
|
BeatmapSkins,
|
2018-04-25 16:15:53 +08:00
|
|
|
|
BeatmapHitsounds,
|
2018-06-08 02:17:12 +08:00
|
|
|
|
IncreaseFirstObjectVisibility,
|
2018-10-23 04:57:37 +08:00
|
|
|
|
ScoreDisplayMode,
|
2019-01-04 12:29:37 +08:00
|
|
|
|
ExternalLinkWarning,
|
|
|
|
|
Scaling,
|
|
|
|
|
ScalingPositionX,
|
|
|
|
|
ScalingPositionY,
|
|
|
|
|
ScalingSizeX,
|
2019-01-09 18:01:33 +08:00
|
|
|
|
ScalingSizeY,
|
|
|
|
|
UIScale
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
}
|