InstallerView will show different settings depending on ModManager used during ModList compilation

This commit is contained in:
erri120
2019-11-11 13:03:46 +01:00
committed by Timothy Baldridge
parent 1024d4a2e2
commit a423e33cef
2 changed files with 139 additions and 29 deletions

View File

@ -52,8 +52,20 @@ namespace Wabbajack
public FilePickerVM Location { get; } public FilePickerVM Location { get; }
[Reactive]
public bool IsMO2ModList { get; set; }
[Reactive]
public string DownloadLocation { get; set; }
public FilePickerVM DownloadLocation { get; } public FilePickerVM DownloadLocation { get; }
[Reactive]
public string StagingLocation { get; set; }
private readonly ObservableAsPropertyHelper<IErrorResponse> _stagingLocationError;
public IErrorResponse StagingLocationError => _stagingLocationError.Value;
private readonly ObservableAsPropertyHelper<float> _ProgressPercent; private readonly ObservableAsPropertyHelper<float> _ProgressPercent;
public float ProgressPercent => _ProgressPercent.Value; public float ProgressPercent => _ProgressPercent.Value;
@ -147,14 +159,20 @@ namespace Wabbajack
this.MWVM.MainWindow.Close(); this.MWVM.MainWindow.Close();
}); });
return default(ModListVM); return default(ModListVM);
}else if (modList.ModManager == ModManager.Vortex) }
if (modList.ModManager == ModManager.Vortex)
{ {
IsMO2ModList = false;
MessageBox.Show( MessageBox.Show(
"The ModList you are about to install was compiled from a Vortex installation. " + "The ModList you are about to install was compiled from a Vortex installation. " +
"Vortex support is still very bleeding edge and installing this ModList WILL OVERRIDE your existing mods. " + "Vortex support is still very bleeding edge and installing this ModList WILL OVERRIDE your existing mods. " +
"If you encounter any errors during installation go to our discord and ping erri120#2285 with your error and a log file.", "If you encounter any errors during installation go to our discord and ping erri120#2285 with your error and a log file.",
"Important information regarding Vortex support", MessageBoxButton.OK, MessageBoxImage.Stop); "Important information regarding Vortex support", MessageBoxButton.OK, MessageBoxImage.Stop);
} }
else
{
IsMO2ModList = true;
}
return new ModListVM(modList, modListPath); return new ModListVM(modList, modListPath);
}) })
.ObserveOnGuiThread() .ObserveOnGuiThread()
@ -213,6 +231,10 @@ namespace Wabbajack
.Select(x => x?.Name) .Select(x => x?.Name)
.ToProperty(this, nameof(this.ModListName)); .ToProperty(this, nameof(this.ModListName));
_stagingLocationError = this.WhenAny(x => x.StagingLocation)
.Select(Utils.IsDirectoryPathValid)
.ToProperty(this, nameof(StagingLocationError));
// Define commands // Define commands
this.ShowReportCommand = ReactiveCommand.Create(ShowReport); this.ShowReportCommand = ReactiveCommand.Create(ShowReport);
this.OpenReadmeCommand = ReactiveCommand.Create( this.OpenReadmeCommand = ReactiveCommand.Create(

View File

@ -281,37 +281,125 @@
<RowDefinition Height="40" /> <RowDefinition Height="40" />
<RowDefinition Height="*" /> <RowDefinition Height="*" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<TextBlock <Border
x:Name="BeginButtonPurpleGlow"
Grid.Row="1" Grid.Row="1"
Grid.RowSpan="2"
Grid.Column="0" Grid.Column="0"
Grid.ColumnSpan="5"
Width="76"
Height="76"
Margin="0,0,14,0"
HorizontalAlignment="Right" HorizontalAlignment="Right"
VerticalAlignment="Center" Background="{StaticResource PrimaryVariantBrush}"
FontSize="14" CornerRadius="43"
Text="Installation Location" Visibility="{Binding IsEnabled, ElementName=BeginButton, Converter={StaticResource bool2VisibilityConverter}}">
TextAlignment="Center" /> <Border.Effect>
<local:FilePicker <BlurEffect Radius="10" />
Grid.Row="1" </Border.Effect>
Grid.Column="2" <Border.Style>
Height="30" <Style TargetType="Border">
VerticalAlignment="Center" <Setter Property="Opacity" Value="0.5" />
DataContext="{Binding Location}" <Style.Triggers>
FontSize="14" /> <DataTrigger Binding="{Binding IsMouseOver, ElementName=BeginButton}" Value="True">
<TextBlock <Setter Property="Opacity" Value="0.8" />
Grid.Row="2" </DataTrigger>
Grid.Column="0" </Style.Triggers>
HorizontalAlignment="Right" </Style>
VerticalAlignment="Center" </Border.Style>
FontSize="14" </Border>
Text="Download Location" <Grid Grid.Row="1" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="3" Visibility="{Binding IsMO2ModList, Converter={StaticResource bool2VisibilityConverter}}">
TextAlignment="Center" /> <Grid.RowDefinitions>
<local:FilePicker <RowDefinition Height="40" />
Grid.Row="2" <RowDefinition Height="40" />
Grid.Column="2" </Grid.RowDefinitions>
Height="30" <Grid.ColumnDefinitions>
VerticalAlignment="Center" <ColumnDefinition Width="Auto" />
DataContext="{Binding DownloadLocation}" <ColumnDefinition Width="20" />
FontSize="14" /> <ColumnDefinition Width="*" />
<local:BeginButton </Grid.ColumnDefinitions>
<TextBlock
Grid.Row="0"
Grid.Column="0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
FontSize="14"
Text="Installation Location"
TextAlignment="Center" />
<local:FilePicker
Grid.Row="1"
Grid.Column="2"
Height="30"
VerticalAlignment="Center"
DataContext="{Binding Location}"
FontSize="14" />
<TextBlock
Grid.Row="1"
Grid.Column="0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
FontSize="14"
Text="Download Location"
TextAlignment="Center" />
<local:FilePicker
Grid.Row="2"
Grid.Column="2"
Height="30"
VerticalAlignment="Center"
DataContext="{Binding DownloadLocation}"
FontSize="14" />
</Grid>
<Grid Grid.Row="1" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="3" Visibility="{Binding IsMO2ModList, Converter={StaticResource bool2VisibilityConverter}, ConverterParameter=False}">
<Grid.RowDefinitions>
<RowDefinition Height="40" />
<RowDefinition Height="40" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="20" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock
Grid.Row="0"
Grid.Column="0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
FontSize="14"
Text="Staging Folder"
TextAlignment="Center" />
<local:FilePicker
Grid.Row="0"
Grid.Column="2"
Height="30"
VerticalAlignment="Center"
AdditionalError="{Binding StagingLocationError}"
DoExistsCheck="False"
FontSize="14"
PathType="Folder"
PromptTitle="Select the Vortex staging directory"
TargetPath="{Binding StagingLocation}" />
<TextBlock
Grid.Row="1"
Grid.Column="0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
FontSize="14"
Text="Download Folder"
TextAlignment="Center" />
<local:FilePicker
Grid.Row="1"
Grid.Column="2"
Height="30"
VerticalAlignment="Center"
AdditionalError="{Binding DownloadLocationError}"
DoExistsCheck="False"
FontSize="14"
PathType="Folder"
PromptTitle="Select the Vortex downloads directory"
TargetPath="{Binding DownloadLocation}" />
</Grid>
<Button
x:Name="BeginButton"
Grid.Row="1" Grid.Row="1"
Grid.RowSpan="2" Grid.RowSpan="2"
Grid.Column="4" Grid.Column="4"