From deb99d2cae3e80bdf70cb52c6c160094dc7c9292 Mon Sep 17 00:00:00 2001 From: Emmanuel Hansen Date: Sun, 15 May 2022 11:30:15 +0000 Subject: Avalonia UI - Part 1 (#3270) * avalonia part 1 * remove vulkan ui backend * move ui common files to ui common project * get name for oading screen from device * rebase. * review 1 * review 1.1 * review * cleanup * addressed review * use cancellation token * review * review * rebased * cancel library loading when closing window * remove star image, use fonticon instead * delete render control frame buffer when game ends. change position of fav star * addressed @Thog review * ensure the right ui is downloaded in updates * fix crash when showing not supported dialog during controller request * add prefix to artifact names * Auto-format Avalonia project * Fix input * Fix build, simplify app disposal * remove nv stutter thread * addressed review * add missing change * maintain window size if new size is zero length * add game, handheld, docked to local * reverse scale main window * Update de_DE.json * Update de_DE.json * Update de_DE.json * Update italian json * Update it_IT.json * let render timer poll with no wait * remove unused code * more unused code * enabled tiered compilation and trimming * check if window event is not closed before signaling * fix atmospher case * locale fix * locale fix * remove explicit tiered compilation declarations * Remove ) it_IT.json * Remove ) de_DE.json * Update it_IT.json * Update pt_BR locale with latest strings * Remove ')' * add more strings to locale * update locale * remove extra slash * remove extra slash * set firmware version to 0 if key's not found * fix * revert timer changes * lock on object instead * Update it_IT.json * remove unused method * add load screen text to locale * drop swap event * Update de_DE.json * Update de_DE.json * do null check when stopping emulator * Update de_DE.json * Create tr_TR.json * Add tr_TR * Add tr_TR + Turkish * Update it_IT.json * Update Ryujinx.Ava/Input/AvaloniaMappingHelper.cs Co-authored-by: Ac_K * Apply suggestions from code review Co-authored-by: Ac_K * Apply suggestions from code review Co-authored-by: Ac_K * addressed review * Update Ryujinx.Ava/Ui/Backend/OpenGl/OpenGlRenderTarget.cs Co-authored-by: gdkchan * use avalonia's inbuilt renderer on linux * removed whitespace * workaround for queue render crash with vsync off * drop custom backend * format files * fix not closing issue * remove warnings * rebase * update avalonia library * Reposition the Text and Button on About Page * Assign build version * Remove appveyor text Co-authored-by: gdk Co-authored-by: Niwu34 <67392333+Niwu34@users.noreply.github.com> Co-authored-by: Antonio Brugnolo <36473846+AntoSkate@users.noreply.github.com> Co-authored-by: aegiff <99728970+aegiff@users.noreply.github.com> Co-authored-by: Ac_K Co-authored-by: MostlyWhat <78652091+MostlyWhat@users.noreply.github.com> --- .../Configuration/ConfigurationFileFormat.cs | 343 +++++++++++++++++++++ 1 file changed, 343 insertions(+) create mode 100644 Ryujinx.Ui.Common/Configuration/ConfigurationFileFormat.cs (limited to 'Ryujinx.Ui.Common/Configuration/ConfigurationFileFormat.cs') diff --git a/Ryujinx.Ui.Common/Configuration/ConfigurationFileFormat.cs b/Ryujinx.Ui.Common/Configuration/ConfigurationFileFormat.cs new file mode 100644 index 00000000..28a2956a --- /dev/null +++ b/Ryujinx.Ui.Common/Configuration/ConfigurationFileFormat.cs @@ -0,0 +1,343 @@ +using Ryujinx.Common.Configuration; +using Ryujinx.Common.Configuration.Hid; +using Ryujinx.Common.Logging; +using Ryujinx.Common.Utilities; +using Ryujinx.Ui.Common.Configuration.System; +using Ryujinx.Ui.Common.Configuration.Ui; +using System.Collections.Generic; +using System.IO; + +namespace Ryujinx.Ui.Common.Configuration +{ + public class ConfigurationFileFormat + { + /// + /// The current version of the file format + /// + public const int CurrentVersion = 38; + + /// + /// Version of the configuration file format + /// + public int Version { get; set; } + + /// + /// Enables or disables logging to a file on disk + /// + public bool EnableFileLog { get; set; } + + /// + /// Whether or not backend threading is enabled. The "Auto" setting will determine whether threading should be enabled at runtime. + /// + public BackendThreading BackendThreading { get; set; } + + /// + /// Resolution Scale. An integer scale applied to applicable render targets. Values 1-4, or -1 to use a custom floating point scale instead. + /// + public int ResScale { get; set; } + + /// + /// Custom Resolution Scale. A custom floating point scale applied to applicable render targets. Only active when Resolution Scale is -1. + /// + public float ResScaleCustom { get; set; } + + /// + /// Max Anisotropy. Values range from 0 - 16. Set to -1 to let the game decide. + /// + public float MaxAnisotropy { get; set; } + + /// + /// Aspect Ratio applied to the renderer window. + /// + public AspectRatio AspectRatio { get; set; } + + /// + /// Dumps shaders in this local directory + /// + public string GraphicsShadersDumpPath { get; set; } + + /// + /// Enables printing debug log messages + /// + public bool LoggingEnableDebug { get; set; } + + /// + /// Enables printing stub log messages + /// + public bool LoggingEnableStub { get; set; } + + /// + /// Enables printing info log messages + /// + public bool LoggingEnableInfo { get; set; } + + /// + /// Enables printing warning log messages + /// + public bool LoggingEnableWarn { get; set; } + + /// + /// Enables printing error log messages + /// + public bool LoggingEnableError { get; set; } + + /// + /// Enables printing trace log messages + /// + public bool LoggingEnableTrace { get; set; } + + /// + /// Enables printing guest log messages + /// + public bool LoggingEnableGuest { get; set; } + + /// + /// Enables printing FS access log messages + /// + public bool LoggingEnableFsAccessLog { get; set; } + + /// + /// Controls which log messages are written to the log targets + /// + public LogClass[] LoggingFilteredClasses { get; set; } + + /// + /// Change Graphics API debug log level + /// + public GraphicsDebugLevel LoggingGraphicsDebugLevel { get; set; } + + /// + /// Change System Language + /// + public Language SystemLanguage { get; set; } + + /// + /// Change System Region + /// + public Region SystemRegion { get; set; } + + /// + /// Change System TimeZone + /// + public string SystemTimeZone { get; set; } + + /// + /// Change System Time Offset in seconds + /// + public long SystemTimeOffset { get; set; } + + /// + /// Enables or disables Docked Mode + /// + public bool DockedMode { get; set; } + + /// + /// Enables or disables Discord Rich Presence + /// + public bool EnableDiscordIntegration { get; set; } + + /// + /// Checks for updates when Ryujinx starts when enabled + /// + public bool CheckUpdatesOnStart { get; set; } + + /// + /// Show "Confirm Exit" Dialog + /// + public bool ShowConfirmExit { get; set; } + + /// + /// Hide Cursor on Idle + /// + public bool HideCursorOnIdle { get; set; } + + /// + /// Enables or disables Vertical Sync + /// + public bool EnableVsync { get; set; } + + /// + /// Enables or disables Shader cache + /// + public bool EnableShaderCache { get; set; } + + /// + /// Enables or disables profiled translation cache persistency + /// + public bool EnablePtc { get; set; } + + /// + /// Enables or disables guest Internet access + /// + public bool EnableInternetAccess { get; set; } + + /// + /// Enables integrity checks on Game content files + /// + public bool EnableFsIntegrityChecks { get; set; } + + /// + /// Enables FS access log output to the console. Possible modes are 0-3 + /// + public int FsGlobalAccessLogMode { get; set; } + + /// + /// The selected audio backend + /// + public AudioBackend AudioBackend { get; set; } + + /// + /// The audio volume + /// + public float AudioVolume { get; set; } + + /// + /// The selected memory manager mode + /// + public MemoryManagerMode MemoryManagerMode { get; set; } + + /// + /// Expands the RAM amount on the emulated system from 4GB to 6GB + /// + public bool ExpandRam { get; set; } + + /// + /// Enable or disable ignoring missing services + /// + public bool IgnoreMissingServices { get; set; } + + /// + /// Used to toggle columns in the GUI + /// + public GuiColumns GuiColumns { get; set; } + + /// + /// Used to configure column sort settings in the GUI + /// + public ColumnSort ColumnSort { get; set; } + + /// + /// A list of directories containing games to be used to load games into the games list + /// + public List GameDirs { get; set; } + + /// + /// Language Code for the UI + /// + public string LanguageCode { get; set; } + + /// + /// Enable or disable custom themes in the GUI + /// + public bool EnableCustomTheme { get; set; } + + /// + /// Path to custom GUI theme + /// + public string CustomThemePath { get; set; } + + /// + /// Chooses the base style // Not Used + /// + public string BaseStyle { get; set; } + + /// + /// Chooses the view mode of the game list // Not Used + /// + public int GameListViewMode { get; set; } + + /// + /// Show application name in Grid Mode // Not Used + /// + public bool ShowNames { get; set; } + + /// + /// Sets App Icon Size // Not Used + /// + public int GridSize { get; set; } + + /// + /// Sorts Apps in the game list // Not Used + /// + public int ApplicationSort { get; set; } + + /// + /// Sets if Grid is ordered in Ascending Order // Not Used + /// + public bool IsAscendingOrder { get; set; } + + /// + /// Start games in fullscreen mode + /// + public bool StartFullscreen { get; set; } + + /// + /// Show console window + /// + public bool ShowConsole { get; set; } + + /// + /// Enable or disable keyboard support (Independent from controllers binding) + /// + public bool EnableKeyboard { get; set; } + + /// + /// Enable or disable mouse support (Independent from controllers binding) + /// + public bool EnableMouse { get; set; } + + /// + /// Hotkey Keyboard Bindings + /// + public KeyboardHotkeys Hotkeys { get; set; } + + /// + /// Legacy keyboard control bindings + /// + /// Kept for file format compatibility (to avoid possible failure when parsing configuration on old versions) + /// TODO: Remove this when those older versions aren't in use anymore. + public List KeyboardConfig { get; set; } + + /// + /// Legacy controller control bindings + /// + /// Kept for file format compatibility (to avoid possible failure when parsing configuration on old versions) + /// TODO: Remove this when those older versions aren't in use anymore. + public List ControllerConfig { get; set; } + + /// + /// Input configurations + /// + public List InputConfig { get; set; } + + /// + /// Loads a configuration file from disk + /// + /// The path to the JSON configuration file + public static bool TryLoad(string path, out ConfigurationFileFormat configurationFileFormat) + { + try + { + configurationFileFormat = JsonHelper.DeserializeFromFile(path); + + return true; + } + catch + { + configurationFileFormat = null; + + return false; + } + } + + /// + /// Save a configuration file to disk + /// + /// The path to the JSON configuration file + public void SaveConfig(string path) + { + using FileStream fileStream = File.Create(path, 4096, FileOptions.WriteThrough); + JsonHelper.Serialize(fileStream, this, true); + } + } +} -- cgit v1.2.3