2016-08-26 11:28:23 +08:00
|
|
|
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
2016-08-26 16:27:49 +08:00
|
|
|
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
2016-08-26 11:28:23 +08:00
|
|
|
|
|
2016-12-02 06:28:20 +08:00
|
|
|
|
using System;
|
2016-08-26 11:28:23 +08:00
|
|
|
|
using osu.Framework.Configuration;
|
2016-11-01 02:44:20 +08:00
|
|
|
|
using osu.Framework.Platform;
|
2016-11-14 17:03:20 +08:00
|
|
|
|
using osu.Game.Modes;
|
2016-08-26 11:28:23 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Configuration
|
|
|
|
|
{
|
2016-12-03 20:56:19 +08:00
|
|
|
|
public class OsuConfigManager : ConfigManager<OsuConfig>
|
2016-08-26 11:28:23 +08:00
|
|
|
|
{
|
|
|
|
|
protected override void InitialiseDefaults()
|
|
|
|
|
{
|
2016-12-02 06:28:20 +08:00
|
|
|
|
#pragma warning disable CS0612 // Type or member is obsolete
|
2017-01-25 17:39:41 +08:00
|
|
|
|
|
2016-11-03 07:37:52 +08:00
|
|
|
|
Set(OsuConfig.MouseSpeed, 1.0);
|
2016-08-31 18:49:34 +08:00
|
|
|
|
|
|
|
|
|
Set(OsuConfig.Username, string.Empty);
|
|
|
|
|
Set(OsuConfig.Token, string.Empty);
|
2016-10-04 16:15:03 +08:00
|
|
|
|
|
|
|
|
|
Set(OsuConfig.PlayMode, PlayMode.Osu);
|
2016-11-03 07:47:54 +08:00
|
|
|
|
|
|
|
|
|
Set(OsuConfig.BeatmapDirectory, @"Songs"); // TODO: use this
|
2017-01-25 17:39:41 +08:00
|
|
|
|
|
2016-11-03 07:47:54 +08:00
|
|
|
|
Set(OsuConfig.AllowPublicInvites, true);
|
|
|
|
|
Set(OsuConfig.AutoChatHide, true);
|
|
|
|
|
Set(OsuConfig.AutomaticDownload, true);
|
|
|
|
|
Set(OsuConfig.AutomaticDownloadNoVideo, false);
|
|
|
|
|
Set(OsuConfig.BlockNonFriendPM, false);
|
|
|
|
|
Set(OsuConfig.BloomSoftening, false);
|
|
|
|
|
Set(OsuConfig.BossKeyFirstActivation, true);
|
|
|
|
|
Set(OsuConfig.ChatAudibleHighlight, true);
|
|
|
|
|
Set(OsuConfig.ChatChannels, string.Empty);
|
|
|
|
|
Set(OsuConfig.ChatFilter, false);
|
|
|
|
|
Set(OsuConfig.ChatHighlightName, true);
|
|
|
|
|
Set(OsuConfig.ChatMessageNotification, true);
|
|
|
|
|
Set(OsuConfig.ChatLastChannel, string.Empty);
|
|
|
|
|
Set(OsuConfig.ChatRemoveForeign, false);
|
|
|
|
|
//Set(OsuConfig.ChatSortMode, UserSortMode.Rank);
|
|
|
|
|
Set(OsuConfig.ComboBurst, true);
|
|
|
|
|
Set(OsuConfig.ComboFire, false);
|
|
|
|
|
Set(OsuConfig.ComboFireHeight, 3);
|
|
|
|
|
Set(OsuConfig.ConfirmExit, false);
|
|
|
|
|
Set(OsuConfig.AutoSendNowPlaying, true);
|
|
|
|
|
Set(OsuConfig.CursorSize, 1.0, 0.5f, 2);
|
|
|
|
|
Set(OsuConfig.AutomaticCursorSizing, false);
|
|
|
|
|
Set(OsuConfig.DimLevel, 30, 0, 100);
|
|
|
|
|
Set(OsuConfig.Display, 1);
|
|
|
|
|
Set(OsuConfig.DisplayCityLocation, false);
|
|
|
|
|
Set(OsuConfig.DistanceSpacingEnabled, true);
|
|
|
|
|
Set(OsuConfig.EditorTip, 0);
|
2017-01-25 17:39:41 +08:00
|
|
|
|
Set(OsuConfig.VideoEditor, true);
|
2016-11-03 07:47:54 +08:00
|
|
|
|
Set(OsuConfig.EditorDefaultSkin, false);
|
|
|
|
|
Set(OsuConfig.EditorSnakingSliders, true);
|
|
|
|
|
Set(OsuConfig.EditorHitAnimations, false);
|
|
|
|
|
Set(OsuConfig.EditorFollowPoints, true);
|
|
|
|
|
Set(OsuConfig.EditorStacking, true);
|
|
|
|
|
Set(OsuConfig.ForceSliderRendering, false);
|
|
|
|
|
Set(OsuConfig.FpsCounter, false);
|
|
|
|
|
Set(OsuConfig.FrameTimeDisplay, false);
|
|
|
|
|
Set(OsuConfig.GuideTips, @"");
|
|
|
|
|
Set(OsuConfig.CursorRipple, false);
|
|
|
|
|
Set(OsuConfig.HighlightWords, string.Empty);
|
|
|
|
|
Set(OsuConfig.HighResolution, false);
|
|
|
|
|
Set(OsuConfig.HitLighting, true);
|
|
|
|
|
Set(OsuConfig.IgnoreBarline, false);
|
|
|
|
|
Set(OsuConfig.IgnoreBeatmapSamples, false);
|
|
|
|
|
Set(OsuConfig.IgnoreBeatmapSkins, false);
|
|
|
|
|
Set(OsuConfig.IgnoreList, string.Empty);
|
|
|
|
|
Set(OsuConfig.KeyOverlay, false);
|
|
|
|
|
Set(OsuConfig.Language, @"unknown");
|
|
|
|
|
Set(OsuConfig.AllowNowPlayingHighlights, false);
|
|
|
|
|
Set(OsuConfig.LastVersion, string.Empty);
|
|
|
|
|
Set(OsuConfig.LastVersionPermissionsFailed, string.Empty);
|
|
|
|
|
Set(OsuConfig.LoadSubmittedThread, true);
|
|
|
|
|
Set(OsuConfig.LobbyPlayMode, -1);
|
|
|
|
|
Set(OsuConfig.ShowInterface, true);
|
|
|
|
|
Set(OsuConfig.ShowInterfaceDuringRelax, false);
|
|
|
|
|
Set(OsuConfig.LobbyShowExistingOnly, false);
|
|
|
|
|
Set(OsuConfig.LobbyShowFriendsOnly, false);
|
|
|
|
|
Set(OsuConfig.LobbyShowFull, false);
|
|
|
|
|
Set(OsuConfig.LobbyShowInProgress, true);
|
|
|
|
|
Set(OsuConfig.LobbyShowPassworded, true);
|
|
|
|
|
Set(OsuConfig.LogPrivateMessages, false);
|
|
|
|
|
Set(OsuConfig.LowResolution, false);
|
|
|
|
|
//Set(OsuConfig.ManiaSpeed, SpeedMania.SPEED_DEFAULT, SpeedMania.SPEED_MIN, SpeedMania.SPEED_MAX);
|
|
|
|
|
Set(OsuConfig.UsePerBeatmapManiaSpeed, true);
|
|
|
|
|
Set(OsuConfig.ManiaSpeedBPMScale, true);
|
|
|
|
|
Set(OsuConfig.MenuTip, 0);
|
|
|
|
|
Set(OsuConfig.MouseDisableButtons, false);
|
|
|
|
|
Set(OsuConfig.MouseDisableWheel, false);
|
|
|
|
|
Set(OsuConfig.MouseSpeed, 1, 0.4, 6);
|
|
|
|
|
Set(OsuConfig.Offset, 0, -300, 300);
|
2016-11-30 23:32:07 +08:00
|
|
|
|
Set(OsuConfig.ScoreMeterScale, 1, 0.5, 2);
|
2016-11-03 07:47:54 +08:00
|
|
|
|
//Set(OsuConfig.ScoreMeterScale, 1, 0.5, OsuGame.Tournament ? 10 : 2);
|
|
|
|
|
Set(OsuConfig.DistanceSpacing, 0.8, 0.1, 6);
|
|
|
|
|
Set(OsuConfig.EditorBeatDivisor, 1, 1, 16);
|
|
|
|
|
Set(OsuConfig.EditorGridSize, 32, 4, 32);
|
|
|
|
|
Set(OsuConfig.EditorGridSizeDesign, 32, 4, 32);
|
|
|
|
|
Set(OsuConfig.CustomFrameLimit, 240, 240, 999);
|
|
|
|
|
Set(OsuConfig.MsnIntegration, false);
|
|
|
|
|
Set(OsuConfig.MyPcSucks, false);
|
|
|
|
|
Set(OsuConfig.NotifyFriends, true);
|
|
|
|
|
Set(OsuConfig.NotifySubmittedThread, true);
|
|
|
|
|
Set(OsuConfig.PopupDuringGameplay, true);
|
2016-12-02 05:36:04 +08:00
|
|
|
|
Set(OsuConfig.ProgressBarType, ProgressBarType.Pie);
|
2016-12-02 06:28:20 +08:00
|
|
|
|
Set(OsuConfig.RankType, RankingType.Top);
|
2016-11-03 07:47:54 +08:00
|
|
|
|
Set(OsuConfig.RefreshRate, 60);
|
|
|
|
|
Set(OsuConfig.OverrideRefreshRate, Get<int>(OsuConfig.RefreshRate) != 60);
|
|
|
|
|
//Set(OsuConfig.ScaleMode, ScaleMode.WidescreenConservative);
|
|
|
|
|
Set(OsuConfig.ScoreboardVisible, true);
|
2016-12-02 06:28:20 +08:00
|
|
|
|
Set(OsuConfig.ScoreMeter, ScoreMeterType.Error);
|
2016-11-03 07:47:54 +08:00
|
|
|
|
//Set(OsuConfig.ScoreMeter, OsuGame.Tournament ? ScoreMeterType.Colour : ScoreMeterType.Error);
|
|
|
|
|
Set(OsuConfig.ScreenshotId, 0);
|
|
|
|
|
Set(OsuConfig.MenuSnow, false);
|
|
|
|
|
Set(OsuConfig.MenuTriangles, true);
|
|
|
|
|
Set(OsuConfig.SongSelectThumbnails, true);
|
2016-12-02 06:28:20 +08:00
|
|
|
|
Set(OsuConfig.ScreenshotFormat, ScreenshotFormat.Jpg);
|
2016-11-03 07:47:54 +08:00
|
|
|
|
Set(OsuConfig.ShowReplayComments, true);
|
|
|
|
|
Set(OsuConfig.ShowSpectators, true);
|
|
|
|
|
Set(OsuConfig.ShowStoryboard, true);
|
|
|
|
|
//Set(OsuConfig.Skin, SkinManager.DEFAULT_SKIN);
|
|
|
|
|
Set(OsuConfig.SkinSamples, true);
|
|
|
|
|
Set(OsuConfig.SkipTablet, false);
|
2016-12-03 20:56:19 +08:00
|
|
|
|
Set(OsuConfig.SnakingInSliders, true);
|
|
|
|
|
Set(OsuConfig.SnakingOutSliders, false);
|
2016-11-03 07:47:54 +08:00
|
|
|
|
Set(OsuConfig.Tablet, false);
|
|
|
|
|
Set(OsuConfig.UpdatePending, false);
|
|
|
|
|
Set(OsuConfig.UseSkinCursor, false);
|
|
|
|
|
Set(OsuConfig.UseTaikoSkin, false);
|
|
|
|
|
Set(OsuConfig.Video, true);
|
|
|
|
|
Set(OsuConfig.Wiimote, false);
|
|
|
|
|
Set(OsuConfig.YahooIntegration, false);
|
|
|
|
|
Set(OsuConfig.ForceFrameFlush, false);
|
|
|
|
|
Set(OsuConfig.DetectPerformanceIssues, true);
|
|
|
|
|
Set(OsuConfig.MenuMusic, true);
|
|
|
|
|
Set(OsuConfig.MenuVoice, true);
|
|
|
|
|
Set(OsuConfig.MenuParallax, true);
|
|
|
|
|
Set(OsuConfig.RawInput, false);
|
|
|
|
|
Set(OsuConfig.AbsoluteToOsuWindow, Get<bool>(OsuConfig.RawInput));
|
|
|
|
|
Set(OsuConfig.ShowMenuTips, true);
|
|
|
|
|
Set(OsuConfig.HiddenShowFirstApproach, true);
|
|
|
|
|
Set(OsuConfig.ComboColourSliderBall, true);
|
|
|
|
|
Set(OsuConfig.AlternativeChatFont, false);
|
2016-12-05 22:17:30 +08:00
|
|
|
|
Set(OsuConfig.DisplayStarsMaximum, 10.0, 0.0, 10.0);
|
|
|
|
|
Set(OsuConfig.DisplayStarsMinimum, 0.0, 0.0, 10.0);
|
2016-11-03 07:47:54 +08:00
|
|
|
|
Set(OsuConfig.AudioDevice, string.Empty);
|
2016-12-02 06:28:20 +08:00
|
|
|
|
Set(OsuConfig.ReleaseStream, ReleaseStream.Lazer);
|
2016-11-03 07:47:54 +08:00
|
|
|
|
Set(OsuConfig.UpdateFailCount, 0);
|
2016-11-30 18:22:36 +08:00
|
|
|
|
Set(OsuConfig.SavePassword, false);
|
2016-11-03 07:47:54 +08:00
|
|
|
|
Set(OsuConfig.SaveUsername, true);
|
|
|
|
|
//Set(OsuConfig.TreeSortMode, TreeGroupMode.Show_All);
|
|
|
|
|
//Set(OsuConfig.TreeSortMode2, TreeSortMode.Title);
|
2016-11-08 08:04:31 +08:00
|
|
|
|
bool unicodeDefault = false;
|
|
|
|
|
switch (Get<string>(OsuConfig.Language))
|
|
|
|
|
{
|
|
|
|
|
case @"zh":
|
|
|
|
|
case @"ja":
|
|
|
|
|
case @"ko":
|
|
|
|
|
unicodeDefault = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
Set(OsuConfig.ShowUnicode, unicodeDefault);
|
2016-11-03 07:47:54 +08:00
|
|
|
|
Set(OsuConfig.PermanentSongInfo, false);
|
|
|
|
|
Set(OsuConfig.Ticker, false);
|
|
|
|
|
Set(OsuConfig.CompatibilityContext, false);
|
|
|
|
|
Set(OsuConfig.CanForceOptimusCompatibility, true);
|
2016-12-02 06:28:20 +08:00
|
|
|
|
Set(OsuConfig.ConfineMouse, Get<bool>(OsuConfig.ConfineMouseToFullscreen) ?
|
|
|
|
|
ConfineMouseMode.Fullscreen : ConfineMouseMode.Never);
|
2017-01-28 18:10:05 +08:00
|
|
|
|
|
|
|
|
|
|
2017-01-28 21:56:05 +08:00
|
|
|
|
GetBindable<bool>(OsuConfig.SavePassword).ValueChanged += delegate
|
|
|
|
|
{
|
2017-01-28 22:01:11 +08:00
|
|
|
|
if (Get<bool>(OsuConfig.SavePassword)) Set(OsuConfig.SaveUsername, true);
|
2017-01-28 21:56:05 +08:00
|
|
|
|
};
|
|
|
|
|
GetBindable<bool>(OsuConfig.SaveUsername).ValueChanged += delegate
|
|
|
|
|
{
|
2017-01-28 22:01:11 +08:00
|
|
|
|
if (!Get<bool>(OsuConfig.SaveUsername)) Set(OsuConfig.SavePassword, false);
|
2017-01-28 21:56:05 +08:00
|
|
|
|
};
|
|
|
|
|
#pragma warning restore CS0612 // Type or member is obsolete
|
2017-01-28 18:10:05 +08:00
|
|
|
|
}
|
2016-11-01 02:44:20 +08:00
|
|
|
|
|
2016-11-12 18:44:16 +08:00
|
|
|
|
//todo: make a UnicodeString class/struct rather than requiring this helper method.
|
2016-11-11 10:35:58 +08:00
|
|
|
|
public string GetUnicodeString(string nonunicode, string unicode)
|
|
|
|
|
=> Get<bool>(OsuConfig.ShowUnicode) ? unicode ?? nonunicode : nonunicode ?? unicode;
|
2016-11-01 02:44:20 +08:00
|
|
|
|
|
|
|
|
|
public OsuConfigManager(BasicStorage storage) : base(storage)
|
|
|
|
|
{
|
|
|
|
|
}
|
2016-08-26 11:28:23 +08:00
|
|
|
|
}
|
|
|
|
|
|
2016-12-03 20:56:19 +08:00
|
|
|
|
public enum OsuConfig
|
2016-08-26 11:28:23 +08:00
|
|
|
|
{
|
2016-11-03 07:37:52 +08:00
|
|
|
|
// New osu:
|
|
|
|
|
PlayMode,
|
|
|
|
|
Token,
|
|
|
|
|
// Imported from old osu:
|
|
|
|
|
BeatmapDirectory,
|
|
|
|
|
AllowPublicInvites,
|
|
|
|
|
AutoChatHide,
|
|
|
|
|
AutomaticDownload,
|
|
|
|
|
AutomaticDownloadNoVideo,
|
|
|
|
|
BlockNonFriendPM,
|
|
|
|
|
Bloom,
|
|
|
|
|
BloomSoftening,
|
|
|
|
|
BossKeyFirstActivation,
|
|
|
|
|
ChatAudibleHighlight,
|
|
|
|
|
ChatChannels,
|
|
|
|
|
ChatFilter,
|
|
|
|
|
ChatHighlightName,
|
|
|
|
|
ChatMessageNotification,
|
|
|
|
|
ChatLastChannel,
|
|
|
|
|
ChatRemoveForeign,
|
|
|
|
|
ChatSortMode,
|
|
|
|
|
ComboBurst,
|
|
|
|
|
ComboFire,
|
|
|
|
|
ComboFireHeight,
|
|
|
|
|
ConfirmExit,
|
|
|
|
|
AutoSendNowPlaying,
|
|
|
|
|
CursorSize,
|
|
|
|
|
AutomaticCursorSizing,
|
|
|
|
|
DimLevel,
|
|
|
|
|
Display,
|
|
|
|
|
DisplayCityLocation,
|
|
|
|
|
DistanceSpacingEnabled,
|
|
|
|
|
EditorTip,
|
|
|
|
|
VideoEditor,
|
|
|
|
|
EditorDefaultSkin,
|
|
|
|
|
EditorSnakingSliders,
|
|
|
|
|
EditorHitAnimations,
|
|
|
|
|
EditorFollowPoints,
|
|
|
|
|
EditorStacking,
|
|
|
|
|
ForceSliderRendering,
|
|
|
|
|
FpsCounter,
|
|
|
|
|
FrameTimeDisplay,
|
|
|
|
|
GuideTips,
|
|
|
|
|
CursorRipple,
|
|
|
|
|
HighlightWords,
|
|
|
|
|
HighResolution,
|
|
|
|
|
HitLighting,
|
|
|
|
|
IgnoreBarline,
|
|
|
|
|
IgnoreBeatmapSamples,
|
2016-11-03 07:25:00 +08:00
|
|
|
|
IgnoreBeatmapSkins,
|
2016-11-03 07:37:52 +08:00
|
|
|
|
IgnoreList,
|
|
|
|
|
KeyOverlay,
|
|
|
|
|
Language,
|
|
|
|
|
LastPlayMode,
|
|
|
|
|
AllowNowPlayingHighlights,
|
|
|
|
|
LastVersion,
|
|
|
|
|
LastVersionPermissionsFailed,
|
|
|
|
|
LoadSubmittedThread,
|
|
|
|
|
LobbyPlayMode,
|
|
|
|
|
ShowInterface,
|
|
|
|
|
ShowInterfaceDuringRelax,
|
|
|
|
|
LobbyShowExistingOnly,
|
|
|
|
|
LobbyShowFriendsOnly,
|
|
|
|
|
LobbyShowFull,
|
|
|
|
|
LobbyShowInProgress,
|
|
|
|
|
LobbyShowPassworded,
|
|
|
|
|
LogPrivateMessages,
|
|
|
|
|
LowResolution,
|
|
|
|
|
ManiaSpeed,
|
|
|
|
|
UsePerBeatmapManiaSpeed,
|
|
|
|
|
ManiaSpeedBPMScale,
|
|
|
|
|
MenuTip,
|
|
|
|
|
MouseDisableButtons,
|
|
|
|
|
MouseDisableWheel,
|
|
|
|
|
MouseSpeed,
|
|
|
|
|
Offset,
|
|
|
|
|
ScoreMeterScale,
|
|
|
|
|
DistanceSpacing,
|
|
|
|
|
EditorBeatDivisor,
|
|
|
|
|
EditorGridSize,
|
|
|
|
|
EditorGridSizeDesign,
|
|
|
|
|
CustomFrameLimit,
|
|
|
|
|
MsnIntegration,
|
|
|
|
|
MyPcSucks,
|
|
|
|
|
NotifyFriends,
|
|
|
|
|
NotifySubmittedThread,
|
|
|
|
|
PopupDuringGameplay,
|
|
|
|
|
ProgressBarType,
|
|
|
|
|
RankType,
|
|
|
|
|
RefreshRate,
|
|
|
|
|
OverrideRefreshRate,
|
|
|
|
|
ScaleMode,
|
|
|
|
|
ScoreboardVisible,
|
|
|
|
|
ScoreMeter,
|
|
|
|
|
ScreenshotId,
|
|
|
|
|
MenuSnow,
|
|
|
|
|
MenuTriangles,
|
|
|
|
|
SongSelectThumbnails,
|
|
|
|
|
ScreenshotFormat,
|
|
|
|
|
ShowReplayComments,
|
|
|
|
|
ShowSpectators,
|
|
|
|
|
ShowStoryboard,
|
|
|
|
|
Skin,
|
|
|
|
|
SkinSamples,
|
|
|
|
|
SkipTablet,
|
2016-12-03 20:56:19 +08:00
|
|
|
|
SnakingInSliders,
|
|
|
|
|
SnakingOutSliders,
|
2016-11-03 07:37:52 +08:00
|
|
|
|
Tablet,
|
|
|
|
|
UpdatePending,
|
|
|
|
|
UserFilter,
|
2016-11-03 07:25:00 +08:00
|
|
|
|
UseSkinCursor,
|
2016-11-03 07:37:52 +08:00
|
|
|
|
UseTaikoSkin,
|
|
|
|
|
Video,
|
|
|
|
|
Wiimote,
|
|
|
|
|
YahooIntegration,
|
|
|
|
|
ForceFrameFlush,
|
|
|
|
|
DetectPerformanceIssues,
|
|
|
|
|
MenuMusic,
|
|
|
|
|
MenuVoice,
|
|
|
|
|
MenuParallax,
|
|
|
|
|
RawInput,
|
|
|
|
|
AbsoluteToOsuWindow,
|
|
|
|
|
ConfineMouse,
|
2016-12-02 06:28:20 +08:00
|
|
|
|
[Obsolete]
|
|
|
|
|
ConfineMouseToFullscreen,
|
2016-11-03 07:37:52 +08:00
|
|
|
|
ShowMenuTips,
|
|
|
|
|
HiddenShowFirstApproach,
|
|
|
|
|
ComboColourSliderBall,
|
|
|
|
|
AlternativeChatFont,
|
|
|
|
|
Username,
|
|
|
|
|
DisplayStarsMaximum,
|
|
|
|
|
DisplayStarsMinimum,
|
|
|
|
|
AudioDevice,
|
|
|
|
|
ReleaseStream,
|
|
|
|
|
UpdateFailCount,
|
|
|
|
|
SavePassword,
|
|
|
|
|
SaveUsername,
|
|
|
|
|
TreeSortMode,
|
|
|
|
|
TreeSortMode2,
|
|
|
|
|
ShowUnicode,
|
|
|
|
|
PermanentSongInfo,
|
|
|
|
|
Ticker,
|
|
|
|
|
CompatibilityContext,
|
|
|
|
|
CanForceOptimusCompatibility,
|
2016-12-03 20:56:19 +08:00
|
|
|
|
|
2016-08-26 11:28:23 +08:00
|
|
|
|
}
|
|
|
|
|
}
|