Add setting for autoloading dlc/updates
This commit is contained in:
parent
a381cea311
commit
bc60126a24
7 changed files with 172 additions and 124 deletions
|
@ -779,6 +779,11 @@ namespace Ryujinx.UI.App.Common
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void LoadTitleUpdates()
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
public void LoadDownloadableContents()
|
public void LoadDownloadableContents()
|
||||||
{
|
{
|
||||||
_downloadableContents.Edit(it =>
|
_downloadableContents.Edit(it =>
|
||||||
|
@ -932,9 +937,9 @@ namespace Ryujinx.UI.App.Common
|
||||||
return newDlcLoaded;
|
return newDlcLoaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AutoLoadTitleUpdates(List<string> appDirs)
|
public int AutoLoadTitleUpdates(List<string> appDirs)
|
||||||
{
|
{
|
||||||
return;
|
return 0;
|
||||||
// _cancellationToken = new CancellationTokenSource();
|
// _cancellationToken = new CancellationTokenSource();
|
||||||
// _titleUpdates.Clear();
|
// _titleUpdates.Clear();
|
||||||
//
|
//
|
||||||
|
|
|
@ -15,7 +15,7 @@ namespace Ryujinx.UI.Common.Configuration
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The current version of the file format
|
/// The current version of the file format
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const int CurrentVersion = 51;
|
public const int CurrentVersion = 52;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Version of the configuration file format
|
/// Version of the configuration file format
|
||||||
|
@ -167,6 +167,11 @@ namespace Ryujinx.UI.Common.Configuration
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool RememberWindowState { get; set; }
|
public bool RememberWindowState { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enables or disables automatically loading DLC/title updates on library refresh.
|
||||||
|
/// </summary>
|
||||||
|
public bool AutoloadContent { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Enables hardware-accelerated rendering for Avalonia
|
/// Enables hardware-accelerated rendering for Avalonia
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -632,6 +632,11 @@ namespace Ryujinx.UI.Common.Configuration
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ReactiveObject<bool> RememberWindowState { get; private set; }
|
public ReactiveObject<bool> RememberWindowState { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enables or disables automatically loading DLC/title updates on library refresh.
|
||||||
|
/// </summary>
|
||||||
|
public ReactiveObject<bool> AutoloadContent { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Enables hardware-accelerated rendering for Avalonia
|
/// Enables hardware-accelerated rendering for Avalonia
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -654,6 +659,7 @@ namespace Ryujinx.UI.Common.Configuration
|
||||||
CheckUpdatesOnStart = new ReactiveObject<bool>();
|
CheckUpdatesOnStart = new ReactiveObject<bool>();
|
||||||
ShowConfirmExit = new ReactiveObject<bool>();
|
ShowConfirmExit = new ReactiveObject<bool>();
|
||||||
RememberWindowState = new ReactiveObject<bool>();
|
RememberWindowState = new ReactiveObject<bool>();
|
||||||
|
AutoloadContent = new ReactiveObject<bool>();
|
||||||
EnableHardwareAcceleration = new ReactiveObject<bool>();
|
EnableHardwareAcceleration = new ReactiveObject<bool>();
|
||||||
HideCursor = new ReactiveObject<HideCursorMode>();
|
HideCursor = new ReactiveObject<HideCursorMode>();
|
||||||
}
|
}
|
||||||
|
@ -692,6 +698,7 @@ namespace Ryujinx.UI.Common.Configuration
|
||||||
CheckUpdatesOnStart = CheckUpdatesOnStart,
|
CheckUpdatesOnStart = CheckUpdatesOnStart,
|
||||||
ShowConfirmExit = ShowConfirmExit,
|
ShowConfirmExit = ShowConfirmExit,
|
||||||
RememberWindowState = RememberWindowState,
|
RememberWindowState = RememberWindowState,
|
||||||
|
AutoloadContent = AutoloadContent,
|
||||||
EnableHardwareAcceleration = EnableHardwareAcceleration,
|
EnableHardwareAcceleration = EnableHardwareAcceleration,
|
||||||
HideCursor = HideCursor,
|
HideCursor = HideCursor,
|
||||||
EnableVsync = Graphics.EnableVsync,
|
EnableVsync = Graphics.EnableVsync,
|
||||||
|
@ -801,6 +808,7 @@ namespace Ryujinx.UI.Common.Configuration
|
||||||
CheckUpdatesOnStart.Value = true;
|
CheckUpdatesOnStart.Value = true;
|
||||||
ShowConfirmExit.Value = true;
|
ShowConfirmExit.Value = true;
|
||||||
RememberWindowState.Value = true;
|
RememberWindowState.Value = true;
|
||||||
|
AutoloadContent.Value = false;
|
||||||
EnableHardwareAcceleration.Value = true;
|
EnableHardwareAcceleration.Value = true;
|
||||||
HideCursor.Value = HideCursorMode.OnIdle;
|
HideCursor.Value = HideCursorMode.OnIdle;
|
||||||
Graphics.EnableVsync.Value = true;
|
Graphics.EnableVsync.Value = true;
|
||||||
|
@ -1477,6 +1485,15 @@ namespace Ryujinx.UI.Common.Configuration
|
||||||
configurationFileUpdated = true;
|
configurationFileUpdated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (configurationFileFormat.Version < 52)
|
||||||
|
{
|
||||||
|
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 52.");
|
||||||
|
|
||||||
|
configurationFileFormat.AutoloadContent = false;
|
||||||
|
|
||||||
|
configurationFileUpdated = true;
|
||||||
|
}
|
||||||
|
|
||||||
Logger.EnableFileLog.Value = configurationFileFormat.EnableFileLog;
|
Logger.EnableFileLog.Value = configurationFileFormat.EnableFileLog;
|
||||||
Graphics.ResScale.Value = configurationFileFormat.ResScale;
|
Graphics.ResScale.Value = configurationFileFormat.ResScale;
|
||||||
Graphics.ResScaleCustom.Value = configurationFileFormat.ResScaleCustom;
|
Graphics.ResScaleCustom.Value = configurationFileFormat.ResScaleCustom;
|
||||||
|
@ -1508,6 +1525,7 @@ namespace Ryujinx.UI.Common.Configuration
|
||||||
CheckUpdatesOnStart.Value = configurationFileFormat.CheckUpdatesOnStart;
|
CheckUpdatesOnStart.Value = configurationFileFormat.CheckUpdatesOnStart;
|
||||||
ShowConfirmExit.Value = configurationFileFormat.ShowConfirmExit;
|
ShowConfirmExit.Value = configurationFileFormat.ShowConfirmExit;
|
||||||
RememberWindowState.Value = configurationFileFormat.RememberWindowState;
|
RememberWindowState.Value = configurationFileFormat.RememberWindowState;
|
||||||
|
AutoloadContent.Value = configurationFileFormat.AutoloadContent;
|
||||||
EnableHardwareAcceleration.Value = configurationFileFormat.EnableHardwareAcceleration;
|
EnableHardwareAcceleration.Value = configurationFileFormat.EnableHardwareAcceleration;
|
||||||
HideCursor.Value = configurationFileFormat.HideCursor;
|
HideCursor.Value = configurationFileFormat.HideCursor;
|
||||||
Graphics.EnableVsync.Value = configurationFileFormat.EnableVsync;
|
Graphics.EnableVsync.Value = configurationFileFormat.EnableVsync;
|
||||||
|
|
|
@ -98,6 +98,7 @@
|
||||||
"SettingsTabGeneralCheckUpdatesOnLaunch": "Check for Updates on Launch",
|
"SettingsTabGeneralCheckUpdatesOnLaunch": "Check for Updates on Launch",
|
||||||
"SettingsTabGeneralShowConfirmExitDialog": "Show \"Confirm Exit\" Dialog",
|
"SettingsTabGeneralShowConfirmExitDialog": "Show \"Confirm Exit\" Dialog",
|
||||||
"SettingsTabGeneralRememberWindowState": "Remember Window Size/Position",
|
"SettingsTabGeneralRememberWindowState": "Remember Window Size/Position",
|
||||||
|
"SettingsTabGeneralAutoloadContent": "Automatically load DLC/updates",
|
||||||
"SettingsTabGeneralHideCursor": "Hide Cursor:",
|
"SettingsTabGeneralHideCursor": "Hide Cursor:",
|
||||||
"SettingsTabGeneralHideCursorNever": "Never",
|
"SettingsTabGeneralHideCursorNever": "Never",
|
||||||
"SettingsTabGeneralHideCursorOnIdle": "On Idle",
|
"SettingsTabGeneralHideCursorOnIdle": "On Idle",
|
||||||
|
@ -709,7 +710,7 @@
|
||||||
"DlcWindowTitle": "Manage Downloadable Content for {0} ({1})",
|
"DlcWindowTitle": "Manage Downloadable Content for {0} ({1})",
|
||||||
"ModWindowTitle": "Manage Mods for {0} ({1})",
|
"ModWindowTitle": "Manage Mods for {0} ({1})",
|
||||||
"UpdateWindowTitle": "Title Update Manager",
|
"UpdateWindowTitle": "Title Update Manager",
|
||||||
"UpdateWindowUpdateAddedMessage": "{0} new update(s) added",
|
"UpdateWindowDlcAddedMessage": "{0} new update(s) added",
|
||||||
"CheatWindowHeading": "Cheats Available for {0} [{1}]",
|
"CheatWindowHeading": "Cheats Available for {0} [{1}]",
|
||||||
"BuildId": "BuildId:",
|
"BuildId": "BuildId:",
|
||||||
"DlcWindowBundledContentNotice": "Bundled DLC cannot be removed, only disabled.",
|
"DlcWindowBundledContentNotice": "Bundled DLC cannot be removed, only disabled.",
|
||||||
|
|
|
@ -132,6 +132,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
public bool CheckUpdatesOnStart { get; set; }
|
public bool CheckUpdatesOnStart { get; set; }
|
||||||
public bool ShowConfirmExit { get; set; }
|
public bool ShowConfirmExit { get; set; }
|
||||||
public bool RememberWindowState { get; set; }
|
public bool RememberWindowState { get; set; }
|
||||||
|
public bool AutoloadContent { get; set; }
|
||||||
public int HideCursor { get; set; }
|
public int HideCursor { get; set; }
|
||||||
public bool EnableDockedMode { get; set; }
|
public bool EnableDockedMode { get; set; }
|
||||||
public bool EnableKeyboard { get; set; }
|
public bool EnableKeyboard { get; set; }
|
||||||
|
@ -392,6 +393,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
CheckUpdatesOnStart = config.CheckUpdatesOnStart;
|
CheckUpdatesOnStart = config.CheckUpdatesOnStart;
|
||||||
ShowConfirmExit = config.ShowConfirmExit;
|
ShowConfirmExit = config.ShowConfirmExit;
|
||||||
RememberWindowState = config.RememberWindowState;
|
RememberWindowState = config.RememberWindowState;
|
||||||
|
AutoloadContent = config.AutoloadContent;
|
||||||
HideCursor = (int)config.HideCursor.Value;
|
HideCursor = (int)config.HideCursor.Value;
|
||||||
|
|
||||||
GameDirectories.Clear();
|
GameDirectories.Clear();
|
||||||
|
@ -484,6 +486,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
config.CheckUpdatesOnStart.Value = CheckUpdatesOnStart;
|
config.CheckUpdatesOnStart.Value = CheckUpdatesOnStart;
|
||||||
config.ShowConfirmExit.Value = ShowConfirmExit;
|
config.ShowConfirmExit.Value = ShowConfirmExit;
|
||||||
config.RememberWindowState.Value = RememberWindowState;
|
config.RememberWindowState.Value = RememberWindowState;
|
||||||
|
config.AutoloadContent.Value = AutoloadContent;
|
||||||
config.HideCursor.Value = (HideCursorMode)HideCursor;
|
config.HideCursor.Value = (HideCursorMode)HideCursor;
|
||||||
|
|
||||||
if (_directoryChanged)
|
if (_directoryChanged)
|
||||||
|
|
|
@ -39,6 +39,9 @@
|
||||||
<CheckBox IsChecked="{Binding RememberWindowState}">
|
<CheckBox IsChecked="{Binding RememberWindowState}">
|
||||||
<TextBlock Text="{locale:Locale SettingsTabGeneralRememberWindowState}" />
|
<TextBlock Text="{locale:Locale SettingsTabGeneralRememberWindowState}" />
|
||||||
</CheckBox>
|
</CheckBox>
|
||||||
|
<CheckBox IsChecked="{Binding AutoloadContent}">
|
||||||
|
<TextBlock Text="{locale:Locale SettingsTabGeneralAutoloadContent}" />
|
||||||
|
</CheckBox>
|
||||||
<StackPanel Margin="0, 15, 0, 0" Orientation="Horizontal">
|
<StackPanel Margin="0, 15, 0, 0" Orientation="Horizontal">
|
||||||
<TextBlock VerticalAlignment="Center"
|
<TextBlock VerticalAlignment="Center"
|
||||||
Text="{locale:Locale SettingsTabGeneralHideCursor}"
|
Text="{locale:Locale SettingsTabGeneralHideCursor}"
|
||||||
|
|
|
@ -651,15 +651,22 @@ namespace Ryujinx.Ava.UI.Windows
|
||||||
{
|
{
|
||||||
ApplicationLibrary.DesiredLanguage = ConfigurationState.Instance.System.Language;
|
ApplicationLibrary.DesiredLanguage = ConfigurationState.Instance.System.Language;
|
||||||
TimeIt("games", () => ApplicationLibrary.LoadApplications(ConfigurationState.Instance.UI.GameDirs));
|
TimeIt("games", () => ApplicationLibrary.LoadApplications(ConfigurationState.Instance.UI.GameDirs));
|
||||||
// TimeIt("updates", () => ApplicationLibrary.LoadTitleUpdates(ConfigurationState.Instance.UI.GameDirs));
|
TimeIt("updates", () => ApplicationLibrary.LoadTitleUpdates());
|
||||||
TimeIt("DLC", () => ApplicationLibrary.LoadDownloadableContents());
|
TimeIt("DLC", () => ApplicationLibrary.LoadDownloadableContents());
|
||||||
// TODO(jpr): conditional
|
|
||||||
var dlcLoaded = 0;
|
|
||||||
TimeIt("AUTO DLC", () => dlcLoaded = ApplicationLibrary.AutoLoadDownloadableContents(ConfigurationState.Instance.UI.GameDirs));
|
|
||||||
|
|
||||||
if (dlcLoaded > 0)
|
if (ConfigurationState.Instance.AutoloadContent)
|
||||||
{
|
{
|
||||||
ShowNewContentAddedDialog(dlcLoaded, 0);
|
var updatesLoaded = 0;
|
||||||
|
TimeIt("auto updates",
|
||||||
|
() => updatesLoaded =
|
||||||
|
ApplicationLibrary.AutoLoadTitleUpdates(ConfigurationState.Instance.UI.GameDirs));
|
||||||
|
|
||||||
|
var dlcLoaded = 0;
|
||||||
|
TimeIt("auto dlc",
|
||||||
|
() => dlcLoaded =
|
||||||
|
ApplicationLibrary.AutoLoadDownloadableContents(ConfigurationState.Instance.UI.GameDirs));
|
||||||
|
|
||||||
|
ShowNewContentAddedDialog(dlcLoaded, updatesLoaded);
|
||||||
}
|
}
|
||||||
|
|
||||||
_isLoading = false;
|
_isLoading = false;
|
||||||
|
@ -687,15 +694,21 @@ namespace Ryujinx.Ava.UI.Windows
|
||||||
if (numDlcAdded > 0 && numUpdatesAdded > 0)
|
if (numDlcAdded > 0 && numUpdatesAdded > 0)
|
||||||
{
|
{
|
||||||
msg = string.Format(LocaleManager.Instance[LocaleKeys.AutoloadDlcAndUpdateAddedMessage], numDlcAdded, numUpdatesAdded);
|
msg = string.Format(LocaleManager.Instance[LocaleKeys.AutoloadDlcAndUpdateAddedMessage], numDlcAdded, numUpdatesAdded);
|
||||||
} else if (numDlcAdded > 0)
|
}
|
||||||
|
else if (numDlcAdded > 0)
|
||||||
{
|
{
|
||||||
msg = string.Format(LocaleManager.Instance[LocaleKeys.AutoloadDlcAddedMessage], numDlcAdded);
|
msg = string.Format(LocaleManager.Instance[LocaleKeys.AutoloadDlcAddedMessage], numDlcAdded);
|
||||||
} else if (numUpdatesAdded > 0)
|
}
|
||||||
|
else if (numUpdatesAdded > 0)
|
||||||
{
|
{
|
||||||
msg = string.Format(LocaleManager.Instance[LocaleKeys.AutoloadUpdateAddedMessage], numUpdatesAdded);
|
msg = string.Format(LocaleManager.Instance[LocaleKeys.AutoloadUpdateAddedMessage], numUpdatesAdded);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
|
||||||
return msg == "" ? Task.CompletedTask : Dispatcher.UIThread.InvokeAsync(async () =>
|
return Dispatcher.UIThread.InvokeAsync(async () =>
|
||||||
{
|
{
|
||||||
await ContentDialogHelper.ShowTextDialog(LocaleManager.Instance[LocaleKeys.DialogConfirmationTitle],
|
await ContentDialogHelper.ShowTextDialog(LocaleManager.Instance[LocaleKeys.DialogConfirmationTitle],
|
||||||
msg, "", "", "", LocaleManager.Instance[LocaleKeys.InputDialogOk], (int)Symbol.Checkmark);
|
msg, "", "", "", LocaleManager.Instance[LocaleKeys.InputDialogOk], (int)Symbol.Checkmark);
|
||||||
|
|
Loading…
Reference in a new issue