Modlist can now be loaded using a shell command

This commit is contained in:
erri120 2019-10-30 18:09:55 +01:00
parent f1a8cb41ed
commit 74d16ed8b7
No known key found for this signature in database
GPG Key ID: A8C0A18D8D4D3135
4 changed files with 18 additions and 4 deletions

View File

@ -2,7 +2,6 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Wabbajack"
StartupUri="UI\ModeSelectionWindow.xaml"
ShutdownMode="OnExplicitShutdown">
<Application.Resources>
<ResourceDictionary>

View File

@ -29,6 +29,12 @@ namespace Wabbajack
Environment.Exit(1);
}*/
string[] args = Environment.GetCommandLineArgs();
StartupUri = new Uri("UI/ModeSelectionWindow.xaml", UriKind.Relative);
if (args.Length != 3) return;
if (!args[1].Contains("-i")) return;
// modlists gets loaded using a shell command
StartupUri = new Uri("UI/MainWindow.xaml", UriKind.Relative);
}
private void SetupHandlers()

View File

@ -17,10 +17,19 @@ namespace Wabbajack
{
private AppState _state;
public MainWindow()
{
string[] args = Environment.GetCommandLineArgs();
if (args.Length != 3) return;
var modlistPath = args[2];
var mainWindow = new MainWindow(RunMode.Install, modlistPath);
mainWindow.Show();
Close();
}
public MainWindow(RunMode mode, string source)
{
var args = Environment.GetCommandLineArgs();
InitializeComponent();
var context = new AppState(mode);

View File

@ -17,6 +17,7 @@
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
@ -29,7 +30,6 @@
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>