mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-12-26 18:43:04 +00:00
Stub out bulk dlc menu item
This commit is contained in:
parent
20e0dbe97f
commit
50cd3add3f
2 changed files with 33 additions and 0 deletions
|
@ -8,6 +8,7 @@ using Avalonia.Threading;
|
||||||
using DynamicData;
|
using DynamicData;
|
||||||
using DynamicData.Alias;
|
using DynamicData.Alias;
|
||||||
using DynamicData.Binding;
|
using DynamicData.Binding;
|
||||||
|
using FluentAvalonia.UI.Controls;
|
||||||
using LibHac.Common;
|
using LibHac.Common;
|
||||||
using Ryujinx.Ava.Common;
|
using Ryujinx.Ava.Common;
|
||||||
using Ryujinx.Ava.Common.Locale;
|
using Ryujinx.Ava.Common.Locale;
|
||||||
|
@ -39,6 +40,7 @@ using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Key = Ryujinx.Input.Key;
|
using Key = Ryujinx.Input.Key;
|
||||||
|
@ -1505,6 +1507,32 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task BulkLoadDlc()
|
||||||
|
{
|
||||||
|
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 numDlcAdded = ApplicationLibrary.AutoLoadDownloadableContents(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()
|
||||||
{
|
{
|
||||||
var result = await StorageProvider.OpenFolderPickerAsync(new FolderPickerOpenOptions
|
var result = await StorageProvider.OpenFolderPickerAsync(new FolderPickerOpenOptions
|
||||||
|
|
|
@ -34,6 +34,11 @@
|
||||||
Header="{locale:Locale MenuBarFileOpenUnpacked}"
|
Header="{locale:Locale MenuBarFileOpenUnpacked}"
|
||||||
IsEnabled="{Binding EnableNonGameRunningControls}"
|
IsEnabled="{Binding EnableNonGameRunningControls}"
|
||||||
ToolTip.Tip="{locale:Locale LoadApplicationFolderTooltip}" />
|
ToolTip.Tip="{locale:Locale LoadApplicationFolderTooltip}" />
|
||||||
|
<MenuItem
|
||||||
|
Command="{Binding BulkLoadDlc}"
|
||||||
|
Header="Bulk Load DLC"
|
||||||
|
IsEnabled="{Binding EnableNonGameRunningControls}"
|
||||||
|
ToolTip.Tip="This is the tooltip" />
|
||||||
<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