game dir setup

known bugs are a missing prod.keys popup after setup (how), as well as the dialog for autoload kinda cluttering up the screen after you hit next on the game dir page
This commit is contained in:
GreemDev
2025-12-07 00:27:46 -06:00
parent 13ff9cb162
commit c90d2af9cd
10 changed files with 347 additions and 13 deletions

View File

@@ -0,0 +1,73 @@
using Avalonia.Controls;
using Avalonia.Layout;
using CommunityToolkit.Mvvm.ComponentModel;
using System.Collections.ObjectModel;
using Gommon;
using Ryujinx.Ava;
using Ryujinx.Ava.Common.Locale;
using Ryujinx.Ava.Systems.Configuration;
using Ryujinx.Ava.UI.Helpers;
using Ryujinx.Ava.UI.SetupWizard;
using Ryujinx.Common;
using System;
using System.Linq;
namespace Ryujinx.UI.SetupWizard.Pages
{
public partial class SetupGameDirsPageContext() : SetupWizardPageContext(LocaleKeys.SetupWizardGameDirsPageTitle)
{
[ObservableProperty]
public partial ObservableCollection<string> GameDirs { get; set; }
= new(ConfigurationState.Instance.UI.GameDirs);
[ObservableProperty]
public partial ObservableCollection<string> UpdateAndDlcDirs { get; set; }
= new(ConfigurationState.Instance.UI.AutoloadDirs);
public override Result CompleteStep()
{
if (GameDirs.Count is 0)
{
NotificationManager.Error("At least one folder for games must be selected; otherwise the UI will be empty.");
return Result.Failure(RetryError.Shared);
}
ConfigurationState.Instance.UI.GameDirs.Value = GameDirs.ToList();
ConfigurationState.Instance.UI.AutoloadDirs.Value = UpdateAndDlcDirs.ToList();
OwningWizard.SignalConfigModified();
RyujinxApp.MainWindow.LoadApplications();
return Result.Success;
}
public override object CreateHelpContent()
{
Grid grid = new()
{
RowDefinitions = [new(GridLength.Auto), new(GridLength.Auto)],
HorizontalAlignment = HorizontalAlignment.Center
};
grid.Children.Add(new TextBlock
{
Text = "Not sure how to get your games, updates, and/or DLC onto your PC?",
HorizontalAlignment = HorizontalAlignment.Center,
GridRow = 0
});
grid.Children.Add(new HyperlinkButton
{
Content = "Click here to view a guide.",
HorizontalAlignment = HorizontalAlignment.Center,
NavigateUri = new Uri(SharedConstants.DumpFirmwareWikiUrl),
GridRow = 1
});
return grid;
}
}
public struct RetryError : IErrorState
{
public static readonly RetryError Shared = new();
}
}