Overhaul setup wizard help pages

the context can now override a virtual method named `CreateHelpContent` which the setup wizard system will automatically try to use when you use the generic overload taking a generic context type. If the return is null, it skips setting entirely (the default impl is null)

additionally made the discord join link a button with code copied from the about window, and made it centered at the bottom.
This commit is contained in:
GreemDev
2025-11-27 02:11:49 -06:00
parent 4bdee89288
commit 211498e060
10 changed files with 229 additions and 40 deletions

View File

@@ -1,10 +1,13 @@
using Avalonia.Controls;
using Avalonia.Layout;
using Avalonia.Platform.Storage;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Gommon;
using Ryujinx.Ava.Common.Locale;
using Ryujinx.Ava.UI.Helpers;
using Ryujinx.Ava.Utilities;
using Ryujinx.Common;
using Ryujinx.Common.Configuration;
using Ryujinx.HLE.FileSystem;
using System;
@@ -68,6 +71,32 @@ namespace Ryujinx.Ava.UI.SetupWizard.Pages
}
}
public override Control 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 firmware off of your Switch?",
HorizontalAlignment = HorizontalAlignment.Center,
GridRow = 0
});
grid.Children.Add(new HyperlinkButton
{
Content = "Click here to view a guide.",
NavigateUri = new Uri(SharedConstants.DumpFirmwareWikiUrl),
HorizontalAlignment = HorizontalAlignment.Center,
GridRow = 1
});
return grid;
}
public override Result CompleteStep()
{
if (!Directory.Exists(FirmwareSourcePath))