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; }
[Reactive]
public bool IsMO2ModList { get; set; }
[Reactive]
public string DownloadLocation { get; set; }
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;
public float ProgressPercent => _ProgressPercent.Value;
@ -147,14 +159,20 @@ namespace Wabbajack
this.MWVM.MainWindow.Close();
});
return default(ModListVM);
}else if (modList.ModManager == ModManager.Vortex)
}
if (modList.ModManager == ModManager.Vortex)
{
IsMO2ModList = false;
MessageBox.Show(
"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. " +
"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);
}
else
{
IsMO2ModList = true;
}
return new ModListVM(modList, modListPath);
})
.ObserveOnGuiThread()
@ -213,6 +231,10 @@ namespace Wabbajack
.Select(x => x?.Name)
.ToProperty(this, nameof(this.ModListName));
_stagingLocationError = this.WhenAny(x => x.StagingLocation)
.Select(Utils.IsDirectoryPathValid)
.ToProperty(this, nameof(StagingLocationError));
// Define commands
this.ShowReportCommand = ReactiveCommand.Create(ShowReport);
this.OpenReadmeCommand = ReactiveCommand.Create(

View File

@ -281,37 +281,125 @@
<RowDefinition Height="40" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock
<Border
x:Name="BeginButtonPurpleGlow"
Grid.Row="1"
Grid.RowSpan="2"
Grid.Column="0"
Grid.ColumnSpan="5"
Width="76"
Height="76"
Margin="0,0,14,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="2"
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" />
<local:BeginButton
Background="{StaticResource PrimaryVariantBrush}"
CornerRadius="43"
Visibility="{Binding IsEnabled, ElementName=BeginButton, Converter={StaticResource bool2VisibilityConverter}}">
<Border.Effect>
<BlurEffect Radius="10" />
</Border.Effect>
<Border.Style>
<Style TargetType="Border">
<Setter Property="Opacity" Value="0.5" />
<Style.Triggers>
<DataTrigger Binding="{Binding IsMouseOver, ElementName=BeginButton}" Value="True">
<Setter Property="Opacity" Value="0.8" />
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
</Border>
<Grid Grid.Row="1" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="3" Visibility="{Binding IsMO2ModList, Converter={StaticResource bool2VisibilityConverter}}">
<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="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.RowSpan="2"
Grid.Column="4"