ConfigurationState.Model.cs 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674
  1. using Ryujinx.Common;
  2. using Ryujinx.Common.Configuration;
  3. using Ryujinx.Common.Configuration.Hid;
  4. using Ryujinx.Common.Configuration.Multiplayer;
  5. using Ryujinx.Common.Logging;
  6. using Ryujinx.HLE;
  7. using Ryujinx.UI.Common.Configuration.System;
  8. using Ryujinx.UI.Common.Helper;
  9. using System.Collections.Generic;
  10. namespace Ryujinx.UI.Common.Configuration
  11. {
  12. public partial class ConfigurationState
  13. {
  14. /// <summary>
  15. /// UI configuration section
  16. /// </summary>
  17. public class UISection
  18. {
  19. public class Columns
  20. {
  21. public ReactiveObject<bool> FavColumn { get; private set; }
  22. public ReactiveObject<bool> IconColumn { get; private set; }
  23. public ReactiveObject<bool> AppColumn { get; private set; }
  24. public ReactiveObject<bool> DevColumn { get; private set; }
  25. public ReactiveObject<bool> VersionColumn { get; private set; }
  26. public ReactiveObject<bool> TimePlayedColumn { get; private set; }
  27. public ReactiveObject<bool> LastPlayedColumn { get; private set; }
  28. public ReactiveObject<bool> FileExtColumn { get; private set; }
  29. public ReactiveObject<bool> FileSizeColumn { get; private set; }
  30. public ReactiveObject<bool> PathColumn { get; private set; }
  31. public Columns()
  32. {
  33. FavColumn = new ReactiveObject<bool>();
  34. IconColumn = new ReactiveObject<bool>();
  35. AppColumn = new ReactiveObject<bool>();
  36. DevColumn = new ReactiveObject<bool>();
  37. VersionColumn = new ReactiveObject<bool>();
  38. TimePlayedColumn = new ReactiveObject<bool>();
  39. LastPlayedColumn = new ReactiveObject<bool>();
  40. FileExtColumn = new ReactiveObject<bool>();
  41. FileSizeColumn = new ReactiveObject<bool>();
  42. PathColumn = new ReactiveObject<bool>();
  43. }
  44. }
  45. public class ColumnSortSettings
  46. {
  47. public ReactiveObject<int> SortColumnId { get; private set; }
  48. public ReactiveObject<bool> SortAscending { get; private set; }
  49. public ColumnSortSettings()
  50. {
  51. SortColumnId = new ReactiveObject<int>();
  52. SortAscending = new ReactiveObject<bool>();
  53. }
  54. }
  55. /// <summary>
  56. /// Used to toggle which file types are shown in the UI
  57. /// </summary>
  58. public class ShownFileTypeSettings
  59. {
  60. public ReactiveObject<bool> NSP { get; private set; }
  61. public ReactiveObject<bool> PFS0 { get; private set; }
  62. public ReactiveObject<bool> XCI { get; private set; }
  63. public ReactiveObject<bool> NCA { get; private set; }
  64. public ReactiveObject<bool> NRO { get; private set; }
  65. public ReactiveObject<bool> NSO { get; private set; }
  66. public ShownFileTypeSettings()
  67. {
  68. NSP = new ReactiveObject<bool>();
  69. PFS0 = new ReactiveObject<bool>();
  70. XCI = new ReactiveObject<bool>();
  71. NCA = new ReactiveObject<bool>();
  72. NRO = new ReactiveObject<bool>();
  73. NSO = new ReactiveObject<bool>();
  74. }
  75. }
  76. // <summary>
  77. /// Determines main window start-up position, size and state
  78. ///<summary>
  79. public class WindowStartupSettings
  80. {
  81. public ReactiveObject<int> WindowSizeWidth { get; private set; }
  82. public ReactiveObject<int> WindowSizeHeight { get; private set; }
  83. public ReactiveObject<int> WindowPositionX { get; private set; }
  84. public ReactiveObject<int> WindowPositionY { get; private set; }
  85. public ReactiveObject<bool> WindowMaximized { get; private set; }
  86. public WindowStartupSettings()
  87. {
  88. WindowSizeWidth = new ReactiveObject<int>();
  89. WindowSizeHeight = new ReactiveObject<int>();
  90. WindowPositionX = new ReactiveObject<int>();
  91. WindowPositionY = new ReactiveObject<int>();
  92. WindowMaximized = new ReactiveObject<bool>();
  93. }
  94. }
  95. /// <summary>
  96. /// Used to toggle columns in the GUI
  97. /// </summary>
  98. public Columns GuiColumns { get; private set; }
  99. /// <summary>
  100. /// Used to configure column sort settings in the GUI
  101. /// </summary>
  102. public ColumnSortSettings ColumnSort { get; private set; }
  103. /// <summary>
  104. /// A list of directories containing games to be used to load games into the games list
  105. /// </summary>
  106. public ReactiveObject<List<string>> GameDirs { get; private set; }
  107. /// <summary>
  108. /// A list of directories containing DLC/updates the user wants to autoload during library refreshes
  109. /// </summary>
  110. public ReactiveObject<List<string>> AutoloadDirs { get; private set; }
  111. /// <summary>
  112. /// A list of file types to be hidden in the games List
  113. /// </summary>
  114. public ShownFileTypeSettings ShownFileTypes { get; private set; }
  115. /// <summary>
  116. /// Determines main window start-up position, size and state
  117. /// </summary>
  118. public WindowStartupSettings WindowStartup { get; private set; }
  119. /// <summary>
  120. /// Language Code for the UI
  121. /// </summary>
  122. public ReactiveObject<string> LanguageCode { get; private set; }
  123. /// <summary>
  124. /// Selects the base style
  125. /// </summary>
  126. public ReactiveObject<string> BaseStyle { get; private set; }
  127. /// <summary>
  128. /// Start games in fullscreen mode
  129. /// </summary>
  130. public ReactiveObject<bool> StartFullscreen { get; private set; }
  131. /// <summary>
  132. /// Hide / Show Console Window
  133. /// </summary>
  134. public ReactiveObject<bool> ShowConsole { get; private set; }
  135. /// <summary>
  136. /// View Mode of the Game list
  137. /// </summary>
  138. public ReactiveObject<int> GameListViewMode { get; private set; }
  139. /// <summary>
  140. /// Show application name in Grid Mode
  141. /// </summary>
  142. public ReactiveObject<bool> ShowNames { get; private set; }
  143. /// <summary>
  144. /// Sets App Icon Size in Grid Mode
  145. /// </summary>
  146. public ReactiveObject<int> GridSize { get; private set; }
  147. /// <summary>
  148. /// Sorts Apps in Grid Mode
  149. /// </summary>
  150. public ReactiveObject<int> ApplicationSort { get; private set; }
  151. /// <summary>
  152. /// Sets if Grid is ordered in Ascending Order
  153. /// </summary>
  154. public ReactiveObject<bool> IsAscendingOrder { get; private set; }
  155. public UISection()
  156. {
  157. GuiColumns = new Columns();
  158. ColumnSort = new ColumnSortSettings();
  159. GameDirs = new ReactiveObject<List<string>>();
  160. AutoloadDirs = new ReactiveObject<List<string>>();
  161. ShownFileTypes = new ShownFileTypeSettings();
  162. WindowStartup = new WindowStartupSettings();
  163. BaseStyle = new ReactiveObject<string>();
  164. StartFullscreen = new ReactiveObject<bool>();
  165. GameListViewMode = new ReactiveObject<int>();
  166. ShowNames = new ReactiveObject<bool>();
  167. GridSize = new ReactiveObject<int>();
  168. ApplicationSort = new ReactiveObject<int>();
  169. IsAscendingOrder = new ReactiveObject<bool>();
  170. LanguageCode = new ReactiveObject<string>();
  171. ShowConsole = new ReactiveObject<bool>();
  172. ShowConsole.Event += static (_, e) => ConsoleHelper.SetConsoleWindowState(e.NewValue);
  173. }
  174. }
  175. /// <summary>
  176. /// Logger configuration section
  177. /// </summary>
  178. public class LoggerSection
  179. {
  180. /// <summary>
  181. /// Enables printing debug log messages
  182. /// </summary>
  183. public ReactiveObject<bool> EnableDebug { get; private set; }
  184. /// <summary>
  185. /// Enables printing stub log messages
  186. /// </summary>
  187. public ReactiveObject<bool> EnableStub { get; private set; }
  188. /// <summary>
  189. /// Enables printing info log messages
  190. /// </summary>
  191. public ReactiveObject<bool> EnableInfo { get; private set; }
  192. /// <summary>
  193. /// Enables printing warning log messages
  194. /// </summary>
  195. public ReactiveObject<bool> EnableWarn { get; private set; }
  196. /// <summary>
  197. /// Enables printing error log messages
  198. /// </summary>
  199. public ReactiveObject<bool> EnableError { get; private set; }
  200. /// <summary>
  201. /// Enables printing trace log messages
  202. /// </summary>
  203. public ReactiveObject<bool> EnableTrace { get; private set; }
  204. /// <summary>
  205. /// Enables printing guest log messages
  206. /// </summary>
  207. public ReactiveObject<bool> EnableGuest { get; private set; }
  208. /// <summary>
  209. /// Enables printing FS access log messages
  210. /// </summary>
  211. public ReactiveObject<bool> EnableFsAccessLog { get; private set; }
  212. /// <summary>
  213. /// Controls which log messages are written to the log targets
  214. /// </summary>
  215. public ReactiveObject<LogClass[]> FilteredClasses { get; private set; }
  216. /// <summary>
  217. /// Enables or disables logging to a file on disk
  218. /// </summary>
  219. public ReactiveObject<bool> EnableFileLog { get; private set; }
  220. /// <summary>
  221. /// Controls which OpenGL log messages are recorded in the log
  222. /// </summary>
  223. public ReactiveObject<GraphicsDebugLevel> GraphicsDebugLevel { get; private set; }
  224. public LoggerSection()
  225. {
  226. EnableDebug = new ReactiveObject<bool>();
  227. EnableDebug.LogChangesToValue(nameof(EnableDebug));
  228. EnableStub = new ReactiveObject<bool>();
  229. EnableInfo = new ReactiveObject<bool>();
  230. EnableWarn = new ReactiveObject<bool>();
  231. EnableError = new ReactiveObject<bool>();
  232. EnableTrace = new ReactiveObject<bool>();
  233. EnableGuest = new ReactiveObject<bool>();
  234. EnableFsAccessLog = new ReactiveObject<bool>();
  235. FilteredClasses = new ReactiveObject<LogClass[]>();
  236. EnableFileLog = new ReactiveObject<bool>();
  237. EnableFileLog.LogChangesToValue(nameof(EnableFileLog));
  238. GraphicsDebugLevel = new ReactiveObject<GraphicsDebugLevel>();
  239. }
  240. }
  241. /// <summary>
  242. /// System configuration section
  243. /// </summary>
  244. public class SystemSection
  245. {
  246. /// <summary>
  247. /// Change System Language
  248. /// </summary>
  249. public ReactiveObject<Language> Language { get; private set; }
  250. /// <summary>
  251. /// Change System Region
  252. /// </summary>
  253. public ReactiveObject<Region> Region { get; private set; }
  254. /// <summary>
  255. /// Change System TimeZone
  256. /// </summary>
  257. public ReactiveObject<string> TimeZone { get; private set; }
  258. /// <summary>
  259. /// System Time Offset in Seconds
  260. /// </summary>
  261. public ReactiveObject<long> SystemTimeOffset { get; private set; }
  262. /// <summary>
  263. /// Enables or disables Docked Mode
  264. /// </summary>
  265. public ReactiveObject<bool> EnableDockedMode { get; private set; }
  266. /// <summary>
  267. /// Enables or disables persistent profiled translation cache
  268. /// </summary>
  269. public ReactiveObject<bool> EnablePtc { get; private set; }
  270. /// <summary>
  271. /// Enables or disables low-power persistent profiled translation cache loading
  272. /// </summary>
  273. public ReactiveObject<bool> EnableLowPowerPtc { get; private set; }
  274. /// <summary>
  275. /// Enables or disables guest Internet access
  276. /// </summary>
  277. public ReactiveObject<bool> EnableInternetAccess { get; private set; }
  278. /// <summary>
  279. /// Enables integrity checks on Game content files
  280. /// </summary>
  281. public ReactiveObject<bool> EnableFsIntegrityChecks { get; private set; }
  282. /// <summary>
  283. /// Enables FS access log output to the console. Possible modes are 0-3
  284. /// </summary>
  285. public ReactiveObject<int> FsGlobalAccessLogMode { get; private set; }
  286. /// <summary>
  287. /// The selected audio backend
  288. /// </summary>
  289. public ReactiveObject<AudioBackend> AudioBackend { get; private set; }
  290. /// <summary>
  291. /// The audio backend volume
  292. /// </summary>
  293. public ReactiveObject<float> AudioVolume { get; private set; }
  294. /// <summary>
  295. /// The selected memory manager mode
  296. /// </summary>
  297. public ReactiveObject<MemoryManagerMode> MemoryManagerMode { get; private set; }
  298. /// <summary>
  299. /// Defines the amount of RAM available on the emulated system, and how it is distributed
  300. /// </summary>
  301. public ReactiveObject<MemoryConfiguration> DramSize { get; private set; }
  302. /// <summary>
  303. /// Enable or disable ignoring missing services
  304. /// </summary>
  305. public ReactiveObject<bool> IgnoreMissingServices { get; private set; }
  306. /// <summary>
  307. /// Uses Hypervisor over JIT if available
  308. /// </summary>
  309. public ReactiveObject<bool> UseHypervisor { get; private set; }
  310. public SystemSection()
  311. {
  312. Language = new ReactiveObject<Language>();
  313. Language.LogChangesToValue(nameof(Language));
  314. Region = new ReactiveObject<Region>();
  315. Region.LogChangesToValue(nameof(Region));
  316. TimeZone = new ReactiveObject<string>();
  317. TimeZone.LogChangesToValue(nameof(TimeZone));
  318. SystemTimeOffset = new ReactiveObject<long>();
  319. SystemTimeOffset.LogChangesToValue(nameof(SystemTimeOffset));
  320. EnableDockedMode = new ReactiveObject<bool>();
  321. EnableDockedMode.LogChangesToValue(nameof(EnableDockedMode));
  322. EnablePtc = new ReactiveObject<bool>();
  323. EnablePtc.LogChangesToValue(nameof(EnablePtc));
  324. EnableLowPowerPtc = new ReactiveObject<bool>();
  325. EnableLowPowerPtc.LogChangesToValue(nameof(EnableLowPowerPtc));
  326. EnableInternetAccess = new ReactiveObject<bool>();
  327. EnableInternetAccess.LogChangesToValue(nameof(EnableInternetAccess));
  328. EnableFsIntegrityChecks = new ReactiveObject<bool>();
  329. EnableFsIntegrityChecks.LogChangesToValue(nameof(EnableFsIntegrityChecks));
  330. FsGlobalAccessLogMode = new ReactiveObject<int>();
  331. FsGlobalAccessLogMode.LogChangesToValue(nameof(FsGlobalAccessLogMode));
  332. AudioBackend = new ReactiveObject<AudioBackend>();
  333. AudioBackend.LogChangesToValue(nameof(AudioBackend));
  334. MemoryManagerMode = new ReactiveObject<MemoryManagerMode>();
  335. MemoryManagerMode.LogChangesToValue(nameof(MemoryManagerMode));
  336. DramSize = new ReactiveObject<MemoryConfiguration>();
  337. DramSize.LogChangesToValue(nameof(DramSize));
  338. IgnoreMissingServices = new ReactiveObject<bool>();
  339. IgnoreMissingServices.LogChangesToValue(nameof(IgnoreMissingServices));
  340. AudioVolume = new ReactiveObject<float>();
  341. AudioVolume.LogChangesToValue(nameof(AudioVolume));
  342. UseHypervisor = new ReactiveObject<bool>();
  343. UseHypervisor.LogChangesToValue(nameof(UseHypervisor));
  344. }
  345. }
  346. /// <summary>
  347. /// Hid configuration section
  348. /// </summary>
  349. public class HidSection
  350. {
  351. /// <summary>
  352. /// Enable or disable keyboard support (Independent from controllers binding)
  353. /// </summary>
  354. public ReactiveObject<bool> EnableKeyboard { get; private set; }
  355. /// <summary>
  356. /// Enable or disable mouse support (Independent from controllers binding)
  357. /// </summary>
  358. public ReactiveObject<bool> EnableMouse { get; private set; }
  359. /// <summary>
  360. /// Hotkey Keyboard Bindings
  361. /// </summary>
  362. public ReactiveObject<KeyboardHotkeys> Hotkeys { get; private set; }
  363. /// <summary>
  364. /// Input device configuration.
  365. /// NOTE: This ReactiveObject won't issue an event when the List has elements added or removed.
  366. /// TODO: Implement a ReactiveList class.
  367. /// </summary>
  368. public ReactiveObject<List<InputConfig>> InputConfig { get; private set; }
  369. public HidSection()
  370. {
  371. EnableKeyboard = new ReactiveObject<bool>();
  372. EnableMouse = new ReactiveObject<bool>();
  373. Hotkeys = new ReactiveObject<KeyboardHotkeys>();
  374. InputConfig = new ReactiveObject<List<InputConfig>>();
  375. }
  376. }
  377. /// <summary>
  378. /// Graphics configuration section
  379. /// </summary>
  380. public class GraphicsSection
  381. {
  382. /// <summary>
  383. /// Whether or not backend threading is enabled. The "Auto" setting will determine whether threading should be enabled at runtime.
  384. /// </summary>
  385. public ReactiveObject<BackendThreading> BackendThreading { get; private set; }
  386. /// <summary>
  387. /// Max Anisotropy. Values range from 0 - 16. Set to -1 to let the game decide.
  388. /// </summary>
  389. public ReactiveObject<float> MaxAnisotropy { get; private set; }
  390. /// <summary>
  391. /// Aspect Ratio applied to the renderer window.
  392. /// </summary>
  393. public ReactiveObject<AspectRatio> AspectRatio { get; private set; }
  394. /// <summary>
  395. /// Resolution Scale. An integer scale applied to applicable render targets. Values 1-4, or -1 to use a custom floating point scale instead.
  396. /// </summary>
  397. public ReactiveObject<int> ResScale { get; private set; }
  398. /// <summary>
  399. /// Custom Resolution Scale. A custom floating point scale applied to applicable render targets. Only active when Resolution Scale is -1.
  400. /// </summary>
  401. public ReactiveObject<float> ResScaleCustom { get; private set; }
  402. /// <summary>
  403. /// Dumps shaders in this local directory
  404. /// </summary>
  405. public ReactiveObject<string> ShadersDumpPath { get; private set; }
  406. /// <summary>
  407. /// Enables or disables Vertical Sync
  408. /// </summary>
  409. public ReactiveObject<bool> EnableVsync { get; private set; }
  410. /// <summary>
  411. /// Enables or disables Shader cache
  412. /// </summary>
  413. public ReactiveObject<bool> EnableShaderCache { get; private set; }
  414. /// <summary>
  415. /// Enables or disables texture recompression
  416. /// </summary>
  417. public ReactiveObject<bool> EnableTextureRecompression { get; private set; }
  418. /// <summary>
  419. /// Enables or disables Macro high-level emulation
  420. /// </summary>
  421. public ReactiveObject<bool> EnableMacroHLE { get; private set; }
  422. /// <summary>
  423. /// Enables or disables color space passthrough, if available.
  424. /// </summary>
  425. public ReactiveObject<bool> EnableColorSpacePassthrough { get; private set; }
  426. /// <summary>
  427. /// Graphics backend
  428. /// </summary>
  429. public ReactiveObject<GraphicsBackend> GraphicsBackend { get; private set; }
  430. /// <summary>
  431. /// Applies anti-aliasing to the renderer.
  432. /// </summary>
  433. public ReactiveObject<AntiAliasing> AntiAliasing { get; private set; }
  434. /// <summary>
  435. /// Sets the framebuffer upscaling type.
  436. /// </summary>
  437. public ReactiveObject<ScalingFilter> ScalingFilter { get; private set; }
  438. /// <summary>
  439. /// Sets the framebuffer upscaling level.
  440. /// </summary>
  441. public ReactiveObject<int> ScalingFilterLevel { get; private set; }
  442. /// <summary>
  443. /// Preferred GPU
  444. /// </summary>
  445. public ReactiveObject<string> PreferredGpu { get; private set; }
  446. public GraphicsSection()
  447. {
  448. BackendThreading = new ReactiveObject<BackendThreading>();
  449. BackendThreading.LogChangesToValue(nameof(BackendThreading));
  450. ResScale = new ReactiveObject<int>();
  451. ResScale.LogChangesToValue(nameof(ResScale));
  452. ResScaleCustom = new ReactiveObject<float>();
  453. ResScaleCustom.LogChangesToValue(nameof(ResScaleCustom));
  454. MaxAnisotropy = new ReactiveObject<float>();
  455. MaxAnisotropy.LogChangesToValue(nameof(MaxAnisotropy));
  456. AspectRatio = new ReactiveObject<AspectRatio>();
  457. AspectRatio.LogChangesToValue(nameof(AspectRatio));
  458. ShadersDumpPath = new ReactiveObject<string>();
  459. EnableVsync = new ReactiveObject<bool>();
  460. EnableVsync.LogChangesToValue(nameof(EnableVsync));
  461. EnableShaderCache = new ReactiveObject<bool>();
  462. EnableShaderCache.LogChangesToValue(nameof(EnableShaderCache));
  463. EnableTextureRecompression = new ReactiveObject<bool>();
  464. EnableTextureRecompression.LogChangesToValue(nameof(EnableTextureRecompression));
  465. GraphicsBackend = new ReactiveObject<GraphicsBackend>();
  466. GraphicsBackend.LogChangesToValue(nameof(GraphicsBackend));
  467. PreferredGpu = new ReactiveObject<string>();
  468. PreferredGpu.LogChangesToValue(nameof(PreferredGpu));
  469. EnableMacroHLE = new ReactiveObject<bool>();
  470. EnableMacroHLE.LogChangesToValue(nameof(EnableMacroHLE));
  471. EnableColorSpacePassthrough = new ReactiveObject<bool>();
  472. EnableColorSpacePassthrough.LogChangesToValue(nameof(EnableColorSpacePassthrough));
  473. AntiAliasing = new ReactiveObject<AntiAliasing>();
  474. AntiAliasing.LogChangesToValue(nameof(AntiAliasing));
  475. ScalingFilter = new ReactiveObject<ScalingFilter>();
  476. ScalingFilter.LogChangesToValue(nameof(ScalingFilter));
  477. ScalingFilterLevel = new ReactiveObject<int>();
  478. ScalingFilterLevel.LogChangesToValue(nameof(ScalingFilterLevel));
  479. }
  480. }
  481. /// <summary>
  482. /// Multiplayer configuration section
  483. /// </summary>
  484. public class MultiplayerSection
  485. {
  486. /// <summary>
  487. /// GUID for the network interface used by LAN (or 0 for default)
  488. /// </summary>
  489. public ReactiveObject<string> LanInterfaceId { get; private set; }
  490. /// <summary>
  491. /// Multiplayer Mode
  492. /// </summary>
  493. public ReactiveObject<MultiplayerMode> Mode { get; private set; }
  494. public MultiplayerSection()
  495. {
  496. LanInterfaceId = new ReactiveObject<string>();
  497. Mode = new ReactiveObject<MultiplayerMode>();
  498. Mode.LogChangesToValue(nameof(MultiplayerMode));
  499. }
  500. }
  501. /// <summary>
  502. /// The default configuration instance
  503. /// </summary>
  504. public static ConfigurationState Instance { get; private set; }
  505. /// <summary>
  506. /// The UI section
  507. /// </summary>
  508. public UISection UI { get; private set; }
  509. /// <summary>
  510. /// The Logger section
  511. /// </summary>
  512. public LoggerSection Logger { get; private set; }
  513. /// <summary>
  514. /// The System section
  515. /// </summary>
  516. public SystemSection System { get; private set; }
  517. /// <summary>
  518. /// The Graphics section
  519. /// </summary>
  520. public GraphicsSection Graphics { get; private set; }
  521. /// <summary>
  522. /// The Hid section
  523. /// </summary>
  524. public HidSection Hid { get; private set; }
  525. /// <summary>
  526. /// The Multiplayer section
  527. /// </summary>
  528. public MultiplayerSection Multiplayer { get; private set; }
  529. /// <summary>
  530. /// Enables or disables Discord Rich Presence
  531. /// </summary>
  532. public ReactiveObject<bool> EnableDiscordIntegration { get; private set; }
  533. /// <summary>
  534. /// Checks for updates when Ryujinx starts when enabled
  535. /// </summary>
  536. public ReactiveObject<bool> CheckUpdatesOnStart { get; private set; }
  537. /// <summary>
  538. /// Show "Confirm Exit" Dialog
  539. /// </summary>
  540. public ReactiveObject<bool> ShowConfirmExit { get; private set; }
  541. /// <summary>
  542. /// Ignore Applet
  543. /// </summary>
  544. public ReactiveObject<bool> IgnoreApplet { get; private set; }
  545. /// <summary>
  546. /// Enables or disables save window size, position and state on close.
  547. /// </summary>
  548. public ReactiveObject<bool> RememberWindowState { get; private set; }
  549. /// <summary>
  550. /// Enables or disables the redesigned title bar
  551. /// </summary>
  552. public ReactiveObject<bool> ShowTitleBar { get; private set; }
  553. /// <summary>
  554. /// Enables hardware-accelerated rendering for Avalonia
  555. /// </summary>
  556. public ReactiveObject<bool> EnableHardwareAcceleration { get; private set; }
  557. /// <summary>
  558. /// Hide Cursor on Idle
  559. /// </summary>
  560. public ReactiveObject<HideCursorMode> HideCursor { get; private set; }
  561. private ConfigurationState()
  562. {
  563. UI = new UISection();
  564. Logger = new LoggerSection();
  565. System = new SystemSection();
  566. Graphics = new GraphicsSection();
  567. Hid = new HidSection();
  568. Multiplayer = new MultiplayerSection();
  569. EnableDiscordIntegration = new ReactiveObject<bool>();
  570. CheckUpdatesOnStart = new ReactiveObject<bool>();
  571. ShowConfirmExit = new ReactiveObject<bool>();
  572. IgnoreApplet = new ReactiveObject<bool>();
  573. IgnoreApplet.LogChangesToValue(nameof(IgnoreApplet));
  574. RememberWindowState = new ReactiveObject<bool>();
  575. ShowTitleBar = new ReactiveObject<bool>();
  576. EnableHardwareAcceleration = new ReactiveObject<bool>();
  577. HideCursor = new ReactiveObject<HideCursorMode>();
  578. }
  579. }
  580. }