ConfigurationState.Model.cs 28 KB

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