mirror of
https://github.com/DorkSquadRR/DorkNet.git
synced 2026-10-26 23:48:45 -07:00
launcher: rewrite as native WPF, drop PhotinoNET/WebView2
Initial v0.1 (commit df9dac0) used PhotinoNET wrapping WebView2 + HTML/JS,
but rendered as a blank window on first run — WebView2 + file:// URI
quirks. Switching to native WPF: built into the .NET 9 Windows SDK
(no NuGet), single-file self-contained publish, instant window open.
All Backend/*.cs orchestration logic carried over unchanged (they're
UI-framework-agnostic). Replaced:
- Program.cs (PhotinoNET bootstrap) -> App.xaml(.cs) + MainWindow.xaml(.cs)
- ui/index.html + style.css + app.js -> MainWindow.xaml (XAML views) +
App.xaml resource styles
- Backend/MessageBridge.cs (JS<->C# router) -> direct method calls in
MainWindow.xaml.cs code-behind
RecRoomPicker now uses Microsoft.Win32.OpenFolderDialog (added in .NET 8)
instead of WinForms FolderBrowserDialog — keeps the project WPF-only.
Backend files needed explicit 'using System.IO;' since the WPF SDK
doesn't include it in implicit usings.
This commit is contained in:
@@ -1,24 +1,27 @@
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
using Microsoft.Win32;
|
||||
|
||||
namespace DorkNet.Launcher.Backend;
|
||||
|
||||
/// <summary>Windows folder picker for the user's
|
||||
/// <c>Recroom_Release_Data</c> directory. Per project policy: never
|
||||
/// auto-detect via Steam library scanning, always ask the user.</summary>
|
||||
/// auto-detect via Steam library scanning, always ask the user.
|
||||
///
|
||||
/// <para>Uses <see cref="OpenFolderDialog"/> (added in .NET 8) so we
|
||||
/// don't need to drag WinForms into a WPF project for one dialog.</para></summary>
|
||||
public static class RecRoomPicker
|
||||
{
|
||||
public static string? Pick(string? initialPath = null)
|
||||
{
|
||||
using var dlg = new FolderBrowserDialog
|
||||
var dlg = new OpenFolderDialog
|
||||
{
|
||||
Description = "Select your Rec Room install's *_Data folder " +
|
||||
"(e.g. Recroom_Release_Data inside the install).",
|
||||
UseDescriptionForTitle = true,
|
||||
ShowNewFolderButton = false,
|
||||
Title = "Select your Rec Room install's *_Data folder " +
|
||||
"(e.g. Recroom_Release_Data inside the install).",
|
||||
InitialDirectory = initialPath ?? Environment.GetFolderPath(
|
||||
Environment.SpecialFolder.ProgramFilesX86),
|
||||
Multiselect = false,
|
||||
};
|
||||
return dlg.ShowDialog() == DialogResult.OK ? dlg.SelectedPath : null;
|
||||
return dlg.ShowDialog() == true ? dlg.FolderName : null;
|
||||
}
|
||||
|
||||
/// <summary>Quick sanity check that the picked path looks like a
|
||||
|
||||
Reference in New Issue
Block a user