diff options
Diffstat (limited to 'Ryujinx.Ui.Common/Configuration/ConfigurationState.cs')
-rw-r--r-- | Ryujinx.Ui.Common/Configuration/ConfigurationState.cs | 51 |
1 files changed, 43 insertions, 8 deletions
diff --git a/Ryujinx.Ui.Common/Configuration/ConfigurationState.cs b/Ryujinx.Ui.Common/Configuration/ConfigurationState.cs index 12cc1b8f..3a68cc26 100644 --- a/Ryujinx.Ui.Common/Configuration/ConfigurationState.cs +++ b/Ryujinx.Ui.Common/Configuration/ConfigurationState.cs @@ -518,6 +518,22 @@ namespace Ryujinx.Ui.Common.Configuration } /// <summary> + /// Multiplayer configuration section + /// </summary> + public class MultiplayerSection + { + /// <summary> + /// GUID for the network interface used by LAN (or 0 for default) + /// </summary> + public ReactiveObject<string> LanInterfaceId { get; private set; } + + public MultiplayerSection() + { + LanInterfaceId = new ReactiveObject<string>(); + } + } + + /// <summary> /// The default configuration instance /// </summary> public static ConfigurationState Instance { get; private set; } @@ -548,6 +564,11 @@ namespace Ryujinx.Ui.Common.Configuration public HidSection Hid { get; private set; } /// <summary> + /// The Multiplayer section + /// </summary> + public MultiplayerSection Multiplayer { get; private set; } + + /// <summary> /// Enables or disables Discord Rich Presence /// </summary> public ReactiveObject<bool> EnableDiscordIntegration { get; private set; } @@ -574,6 +595,7 @@ namespace Ryujinx.Ui.Common.Configuration System = new SystemSection(); Graphics = new GraphicsSection(); Hid = new HidSection(); + Multiplayer = new MultiplayerSection(); EnableDiscordIntegration = new ReactiveObject<bool>(); CheckUpdatesOnStart = new ReactiveObject<bool>(); ShowConfirmExit = new ReactiveObject<bool>(); @@ -674,7 +696,8 @@ namespace Ryujinx.Ui.Common.Configuration ControllerConfig = new List<JsonObject>(), InputConfig = Hid.InputConfig, GraphicsBackend = Graphics.GraphicsBackend, - PreferredGpu = Graphics.PreferredGpu + PreferredGpu = Graphics.PreferredGpu, + MultiplayerLanInterfaceId = Multiplayer.LanInterfaceId }; return configurationFile; @@ -727,6 +750,7 @@ namespace Ryujinx.Ui.Common.Configuration System.ExpandRam.Value = false; System.IgnoreMissingServices.Value = false; System.UseHypervisor.Value = true; + Multiplayer.LanInterfaceId.Value = "0"; Ui.GuiColumns.FavColumn.Value = true; Ui.GuiColumns.IconColumn.Value = true; Ui.GuiColumns.AppColumn.Value = true; @@ -1308,6 +1332,15 @@ namespace Ryujinx.Ui.Common.Configuration configurationFileUpdated = true; } + if (configurationFileFormat.Version < 46) + { + Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 45."); + + configurationFileFormat.MultiplayerLanInterfaceId = "0"; + + configurationFileUpdated = true; + } + Logger.EnableFileLog.Value = configurationFileFormat.EnableFileLog; Graphics.ResScale.Value = configurationFileFormat.ResScale; Graphics.ResScaleCustom.Value = configurationFileFormat.ResScaleCustom; @@ -1366,12 +1399,12 @@ namespace Ryujinx.Ui.Common.Configuration Ui.ColumnSort.SortColumnId.Value = configurationFileFormat.ColumnSort.SortColumnId; Ui.ColumnSort.SortAscending.Value = configurationFileFormat.ColumnSort.SortAscending; Ui.GameDirs.Value = configurationFileFormat.GameDirs; - Ui.ShownFileTypes.NSP.Value = configurationFileFormat.ShownFileTypes.NSP; - Ui.ShownFileTypes.PFS0.Value = configurationFileFormat.ShownFileTypes.PFS0; - Ui.ShownFileTypes.XCI.Value = configurationFileFormat.ShownFileTypes.XCI; - Ui.ShownFileTypes.NCA.Value = configurationFileFormat.ShownFileTypes.NCA; - Ui.ShownFileTypes.NRO.Value = configurationFileFormat.ShownFileTypes.NRO; - Ui.ShownFileTypes.NSO.Value = configurationFileFormat.ShownFileTypes.NSO; + Ui.ShownFileTypes.NSP.Value = configurationFileFormat.ShownFileTypes.NSP; + Ui.ShownFileTypes.PFS0.Value = configurationFileFormat.ShownFileTypes.PFS0; + Ui.ShownFileTypes.XCI.Value = configurationFileFormat.ShownFileTypes.XCI; + Ui.ShownFileTypes.NCA.Value = configurationFileFormat.ShownFileTypes.NCA; + Ui.ShownFileTypes.NRO.Value = configurationFileFormat.ShownFileTypes.NRO; + Ui.ShownFileTypes.NSO.Value = configurationFileFormat.ShownFileTypes.NSO; Ui.EnableCustomTheme.Value = configurationFileFormat.EnableCustomTheme; Ui.LanguageCode.Value = configurationFileFormat.LanguageCode; Ui.CustomThemePath.Value = configurationFileFormat.CustomThemePath; @@ -1393,6 +1426,8 @@ namespace Ryujinx.Ui.Common.Configuration Hid.InputConfig.Value = new List<InputConfig>(); } + Multiplayer.LanInterfaceId.Value = configurationFileFormat.MultiplayerLanInterfaceId; + if (configurationFileUpdated) { ToFileFormat().SaveConfig(configurationFilePath); @@ -1418,4 +1453,4 @@ namespace Ryujinx.Ui.Common.Configuration Instance = new ConfigurationState(); } } -}
\ No newline at end of file +} |