Add localization; stub out bulk load updates
This commit is contained in:
parent
50cd3add3f
commit
130135699a
3 changed files with 43 additions and 25 deletions
|
@ -12,6 +12,8 @@
|
||||||
"MenuBarFileOpenFromFile": "_Load Application From File",
|
"MenuBarFileOpenFromFile": "_Load Application From File",
|
||||||
"MenuBarFileOpenFromFileError": "No applications found in selected file.",
|
"MenuBarFileOpenFromFileError": "No applications found in selected file.",
|
||||||
"MenuBarFileOpenUnpacked": "Load _Unpacked Game",
|
"MenuBarFileOpenUnpacked": "Load _Unpacked Game",
|
||||||
|
"MenuBarFileLoadDlcFromFolder": "Load DLC From Folder",
|
||||||
|
"MenuBarFileLoadTitleUpdatesFromFolder": "Load Title Updates From Folder",
|
||||||
"MenuBarFileOpenEmuFolder": "Open Ryujinx Folder",
|
"MenuBarFileOpenEmuFolder": "Open Ryujinx Folder",
|
||||||
"MenuBarFileOpenLogsFolder": "Open Logs Folder",
|
"MenuBarFileOpenLogsFolder": "Open Logs Folder",
|
||||||
"MenuBarFileExit": "_Exit",
|
"MenuBarFileExit": "_Exit",
|
||||||
|
@ -600,6 +602,8 @@
|
||||||
"DebugLogTooltip": "Prints debug log messages in the console.\n\nOnly use this if specifically instructed by a staff member, as it will make logs difficult to read and worsen emulator performance.",
|
"DebugLogTooltip": "Prints debug log messages in the console.\n\nOnly use this if specifically instructed by a staff member, as it will make logs difficult to read and worsen emulator performance.",
|
||||||
"LoadApplicationFileTooltip": "Open a file explorer to choose a Switch compatible file to load",
|
"LoadApplicationFileTooltip": "Open a file explorer to choose a Switch compatible file to load",
|
||||||
"LoadApplicationFolderTooltip": "Open a file explorer to choose a Switch compatible, unpacked application to load",
|
"LoadApplicationFolderTooltip": "Open a file explorer to choose a Switch compatible, unpacked application to load",
|
||||||
|
"LoadDlcFromFolderTooltip": "Open a file explorer to choose one or more folders to bulk load DLC from",
|
||||||
|
"LoadTitleUpdatesFromFolderTooltip": "Open a file explorer to choose one or more folders to bulk load title updates from",
|
||||||
"OpenRyujinxFolderTooltip": "Open Ryujinx filesystem folder",
|
"OpenRyujinxFolderTooltip": "Open Ryujinx filesystem folder",
|
||||||
"OpenRyujinxLogsTooltip": "Opens the folder where logs are written to",
|
"OpenRyujinxLogsTooltip": "Opens the folder where logs are written to",
|
||||||
"ExitTooltip": "Exit Ryujinx",
|
"ExitTooltip": "Exit Ryujinx",
|
||||||
|
|
|
@ -1259,6 +1259,29 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
_rendererWaitEvent.Set();
|
_rendererWaitEvent.Set();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async Task LoadContentFromFolder(LocaleKeys localeMessageKey, Func<List<string>, int> onDirsSelected)
|
||||||
|
{
|
||||||
|
var result = await StorageProvider.OpenFolderPickerAsync(new FolderPickerOpenOptions
|
||||||
|
{
|
||||||
|
Title = LocaleManager.Instance[LocaleKeys.OpenFolderDialogTitle], AllowMultiple = true,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (result.Count > 0)
|
||||||
|
{
|
||||||
|
var dirs = result.Select(it => it.Path.LocalPath).ToList();
|
||||||
|
var numAdded = onDirsSelected(dirs);
|
||||||
|
|
||||||
|
var msg = string.Format(LocaleManager.Instance[localeMessageKey], numAdded);
|
||||||
|
|
||||||
|
await Dispatcher.UIThread.InvokeAsync(async () =>
|
||||||
|
{
|
||||||
|
await ContentDialogHelper.ShowTextDialog(
|
||||||
|
LocaleManager.Instance[numAdded > 0 ? LocaleKeys.RyujinxConfirm : LocaleKeys.RyujinxInfo],
|
||||||
|
msg, "", "", "", LocaleManager.Instance[LocaleKeys.InputDialogOk], (int)Symbol.Checkmark);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region PublicMethods
|
#region PublicMethods
|
||||||
|
@ -1507,30 +1530,16 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task BulkLoadDlc()
|
public async Task LoadDlcFromFolder()
|
||||||
{
|
{
|
||||||
var result = await StorageProvider.OpenFolderPickerAsync(new FolderPickerOpenOptions
|
await LoadContentFromFolder(LocaleKeys.AutoloadDlcAddedMessage,
|
||||||
{
|
dirs => ApplicationLibrary.AutoLoadDownloadableContents(dirs));
|
||||||
Title = LocaleManager.Instance[LocaleKeys.OpenFolderDialogTitle], AllowMultiple = true,
|
}
|
||||||
});
|
|
||||||
|
|
||||||
if (result.Count > 0)
|
public async Task LoadTitleUpdatesFromFolder()
|
||||||
{
|
{
|
||||||
var dirs = result.Select(it => it.Path.LocalPath).ToList();
|
await LoadContentFromFolder(LocaleKeys.AutoloadUpdateAddedMessage,
|
||||||
var numDlcAdded = ApplicationLibrary.AutoLoadDownloadableContents(dirs);
|
dirs => ApplicationLibrary.AutoLoadTitleUpdates(dirs));
|
||||||
|
|
||||||
if (numDlcAdded > 0)
|
|
||||||
{
|
|
||||||
var msg = string.Format(LocaleManager.Instance[LocaleKeys.AutoloadDlcAddedMessage], numDlcAdded);
|
|
||||||
|
|
||||||
await Dispatcher.UIThread.InvokeAsync(async () =>
|
|
||||||
{
|
|
||||||
await ContentDialogHelper.ShowTextDialog(
|
|
||||||
LocaleManager.Instance[LocaleKeys.DialogConfirmationTitle],
|
|
||||||
msg, "", "", "", LocaleManager.Instance[LocaleKeys.InputDialogOk], (int)Symbol.Checkmark);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task OpenFolder()
|
public async Task OpenFolder()
|
||||||
|
|
|
@ -35,10 +35,15 @@
|
||||||
IsEnabled="{Binding EnableNonGameRunningControls}"
|
IsEnabled="{Binding EnableNonGameRunningControls}"
|
||||||
ToolTip.Tip="{locale:Locale LoadApplicationFolderTooltip}" />
|
ToolTip.Tip="{locale:Locale LoadApplicationFolderTooltip}" />
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Command="{Binding BulkLoadDlc}"
|
Command="{Binding LoadDlcFromFolder}"
|
||||||
Header="Bulk Load DLC"
|
Header="{locale:Locale MenuBarFileLoadDlcFromFolder}"
|
||||||
IsEnabled="{Binding EnableNonGameRunningControls}"
|
IsEnabled="{Binding EnableNonGameRunningControls}"
|
||||||
ToolTip.Tip="This is the tooltip" />
|
ToolTip.Tip="{locale:Locale LoadDlcFromFolderTooltip}" />
|
||||||
|
<MenuItem
|
||||||
|
Command="{Binding LoadTitleUpdatesFromFolder}"
|
||||||
|
Header="{locale:Locale MenuBarFileLoadTitleUpdatesFromFolder}"
|
||||||
|
IsEnabled="{Binding EnableNonGameRunningControls}"
|
||||||
|
ToolTip.Tip="{locale:Locale LoadTitleUpdatesFromFolderTooltip}" />
|
||||||
<MenuItem Header="{locale:Locale MenuBarFileOpenApplet}" IsEnabled="{Binding IsAppletMenuActive}">
|
<MenuItem Header="{locale:Locale MenuBarFileOpenApplet}" IsEnabled="{Binding IsAppletMenuActive}">
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Click="OpenMiiApplet"
|
Click="OpenMiiApplet"
|
||||||
|
|
Loading…
Reference in a new issue