ConfigurationState.cs 51 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097
  1. using Ryujinx.Common;
  2. using Ryujinx.Common.Configuration;
  3. using Ryujinx.Common.Configuration.Hid;
  4. using Ryujinx.Common.Configuration.Hid.Controller;
  5. using Ryujinx.Common.Configuration.Hid.Keyboard;
  6. using Ryujinx.Common.Logging;
  7. using Ryujinx.Configuration.System;
  8. using Ryujinx.Configuration.Ui;
  9. using System;
  10. using System.Collections.Generic;
  11. namespace Ryujinx.Configuration
  12. {
  13. public class ConfigurationState
  14. {
  15. /// <summary>
  16. /// UI configuration section
  17. /// </summary>
  18. public class UiSection
  19. {
  20. public class Columns
  21. {
  22. public ReactiveObject<bool> FavColumn { get; private set; }
  23. public ReactiveObject<bool> IconColumn { get; private set; }
  24. public ReactiveObject<bool> AppColumn { get; private set; }
  25. public ReactiveObject<bool> DevColumn { get; private set; }
  26. public ReactiveObject<bool> VersionColumn { get; private set; }
  27. public ReactiveObject<bool> TimePlayedColumn { get; private set; }
  28. public ReactiveObject<bool> LastPlayedColumn { get; private set; }
  29. public ReactiveObject<bool> FileExtColumn { get; private set; }
  30. public ReactiveObject<bool> FileSizeColumn { get; private set; }
  31. public ReactiveObject<bool> PathColumn { get; private set; }
  32. public Columns()
  33. {
  34. FavColumn = new ReactiveObject<bool>();
  35. IconColumn = new ReactiveObject<bool>();
  36. AppColumn = new ReactiveObject<bool>();
  37. DevColumn = new ReactiveObject<bool>();
  38. VersionColumn = new ReactiveObject<bool>();
  39. TimePlayedColumn = new ReactiveObject<bool>();
  40. LastPlayedColumn = new ReactiveObject<bool>();
  41. FileExtColumn = new ReactiveObject<bool>();
  42. FileSizeColumn = new ReactiveObject<bool>();
  43. PathColumn = new ReactiveObject<bool>();
  44. }
  45. }
  46. public class ColumnSortSettings
  47. {
  48. public ReactiveObject<int> SortColumnId { get; private set; }
  49. public ReactiveObject<bool> SortAscending { get; private set; }
  50. public ColumnSortSettings()
  51. {
  52. SortColumnId = new ReactiveObject<int>();
  53. SortAscending = new ReactiveObject<bool>();
  54. }
  55. }
  56. /// <summary>
  57. /// Used to toggle columns in the GUI
  58. /// </summary>
  59. public Columns GuiColumns { get; private set; }
  60. /// <summary>
  61. /// Used to configure column sort settings in the GUI
  62. /// </summary>
  63. public ColumnSortSettings ColumnSort { get; private set; }
  64. /// <summary>
  65. /// A list of directories containing games to be used to load games into the games list
  66. /// </summary>
  67. public ReactiveObject<List<string>> GameDirs { get; private set; }
  68. /// <summary>
  69. /// Enable or disable custom themes in the GUI
  70. /// </summary>
  71. public ReactiveObject<bool> EnableCustomTheme { get; private set; }
  72. /// <summary>
  73. /// Path to custom GUI theme
  74. /// </summary>
  75. public ReactiveObject<string> CustomThemePath { get; private set; }
  76. /// <summary>
  77. /// Start games in fullscreen mode
  78. /// </summary>
  79. public ReactiveObject<bool> StartFullscreen { get; private set; }
  80. public UiSection()
  81. {
  82. GuiColumns = new Columns();
  83. ColumnSort = new ColumnSortSettings();
  84. GameDirs = new ReactiveObject<List<string>>();
  85. EnableCustomTheme = new ReactiveObject<bool>();
  86. CustomThemePath = new ReactiveObject<string>();
  87. StartFullscreen = new ReactiveObject<bool>();
  88. }
  89. }
  90. /// <summary>
  91. /// Logger configuration section
  92. /// </summary>
  93. public class LoggerSection
  94. {
  95. /// <summary>
  96. /// Enables printing debug log messages
  97. /// </summary>
  98. public ReactiveObject<bool> EnableDebug { get; private set; }
  99. /// <summary>
  100. /// Enables printing stub log messages
  101. /// </summary>
  102. public ReactiveObject<bool> EnableStub { get; private set; }
  103. /// <summary>
  104. /// Enables printing info log messages
  105. /// </summary>
  106. public ReactiveObject<bool> EnableInfo { get; private set; }
  107. /// <summary>
  108. /// Enables printing warning log messages
  109. /// </summary>
  110. public ReactiveObject<bool> EnableWarn { get; private set; }
  111. /// <summary>
  112. /// Enables printing error log messages
  113. /// </summary>
  114. public ReactiveObject<bool> EnableError { get; private set; }
  115. /// <summary>
  116. /// Enables printing trace log messages
  117. /// </summary>
  118. public ReactiveObject<bool> EnableTrace { get; private set; }
  119. /// <summary>
  120. /// Enables printing guest log messages
  121. /// </summary>
  122. public ReactiveObject<bool> EnableGuest { get; private set; }
  123. /// <summary>
  124. /// Enables printing FS access log messages
  125. /// </summary>
  126. public ReactiveObject<bool> EnableFsAccessLog { get; private set; }
  127. /// <summary>
  128. /// Controls which log messages are written to the log targets
  129. /// </summary>
  130. public ReactiveObject<LogClass[]> FilteredClasses { get; private set; }
  131. /// <summary>
  132. /// Enables or disables logging to a file on disk
  133. /// </summary>
  134. public ReactiveObject<bool> EnableFileLog { get; private set; }
  135. /// <summary>
  136. /// Controls which OpenGL log messages are recorded in the log
  137. /// </summary>
  138. public ReactiveObject<GraphicsDebugLevel> GraphicsDebugLevel { get; private set; }
  139. public LoggerSection()
  140. {
  141. EnableDebug = new ReactiveObject<bool>();
  142. EnableStub = new ReactiveObject<bool>();
  143. EnableInfo = new ReactiveObject<bool>();
  144. EnableWarn = new ReactiveObject<bool>();
  145. EnableError = new ReactiveObject<bool>();
  146. EnableTrace = new ReactiveObject<bool>();
  147. EnableGuest = new ReactiveObject<bool>();
  148. EnableFsAccessLog = new ReactiveObject<bool>();
  149. FilteredClasses = new ReactiveObject<LogClass[]>();
  150. EnableFileLog = new ReactiveObject<bool>();
  151. EnableFileLog.Event += static (sender, e) => LogValueChange(sender, e, nameof(EnableFileLog));
  152. GraphicsDebugLevel = new ReactiveObject<GraphicsDebugLevel>();
  153. }
  154. }
  155. /// <summary>
  156. /// System configuration section
  157. /// </summary>
  158. public class SystemSection
  159. {
  160. /// <summary>
  161. /// Change System Language
  162. /// </summary>
  163. public ReactiveObject<Language> Language { get; private set; }
  164. /// <summary>
  165. /// Change System Region
  166. /// </summary>
  167. public ReactiveObject<Region> Region { get; private set; }
  168. /// <summary>
  169. /// Change System TimeZone
  170. /// </summary>
  171. public ReactiveObject<string> TimeZone { get; private set; }
  172. /// <summary>
  173. /// System Time Offset in Seconds
  174. /// </summary>
  175. public ReactiveObject<long> SystemTimeOffset { get; private set; }
  176. /// <summary>
  177. /// Enables or disables Docked Mode
  178. /// </summary>
  179. public ReactiveObject<bool> EnableDockedMode { get; private set; }
  180. /// <summary>
  181. /// Enables or disables profiled translation cache persistency
  182. /// </summary>
  183. public ReactiveObject<bool> EnablePtc { get; private set; }
  184. /// <summary>
  185. /// Enables or disables guest Internet access
  186. /// </summary>
  187. public ReactiveObject<bool> EnableInternetAccess { get; private set; }
  188. /// <summary>
  189. /// Enables integrity checks on Game content files
  190. /// </summary>
  191. public ReactiveObject<bool> EnableFsIntegrityChecks { get; private set; }
  192. /// <summary>
  193. /// Enables FS access log output to the console. Possible modes are 0-3
  194. /// </summary>
  195. public ReactiveObject<int> FsGlobalAccessLogMode { get; private set; }
  196. /// <summary>
  197. /// The selected audio backend
  198. /// </summary>
  199. public ReactiveObject<AudioBackend> AudioBackend { get; private set; }
  200. /// <summary>
  201. /// The audio backend volume
  202. /// </summary>
  203. public ReactiveObject<float> AudioVolume { get; private set; }
  204. /// <summary>
  205. /// The selected memory manager mode
  206. /// </summary>
  207. public ReactiveObject<MemoryManagerMode> MemoryManagerMode { get; private set; }
  208. /// <summary>
  209. /// Defines the amount of RAM available on the emulated system, and how it is distributed
  210. /// </summary>
  211. public ReactiveObject<bool> ExpandRam { get; private set; }
  212. /// <summary>
  213. /// Enable or disable ignoring missing services
  214. /// </summary>
  215. public ReactiveObject<bool> IgnoreMissingServices { get; private set; }
  216. public SystemSection()
  217. {
  218. Language = new ReactiveObject<Language>();
  219. Region = new ReactiveObject<Region>();
  220. TimeZone = new ReactiveObject<string>();
  221. SystemTimeOffset = new ReactiveObject<long>();
  222. EnableDockedMode = new ReactiveObject<bool>();
  223. EnableDockedMode.Event += static (sender, e) => LogValueChange(sender, e, nameof(EnableDockedMode));
  224. EnablePtc = new ReactiveObject<bool>();
  225. EnablePtc.Event += static (sender, e) => LogValueChange(sender, e, nameof(EnablePtc));
  226. EnableInternetAccess = new ReactiveObject<bool>();
  227. EnableInternetAccess.Event += static (sender, e) => LogValueChange(sender, e, nameof(EnableInternetAccess));
  228. EnableFsIntegrityChecks = new ReactiveObject<bool>();
  229. EnableFsIntegrityChecks.Event += static (sender, e) => LogValueChange(sender, e, nameof(EnableFsIntegrityChecks));
  230. FsGlobalAccessLogMode = new ReactiveObject<int>();
  231. FsGlobalAccessLogMode.Event += static (sender, e) => LogValueChange(sender, e, nameof(FsGlobalAccessLogMode));
  232. AudioBackend = new ReactiveObject<AudioBackend>();
  233. AudioBackend.Event += static (sender, e) => LogValueChange(sender, e, nameof(AudioBackend));
  234. MemoryManagerMode = new ReactiveObject<MemoryManagerMode>();
  235. MemoryManagerMode.Event += static (sender, e) => LogValueChange(sender, e, nameof(MemoryManagerMode));
  236. ExpandRam = new ReactiveObject<bool>();
  237. ExpandRam.Event += static (sender, e) => LogValueChange(sender, e, nameof(ExpandRam));
  238. IgnoreMissingServices = new ReactiveObject<bool>();
  239. IgnoreMissingServices.Event += static (sender, e) => LogValueChange(sender, e, nameof(IgnoreMissingServices));
  240. AudioVolume = new ReactiveObject<float>();
  241. AudioVolume.Event += static (sender, e) => LogValueChange(sender, e, nameof(AudioVolume));
  242. }
  243. }
  244. /// <summary>
  245. /// Hid configuration section
  246. /// </summary>
  247. public class HidSection
  248. {
  249. /// <summary>
  250. /// Enable or disable keyboard support (Independent from controllers binding)
  251. /// </summary>
  252. public ReactiveObject<bool> EnableKeyboard { get; private set; }
  253. /// <summary>
  254. /// Enable or disable mouse support (Independent from controllers binding)
  255. /// </summary>
  256. public ReactiveObject<bool> EnableMouse { get; private set; }
  257. /// <summary>
  258. /// Hotkey Keyboard Bindings
  259. /// </summary>
  260. public ReactiveObject<KeyboardHotkeys> Hotkeys { get; private set; }
  261. /// <summary>
  262. /// Input device configuration.
  263. /// NOTE: This ReactiveObject won't issue an event when the List has elements added or removed.
  264. /// TODO: Implement a ReactiveList class.
  265. /// </summary>
  266. public ReactiveObject<List<InputConfig>> InputConfig { get; private set; }
  267. public HidSection()
  268. {
  269. EnableKeyboard = new ReactiveObject<bool>();
  270. EnableMouse = new ReactiveObject<bool>();
  271. Hotkeys = new ReactiveObject<KeyboardHotkeys>();
  272. InputConfig = new ReactiveObject<List<InputConfig>>();
  273. }
  274. }
  275. /// <summary>
  276. /// Graphics configuration section
  277. /// </summary>
  278. public class GraphicsSection
  279. {
  280. /// <summary>
  281. /// Whether or not backend threading is enabled. The "Auto" setting will determine whether threading should be enabled at runtime.
  282. /// </summary>
  283. public ReactiveObject<BackendThreading> BackendThreading { get; private set; }
  284. /// <summary>
  285. /// Max Anisotropy. Values range from 0 - 16. Set to -1 to let the game decide.
  286. /// </summary>
  287. public ReactiveObject<float> MaxAnisotropy { get; private set; }
  288. /// <summary>
  289. /// Aspect Ratio applied to the renderer window.
  290. /// </summary>
  291. public ReactiveObject<AspectRatio> AspectRatio { get; private set; }
  292. /// <summary>
  293. /// Resolution Scale. An integer scale applied to applicable render targets. Values 1-4, or -1 to use a custom floating point scale instead.
  294. /// </summary>
  295. public ReactiveObject<int> ResScale { get; private set; }
  296. /// <summary>
  297. /// Custom Resolution Scale. A custom floating point scale applied to applicable render targets. Only active when Resolution Scale is -1.
  298. /// </summary>
  299. public ReactiveObject<float> ResScaleCustom { get; private set; }
  300. /// <summary>
  301. /// Dumps shaders in this local directory
  302. /// </summary>
  303. public ReactiveObject<string> ShadersDumpPath { get; private set; }
  304. /// <summary>
  305. /// Enables or disables Vertical Sync
  306. /// </summary>
  307. public ReactiveObject<bool> EnableVsync { get; private set; }
  308. /// <summary>
  309. /// Enables or disables Shader cache
  310. /// </summary>
  311. public ReactiveObject<bool> EnableShaderCache { get; private set; }
  312. public GraphicsSection()
  313. {
  314. BackendThreading = new ReactiveObject<BackendThreading>();
  315. BackendThreading.Event += static (sender, e) => LogValueChange(sender, e, nameof(BackendThreading));
  316. ResScale = new ReactiveObject<int>();
  317. ResScale.Event += static (sender, e) => LogValueChange(sender, e, nameof(ResScale));
  318. ResScaleCustom = new ReactiveObject<float>();
  319. ResScaleCustom.Event += static (sender, e) => LogValueChange(sender, e, nameof(ResScaleCustom));
  320. MaxAnisotropy = new ReactiveObject<float>();
  321. MaxAnisotropy.Event += static (sender, e) => LogValueChange(sender, e, nameof(MaxAnisotropy));
  322. AspectRatio = new ReactiveObject<AspectRatio>();
  323. AspectRatio.Event += static (sender, e) => LogValueChange(sender, e, nameof(AspectRatio));
  324. ShadersDumpPath = new ReactiveObject<string>();
  325. EnableVsync = new ReactiveObject<bool>();
  326. EnableVsync.Event += static (sender, e) => LogValueChange(sender, e, nameof(EnableVsync));
  327. EnableShaderCache = new ReactiveObject<bool>();
  328. EnableShaderCache.Event += static (sender, e) => LogValueChange(sender, e, nameof(EnableShaderCache));
  329. }
  330. }
  331. /// <summary>
  332. /// The default configuration instance
  333. /// </summary>
  334. public static ConfigurationState Instance { get; private set; }
  335. /// <summary>
  336. /// The Ui section
  337. /// </summary>
  338. public UiSection Ui { get; private set; }
  339. /// <summary>
  340. /// The Logger section
  341. /// </summary>
  342. public LoggerSection Logger { get; private set; }
  343. /// <summary>
  344. /// The System section
  345. /// </summary>
  346. public SystemSection System { get; private set; }
  347. /// <summary>
  348. /// The Graphics section
  349. /// </summary>
  350. public GraphicsSection Graphics { get; private set; }
  351. /// <summary>
  352. /// The Hid section
  353. /// </summary>
  354. public HidSection Hid { get; private set; }
  355. /// <summary>
  356. /// Enables or disables Discord Rich Presence
  357. /// </summary>
  358. public ReactiveObject<bool> EnableDiscordIntegration { get; private set; }
  359. /// <summary>
  360. /// Checks for updates when Ryujinx starts when enabled
  361. /// </summary>
  362. public ReactiveObject<bool> CheckUpdatesOnStart { get; private set; }
  363. /// <summary>
  364. /// Show "Confirm Exit" Dialog
  365. /// </summary>
  366. public ReactiveObject<bool> ShowConfirmExit { get; private set; }
  367. /// <summary>
  368. /// Hide Cursor on Idle
  369. /// </summary>
  370. public ReactiveObject<bool> HideCursorOnIdle { get; private set; }
  371. private ConfigurationState()
  372. {
  373. Ui = new UiSection();
  374. Logger = new LoggerSection();
  375. System = new SystemSection();
  376. Graphics = new GraphicsSection();
  377. Hid = new HidSection();
  378. EnableDiscordIntegration = new ReactiveObject<bool>();
  379. CheckUpdatesOnStart = new ReactiveObject<bool>();
  380. ShowConfirmExit = new ReactiveObject<bool>();
  381. HideCursorOnIdle = new ReactiveObject<bool>();
  382. }
  383. public ConfigurationFileFormat ToFileFormat()
  384. {
  385. ConfigurationFileFormat configurationFile = new ConfigurationFileFormat
  386. {
  387. Version = ConfigurationFileFormat.CurrentVersion,
  388. EnableFileLog = Logger.EnableFileLog,
  389. BackendThreading = Graphics.BackendThreading,
  390. ResScale = Graphics.ResScale,
  391. ResScaleCustom = Graphics.ResScaleCustom,
  392. MaxAnisotropy = Graphics.MaxAnisotropy,
  393. AspectRatio = Graphics.AspectRatio,
  394. GraphicsShadersDumpPath = Graphics.ShadersDumpPath,
  395. LoggingEnableDebug = Logger.EnableDebug,
  396. LoggingEnableStub = Logger.EnableStub,
  397. LoggingEnableInfo = Logger.EnableInfo,
  398. LoggingEnableWarn = Logger.EnableWarn,
  399. LoggingEnableError = Logger.EnableError,
  400. LoggingEnableTrace = Logger.EnableTrace,
  401. LoggingEnableGuest = Logger.EnableGuest,
  402. LoggingEnableFsAccessLog = Logger.EnableFsAccessLog,
  403. LoggingFilteredClasses = Logger.FilteredClasses,
  404. LoggingGraphicsDebugLevel = Logger.GraphicsDebugLevel,
  405. SystemLanguage = System.Language,
  406. SystemRegion = System.Region,
  407. SystemTimeZone = System.TimeZone,
  408. SystemTimeOffset = System.SystemTimeOffset,
  409. DockedMode = System.EnableDockedMode,
  410. EnableDiscordIntegration = EnableDiscordIntegration,
  411. CheckUpdatesOnStart = CheckUpdatesOnStart,
  412. ShowConfirmExit = ShowConfirmExit,
  413. HideCursorOnIdle = HideCursorOnIdle,
  414. EnableVsync = Graphics.EnableVsync,
  415. EnableShaderCache = Graphics.EnableShaderCache,
  416. EnablePtc = System.EnablePtc,
  417. EnableInternetAccess = System.EnableInternetAccess,
  418. EnableFsIntegrityChecks = System.EnableFsIntegrityChecks,
  419. FsGlobalAccessLogMode = System.FsGlobalAccessLogMode,
  420. AudioBackend = System.AudioBackend,
  421. AudioVolume = System.AudioVolume,
  422. MemoryManagerMode = System.MemoryManagerMode,
  423. ExpandRam = System.ExpandRam,
  424. IgnoreMissingServices = System.IgnoreMissingServices,
  425. GuiColumns = new GuiColumns
  426. {
  427. FavColumn = Ui.GuiColumns.FavColumn,
  428. IconColumn = Ui.GuiColumns.IconColumn,
  429. AppColumn = Ui.GuiColumns.AppColumn,
  430. DevColumn = Ui.GuiColumns.DevColumn,
  431. VersionColumn = Ui.GuiColumns.VersionColumn,
  432. TimePlayedColumn = Ui.GuiColumns.TimePlayedColumn,
  433. LastPlayedColumn = Ui.GuiColumns.LastPlayedColumn,
  434. FileExtColumn = Ui.GuiColumns.FileExtColumn,
  435. FileSizeColumn = Ui.GuiColumns.FileSizeColumn,
  436. PathColumn = Ui.GuiColumns.PathColumn,
  437. },
  438. ColumnSort = new ColumnSort
  439. {
  440. SortColumnId = Ui.ColumnSort.SortColumnId,
  441. SortAscending = Ui.ColumnSort.SortAscending
  442. },
  443. GameDirs = Ui.GameDirs,
  444. EnableCustomTheme = Ui.EnableCustomTheme,
  445. CustomThemePath = Ui.CustomThemePath,
  446. StartFullscreen = Ui.StartFullscreen,
  447. EnableKeyboard = Hid.EnableKeyboard,
  448. EnableMouse = Hid.EnableMouse,
  449. Hotkeys = Hid.Hotkeys,
  450. KeyboardConfig = new List<object>(),
  451. ControllerConfig = new List<object>(),
  452. InputConfig = Hid.InputConfig,
  453. };
  454. return configurationFile;
  455. }
  456. public void LoadDefault()
  457. {
  458. Logger.EnableFileLog.Value = true;
  459. Graphics.BackendThreading.Value = BackendThreading.Auto;
  460. Graphics.ResScale.Value = 1;
  461. Graphics.ResScaleCustom.Value = 1.0f;
  462. Graphics.MaxAnisotropy.Value = -1.0f;
  463. Graphics.AspectRatio.Value = AspectRatio.Fixed16x9;
  464. Graphics.ShadersDumpPath.Value = "";
  465. Logger.EnableDebug.Value = false;
  466. Logger.EnableStub.Value = true;
  467. Logger.EnableInfo.Value = true;
  468. Logger.EnableWarn.Value = true;
  469. Logger.EnableError.Value = true;
  470. Logger.EnableTrace.Value = false;
  471. Logger.EnableGuest.Value = true;
  472. Logger.EnableFsAccessLog.Value = false;
  473. Logger.FilteredClasses.Value = Array.Empty<LogClass>();
  474. Logger.GraphicsDebugLevel.Value = GraphicsDebugLevel.None;
  475. System.Language.Value = Language.AmericanEnglish;
  476. System.Region.Value = Region.USA;
  477. System.TimeZone.Value = "UTC";
  478. System.SystemTimeOffset.Value = 0;
  479. System.EnableDockedMode.Value = true;
  480. EnableDiscordIntegration.Value = true;
  481. CheckUpdatesOnStart.Value = true;
  482. ShowConfirmExit.Value = true;
  483. HideCursorOnIdle.Value = false;
  484. Graphics.EnableVsync.Value = true;
  485. Graphics.EnableShaderCache.Value = true;
  486. System.EnablePtc.Value = true;
  487. System.EnableInternetAccess.Value = false;
  488. System.EnableFsIntegrityChecks.Value = true;
  489. System.FsGlobalAccessLogMode.Value = 0;
  490. System.AudioBackend.Value = AudioBackend.SDL2;
  491. System.AudioVolume.Value = 1;
  492. System.MemoryManagerMode.Value = MemoryManagerMode.HostMappedUnsafe;
  493. System.ExpandRam.Value = false;
  494. System.IgnoreMissingServices.Value = false;
  495. Ui.GuiColumns.FavColumn.Value = true;
  496. Ui.GuiColumns.IconColumn.Value = true;
  497. Ui.GuiColumns.AppColumn.Value = true;
  498. Ui.GuiColumns.DevColumn.Value = true;
  499. Ui.GuiColumns.VersionColumn.Value = true;
  500. Ui.GuiColumns.TimePlayedColumn.Value = true;
  501. Ui.GuiColumns.LastPlayedColumn.Value = true;
  502. Ui.GuiColumns.FileExtColumn.Value = true;
  503. Ui.GuiColumns.FileSizeColumn.Value = true;
  504. Ui.GuiColumns.PathColumn.Value = true;
  505. Ui.ColumnSort.SortColumnId.Value = 0;
  506. Ui.ColumnSort.SortAscending.Value = false;
  507. Ui.GameDirs.Value = new List<string>();
  508. Ui.EnableCustomTheme.Value = false;
  509. Ui.CustomThemePath.Value = "";
  510. Ui.StartFullscreen.Value = false;
  511. Hid.EnableKeyboard.Value = false;
  512. Hid.EnableMouse.Value = false;
  513. Hid.Hotkeys.Value = new KeyboardHotkeys
  514. {
  515. ToggleVsync = Key.Tab,
  516. ToggleMute = Key.F2,
  517. Screenshot = Key.F8,
  518. ShowUi = Key.F4,
  519. Pause = Key.F5
  520. };
  521. Hid.InputConfig.Value = new List<InputConfig>
  522. {
  523. new StandardKeyboardInputConfig
  524. {
  525. Version = InputConfig.CurrentVersion,
  526. Backend = InputBackendType.WindowKeyboard,
  527. Id = "0",
  528. PlayerIndex = PlayerIndex.Player1,
  529. ControllerType = ControllerType.JoyconPair,
  530. LeftJoycon = new LeftJoyconCommonConfig<Key>
  531. {
  532. DpadUp = Key.Up,
  533. DpadDown = Key.Down,
  534. DpadLeft = Key.Left,
  535. DpadRight = Key.Right,
  536. ButtonMinus = Key.Minus,
  537. ButtonL = Key.E,
  538. ButtonZl = Key.Q,
  539. ButtonSl = Key.Unbound,
  540. ButtonSr = Key.Unbound
  541. },
  542. LeftJoyconStick = new JoyconConfigKeyboardStick<Key>
  543. {
  544. StickUp = Key.W,
  545. StickDown = Key.S,
  546. StickLeft = Key.A,
  547. StickRight = Key.D,
  548. StickButton = Key.F,
  549. },
  550. RightJoycon = new RightJoyconCommonConfig<Key>
  551. {
  552. ButtonA = Key.Z,
  553. ButtonB = Key.X,
  554. ButtonX = Key.C,
  555. ButtonY = Key.V,
  556. ButtonPlus = Key.Plus,
  557. ButtonR = Key.U,
  558. ButtonZr = Key.O,
  559. ButtonSl = Key.Unbound,
  560. ButtonSr = Key.Unbound
  561. },
  562. RightJoyconStick = new JoyconConfigKeyboardStick<Key>
  563. {
  564. StickUp = Key.I,
  565. StickDown = Key.K,
  566. StickLeft = Key.J,
  567. StickRight = Key.L,
  568. StickButton = Key.H,
  569. }
  570. }
  571. };
  572. }
  573. public void Load(ConfigurationFileFormat configurationFileFormat, string configurationFilePath)
  574. {
  575. bool configurationFileUpdated = false;
  576. if (configurationFileFormat.Version < 0 || configurationFileFormat.Version > ConfigurationFileFormat.CurrentVersion)
  577. {
  578. Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Unsupported configuration version {configurationFileFormat.Version}, loading default.");
  579. LoadDefault();
  580. return;
  581. }
  582. if (configurationFileFormat.Version < 2)
  583. {
  584. Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 2.");
  585. configurationFileFormat.SystemRegion = Region.USA;
  586. configurationFileUpdated = true;
  587. }
  588. if (configurationFileFormat.Version < 3)
  589. {
  590. Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 3.");
  591. configurationFileFormat.SystemTimeZone = "UTC";
  592. configurationFileUpdated = true;
  593. }
  594. if (configurationFileFormat.Version < 4)
  595. {
  596. Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 4.");
  597. configurationFileFormat.MaxAnisotropy = -1;
  598. configurationFileUpdated = true;
  599. }
  600. if (configurationFileFormat.Version < 5)
  601. {
  602. Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 5.");
  603. configurationFileFormat.SystemTimeOffset = 0;
  604. configurationFileUpdated = true;
  605. }
  606. if (configurationFileFormat.Version < 8)
  607. {
  608. Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 8.");
  609. configurationFileFormat.EnablePtc = true;
  610. configurationFileUpdated = true;
  611. }
  612. if (configurationFileFormat.Version < 9)
  613. {
  614. Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 9.");
  615. configurationFileFormat.ColumnSort = new ColumnSort
  616. {
  617. SortColumnId = 0,
  618. SortAscending = false
  619. };
  620. configurationFileFormat.Hotkeys = new KeyboardHotkeys
  621. {
  622. ToggleVsync = Key.Tab
  623. };
  624. configurationFileUpdated = true;
  625. }
  626. if (configurationFileFormat.Version < 10)
  627. {
  628. Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 10.");
  629. configurationFileFormat.AudioBackend = AudioBackend.OpenAl;
  630. configurationFileUpdated = true;
  631. }
  632. if (configurationFileFormat.Version < 11)
  633. {
  634. Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 11.");
  635. configurationFileFormat.ResScale = 1;
  636. configurationFileFormat.ResScaleCustom = 1.0f;
  637. configurationFileUpdated = true;
  638. }
  639. if (configurationFileFormat.Version < 12)
  640. {
  641. Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 12.");
  642. configurationFileFormat.LoggingGraphicsDebugLevel = GraphicsDebugLevel.None;
  643. configurationFileUpdated = true;
  644. }
  645. if (configurationFileFormat.Version < 14)
  646. {
  647. Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 14.");
  648. configurationFileFormat.CheckUpdatesOnStart = true;
  649. configurationFileUpdated = true;
  650. }
  651. if (configurationFileFormat.Version < 16)
  652. {
  653. Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 16.");
  654. configurationFileFormat.EnableShaderCache = true;
  655. configurationFileUpdated = true;
  656. }
  657. if (configurationFileFormat.Version < 17)
  658. {
  659. Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 17.");
  660. configurationFileFormat.StartFullscreen = false;
  661. configurationFileUpdated = true;
  662. }
  663. if (configurationFileFormat.Version < 18)
  664. {
  665. Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 18.");
  666. configurationFileFormat.AspectRatio = AspectRatio.Fixed16x9;
  667. configurationFileUpdated = true;
  668. }
  669. if (configurationFileFormat.Version < 20)
  670. {
  671. Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 20.");
  672. configurationFileFormat.ShowConfirmExit = true;
  673. configurationFileUpdated = true;
  674. }
  675. if (configurationFileFormat.Version < 22)
  676. {
  677. Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 22.");
  678. configurationFileFormat.HideCursorOnIdle = false;
  679. configurationFileUpdated = true;
  680. }
  681. if (configurationFileFormat.Version < 24)
  682. {
  683. Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 24.");
  684. configurationFileFormat.InputConfig = new List<InputConfig>
  685. {
  686. new StandardKeyboardInputConfig
  687. {
  688. Version = InputConfig.CurrentVersion,
  689. Backend = InputBackendType.WindowKeyboard,
  690. Id = "0",
  691. PlayerIndex = PlayerIndex.Player1,
  692. ControllerType = ControllerType.JoyconPair,
  693. LeftJoycon = new LeftJoyconCommonConfig<Key>
  694. {
  695. DpadUp = Key.Up,
  696. DpadDown = Key.Down,
  697. DpadLeft = Key.Left,
  698. DpadRight = Key.Right,
  699. ButtonMinus = Key.Minus,
  700. ButtonL = Key.E,
  701. ButtonZl = Key.Q,
  702. ButtonSl = Key.Unbound,
  703. ButtonSr = Key.Unbound
  704. },
  705. LeftJoyconStick = new JoyconConfigKeyboardStick<Key>
  706. {
  707. StickUp = Key.W,
  708. StickDown = Key.S,
  709. StickLeft = Key.A,
  710. StickRight = Key.D,
  711. StickButton = Key.F,
  712. },
  713. RightJoycon = new RightJoyconCommonConfig<Key>
  714. {
  715. ButtonA = Key.Z,
  716. ButtonB = Key.X,
  717. ButtonX = Key.C,
  718. ButtonY = Key.V,
  719. ButtonPlus = Key.Plus,
  720. ButtonR = Key.U,
  721. ButtonZr = Key.O,
  722. ButtonSl = Key.Unbound,
  723. ButtonSr = Key.Unbound
  724. },
  725. RightJoyconStick = new JoyconConfigKeyboardStick<Key>
  726. {
  727. StickUp = Key.I,
  728. StickDown = Key.K,
  729. StickLeft = Key.J,
  730. StickRight = Key.L,
  731. StickButton = Key.H,
  732. }
  733. }
  734. };
  735. configurationFileUpdated = true;
  736. }
  737. if (configurationFileFormat.Version < 25)
  738. {
  739. Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 25.");
  740. configurationFileUpdated = true;
  741. }
  742. if (configurationFileFormat.Version < 26)
  743. {
  744. Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 26.");
  745. configurationFileFormat.MemoryManagerMode = MemoryManagerMode.HostMappedUnsafe;
  746. configurationFileUpdated = true;
  747. }
  748. if (configurationFileFormat.Version < 27)
  749. {
  750. Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 27.");
  751. configurationFileFormat.EnableMouse = false;
  752. configurationFileUpdated = true;
  753. }
  754. if (configurationFileFormat.Version < 28)
  755. {
  756. Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 28.");
  757. configurationFileFormat.Hotkeys = new KeyboardHotkeys
  758. {
  759. ToggleVsync = Key.Tab,
  760. Screenshot = Key.F8
  761. };
  762. configurationFileUpdated = true;
  763. }
  764. if (configurationFileFormat.Version < 29)
  765. {
  766. Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 29.");
  767. configurationFileFormat.Hotkeys = new KeyboardHotkeys
  768. {
  769. ToggleVsync = Key.Tab,
  770. Screenshot = Key.F8,
  771. ShowUi = Key.F4
  772. };
  773. configurationFileUpdated = true;
  774. }
  775. if (configurationFileFormat.Version < 30)
  776. {
  777. Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 30.");
  778. foreach (InputConfig config in configurationFileFormat.InputConfig)
  779. {
  780. if (config is StandardControllerInputConfig controllerConfig)
  781. {
  782. controllerConfig.Rumble = new RumbleConfigController
  783. {
  784. EnableRumble = false,
  785. StrongRumble = 1f,
  786. WeakRumble = 1f
  787. };
  788. }
  789. }
  790. configurationFileUpdated = true;
  791. }
  792. if (configurationFileFormat.Version < 31)
  793. {
  794. Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 31.");
  795. configurationFileFormat.BackendThreading = BackendThreading.Auto;
  796. configurationFileUpdated = true;
  797. }
  798. if (configurationFileFormat.Version < 32)
  799. {
  800. Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 32.");
  801. configurationFileFormat.Hotkeys = new KeyboardHotkeys
  802. {
  803. ToggleVsync = configurationFileFormat.Hotkeys.ToggleVsync,
  804. Screenshot = configurationFileFormat.Hotkeys.Screenshot,
  805. ShowUi = configurationFileFormat.Hotkeys.ShowUi,
  806. Pause = Key.F5
  807. };
  808. configurationFileUpdated = true;
  809. }
  810. if (configurationFileFormat.Version < 33)
  811. {
  812. Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 33.");
  813. configurationFileFormat.Hotkeys = new KeyboardHotkeys
  814. {
  815. ToggleVsync = configurationFileFormat.Hotkeys.ToggleVsync,
  816. Screenshot = configurationFileFormat.Hotkeys.Screenshot,
  817. ShowUi = configurationFileFormat.Hotkeys.ShowUi,
  818. Pause = configurationFileFormat.Hotkeys.Pause,
  819. ToggleMute = Key.F2
  820. };
  821. configurationFileFormat.AudioVolume = 1;
  822. configurationFileUpdated = true;
  823. }
  824. if (configurationFileFormat.Version < 34)
  825. {
  826. Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 34.");
  827. configurationFileFormat.EnableInternetAccess = false;
  828. configurationFileUpdated = true;
  829. }
  830. if (configurationFileFormat.Version < 35)
  831. {
  832. Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 35.");
  833. foreach (InputConfig config in configurationFileFormat.InputConfig)
  834. {
  835. if (config is StandardControllerInputConfig controllerConfig)
  836. {
  837. controllerConfig.RangeLeft = 1.0f;
  838. controllerConfig.RangeRight = 1.0f;
  839. }
  840. }
  841. configurationFileUpdated = true;
  842. }
  843. if (configurationFileFormat.Version < 36)
  844. {
  845. Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 36.");
  846. configurationFileFormat.LoggingEnableTrace = false;
  847. configurationFileUpdated = true;
  848. }
  849. Logger.EnableFileLog.Value = configurationFileFormat.EnableFileLog;
  850. Graphics.BackendThreading.Value = configurationFileFormat.BackendThreading;
  851. Graphics.ResScale.Value = configurationFileFormat.ResScale;
  852. Graphics.ResScaleCustom.Value = configurationFileFormat.ResScaleCustom;
  853. Graphics.MaxAnisotropy.Value = configurationFileFormat.MaxAnisotropy;
  854. Graphics.AspectRatio.Value = configurationFileFormat.AspectRatio;
  855. Graphics.ShadersDumpPath.Value = configurationFileFormat.GraphicsShadersDumpPath;
  856. Logger.EnableDebug.Value = configurationFileFormat.LoggingEnableDebug;
  857. Logger.EnableStub.Value = configurationFileFormat.LoggingEnableStub;
  858. Logger.EnableInfo.Value = configurationFileFormat.LoggingEnableInfo;
  859. Logger.EnableWarn.Value = configurationFileFormat.LoggingEnableWarn;
  860. Logger.EnableError.Value = configurationFileFormat.LoggingEnableError;
  861. Logger.EnableTrace.Value = configurationFileFormat.LoggingEnableTrace;
  862. Logger.EnableGuest.Value = configurationFileFormat.LoggingEnableGuest;
  863. Logger.EnableFsAccessLog.Value = configurationFileFormat.LoggingEnableFsAccessLog;
  864. Logger.FilteredClasses.Value = configurationFileFormat.LoggingFilteredClasses;
  865. Logger.GraphicsDebugLevel.Value = configurationFileFormat.LoggingGraphicsDebugLevel;
  866. System.Language.Value = configurationFileFormat.SystemLanguage;
  867. System.Region.Value = configurationFileFormat.SystemRegion;
  868. System.TimeZone.Value = configurationFileFormat.SystemTimeZone;
  869. System.SystemTimeOffset.Value = configurationFileFormat.SystemTimeOffset;
  870. System.EnableDockedMode.Value = configurationFileFormat.DockedMode;
  871. EnableDiscordIntegration.Value = configurationFileFormat.EnableDiscordIntegration;
  872. CheckUpdatesOnStart.Value = configurationFileFormat.CheckUpdatesOnStart;
  873. ShowConfirmExit.Value = configurationFileFormat.ShowConfirmExit;
  874. HideCursorOnIdle.Value = configurationFileFormat.HideCursorOnIdle;
  875. Graphics.EnableVsync.Value = configurationFileFormat.EnableVsync;
  876. Graphics.EnableShaderCache.Value = configurationFileFormat.EnableShaderCache;
  877. System.EnablePtc.Value = configurationFileFormat.EnablePtc;
  878. System.EnableInternetAccess.Value = configurationFileFormat.EnableInternetAccess;
  879. System.EnableFsIntegrityChecks.Value = configurationFileFormat.EnableFsIntegrityChecks;
  880. System.FsGlobalAccessLogMode.Value = configurationFileFormat.FsGlobalAccessLogMode;
  881. System.AudioBackend.Value = configurationFileFormat.AudioBackend;
  882. System.AudioVolume.Value = configurationFileFormat.AudioVolume;
  883. System.MemoryManagerMode.Value = configurationFileFormat.MemoryManagerMode;
  884. System.ExpandRam.Value = configurationFileFormat.ExpandRam;
  885. System.IgnoreMissingServices.Value = configurationFileFormat.IgnoreMissingServices;
  886. Ui.GuiColumns.FavColumn.Value = configurationFileFormat.GuiColumns.FavColumn;
  887. Ui.GuiColumns.IconColumn.Value = configurationFileFormat.GuiColumns.IconColumn;
  888. Ui.GuiColumns.AppColumn.Value = configurationFileFormat.GuiColumns.AppColumn;
  889. Ui.GuiColumns.DevColumn.Value = configurationFileFormat.GuiColumns.DevColumn;
  890. Ui.GuiColumns.VersionColumn.Value = configurationFileFormat.GuiColumns.VersionColumn;
  891. Ui.GuiColumns.TimePlayedColumn.Value = configurationFileFormat.GuiColumns.TimePlayedColumn;
  892. Ui.GuiColumns.LastPlayedColumn.Value = configurationFileFormat.GuiColumns.LastPlayedColumn;
  893. Ui.GuiColumns.FileExtColumn.Value = configurationFileFormat.GuiColumns.FileExtColumn;
  894. Ui.GuiColumns.FileSizeColumn.Value = configurationFileFormat.GuiColumns.FileSizeColumn;
  895. Ui.GuiColumns.PathColumn.Value = configurationFileFormat.GuiColumns.PathColumn;
  896. Ui.ColumnSort.SortColumnId.Value = configurationFileFormat.ColumnSort.SortColumnId;
  897. Ui.ColumnSort.SortAscending.Value = configurationFileFormat.ColumnSort.SortAscending;
  898. Ui.GameDirs.Value = configurationFileFormat.GameDirs;
  899. Ui.EnableCustomTheme.Value = configurationFileFormat.EnableCustomTheme;
  900. Ui.CustomThemePath.Value = configurationFileFormat.CustomThemePath;
  901. Ui.StartFullscreen.Value = configurationFileFormat.StartFullscreen;
  902. Hid.EnableKeyboard.Value = configurationFileFormat.EnableKeyboard;
  903. Hid.EnableMouse.Value = configurationFileFormat.EnableMouse;
  904. Hid.Hotkeys.Value = configurationFileFormat.Hotkeys;
  905. Hid.InputConfig.Value = configurationFileFormat.InputConfig;
  906. if (Hid.InputConfig.Value == null)
  907. {
  908. Hid.InputConfig.Value = new List<InputConfig>();
  909. }
  910. if (configurationFileUpdated)
  911. {
  912. ToFileFormat().SaveConfig(configurationFilePath);
  913. Common.Logging.Logger.Notice.Print(LogClass.Application, $"Configuration file updated to version {ConfigurationFileFormat.CurrentVersion}");
  914. }
  915. }
  916. private static void LogValueChange<T>(object sender, ReactiveEventArgs<T> eventArgs, string valueName)
  917. {
  918. Common.Logging.Logger.Info?.Print(LogClass.Configuration, $"{valueName} set to: {eventArgs.NewValue}");
  919. }
  920. public static void Initialize()
  921. {
  922. if (Instance != null)
  923. {
  924. throw new InvalidOperationException("Configuration is already initialized");
  925. }
  926. Instance = new ConfigurationState();
  927. }
  928. }
  929. }