Merge pull request 'add overview page' (#100) from waffle.lord/Installer:impl/overview-page into master
Reviewed-on: SPT/Installer#100
This commit is contained in:
commit
b2b64dcae0
1
.idea/.idea.SPTInstaller/.idea/avalonia.xml
generated
1
.idea/.idea.SPTInstaller/.idea/avalonia.xml
generated
@ -24,6 +24,7 @@
|
||||
<entry key="SPTInstaller/Views/InstallerUpdateView.axaml" value="SPTInstaller/SPTInstaller.csproj" />
|
||||
<entry key="SPTInstaller/Views/MainWindow.axaml" value="SPTInstaller/SPTInstaller.csproj" />
|
||||
<entry key="SPTInstaller/Views/MessageView.axaml" value="SPTInstaller/SPTInstaller.csproj" />
|
||||
<entry key="SPTInstaller/Views/OverviewView.axaml" value="SPTInstaller/SPTInstaller.csproj" />
|
||||
<entry key="SPTInstaller/Views/PreChecksView.axaml" value="SPTInstaller/SPTInstaller.csproj" />
|
||||
</map>
|
||||
</option>
|
||||
|
@ -15,7 +15,7 @@ namespace SPTInstaller;
|
||||
|
||||
public partial class App : Application
|
||||
{
|
||||
public static string LogPath = Path.Join(Environment.CurrentDirectory, "spt-installer.log");
|
||||
public static string LogPath = Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "spt-installer", "spt-installer.log");
|
||||
|
||||
public static void ReLaunch(bool debug, string installPath = "")
|
||||
{
|
||||
@ -67,8 +67,6 @@ public partial class App : Application
|
||||
providedPath = installPath != null && installPath.Contains('=') ? installPath?.Split('=')[1] ?? "" : "";
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Log.Logger = new LoggerConfiguration()
|
||||
|
@ -76,12 +76,7 @@ public class ReleaseCheckTask : InstallerTaskBase
|
||||
|
||||
bool sptClientIsOutdated = intSPTVersion != patchMirrorInfo.TargetClientVersion && patchNeedCheck;
|
||||
bool liveClientIsOutdated = intGameVersion != patchMirrorInfo.SourceClientVersion && patchNeedCheck;
|
||||
|
||||
if (liveClientIsOutdated)
|
||||
{
|
||||
return Result.FromError("Your live EFT is out of date. Please update it using the BSG Launcher then run the SPT Installer again");
|
||||
}
|
||||
|
||||
|
||||
if (sptClientIsOutdated)
|
||||
{
|
||||
return Result.FromError(
|
||||
@ -90,6 +85,11 @@ public class ReleaseCheckTask : InstallerTaskBase
|
||||
"\n* Live EFT just updated. The SPT team will create a new patcher within 24 hours, hold tight!" +
|
||||
"\n* Live EFT just updated. You have not installed it on your computer using the BSG launcher");
|
||||
}
|
||||
|
||||
if (liveClientIsOutdated)
|
||||
{
|
||||
return Result.FromError("Your live EFT is out of date. Please update it using the BSG Launcher then run the SPT Installer again");
|
||||
}
|
||||
|
||||
_data.PatchNeeded = patchNeedCheck;
|
||||
|
||||
|
@ -10,8 +10,8 @@
|
||||
<PackageIcon>icon.ico</PackageIcon>
|
||||
<ApplicationIcon>Assets\spt_installer.ico</ApplicationIcon>
|
||||
<Configurations>Debug;Release;TEST</Configurations>
|
||||
<AssemblyVersion>2.86</AssemblyVersion>
|
||||
<FileVersion>2.86</FileVersion>
|
||||
<AssemblyVersion>2.87</AssemblyVersion>
|
||||
<FileVersion>2.87</FileVersion>
|
||||
<Company>SPT</Company>
|
||||
</PropertyGroup>
|
||||
|
||||
|
@ -27,14 +27,14 @@ public class InstallerUpdateViewModel : ViewModelBase
|
||||
|
||||
if (!UpdateInfo.UpdateAvailable)
|
||||
{
|
||||
NavigateTo(new InstallPathSelectionViewModel(HostScreen, _installPath, _debugging));
|
||||
NavigateTo(new OverviewViewModel(HostScreen, _installPath, _debugging));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void NotNowCommand()
|
||||
{
|
||||
NavigateTo(new InstallPathSelectionViewModel(HostScreen, _installPath, _debugging));
|
||||
NavigateTo(new OverviewViewModel(HostScreen, _installPath, _debugging));
|
||||
}
|
||||
|
||||
public async Task UpdateInstallCommand()
|
||||
|
25
SPTInstaller/ViewModels/OverviewViewModel.cs
Normal file
25
SPTInstaller/ViewModels/OverviewViewModel.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using System.Threading.Tasks;
|
||||
using ReactiveUI;
|
||||
|
||||
namespace SPTInstaller.ViewModels;
|
||||
|
||||
public class OverviewViewModel : ViewModelBase
|
||||
{
|
||||
private string _providedPath;
|
||||
private bool _debugging;
|
||||
public OverviewViewModel(IScreen Host, string providedPath, bool debugging) : base(Host)
|
||||
{
|
||||
_providedPath = providedPath;
|
||||
_debugging = debugging;
|
||||
|
||||
if (!string.IsNullOrEmpty(_providedPath))
|
||||
{
|
||||
Task.Run(NextCommand);
|
||||
}
|
||||
}
|
||||
|
||||
public void NextCommand()
|
||||
{
|
||||
NavigateTo(new InstallPathSelectionViewModel(HostScreen, _providedPath, _debugging));
|
||||
}
|
||||
}
|
55
SPTInstaller/Views/OverviewView.axaml
Normal file
55
SPTInstaller/Views/OverviewView.axaml
Normal file
@ -0,0 +1,55 @@
|
||||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="SPTInstaller.Views.OverviewView">
|
||||
<Grid RowDefinitions="10,Auto,Auto,Auto,Auto,*,10" ColumnDefinitions="10,*,Auto,10">
|
||||
|
||||
<!-- Overview text -->
|
||||
<Label Grid.Row="1" Grid.Column="1" Content="This installer will:" FontSize="20" Margin="0 5"
|
||||
Foreground="{StaticResource SPT_Yellow}"
|
||||
/>
|
||||
|
||||
<!-- Overview info -->
|
||||
<StackPanel Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2">
|
||||
<Label>◉ Check dependencies are installed, such as .NET</Label>
|
||||
<Label>◉ Automatically locate and copy your EFT client files to the path you supply on the next page</Label>
|
||||
<Label>◉ Downgrade your client files to the version SPT uses, if needed</Label>
|
||||
<Label>◉ Download and extract the SPT release files</Label>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Notes text -->
|
||||
<Label Grid.Row="3" Grid.Column="1" Content="Additional Notes:" FontSize="20" Margin="0 5"
|
||||
Foreground="{StaticResource SPT_Yellow}"
|
||||
/>
|
||||
|
||||
<!-- Notes info -->
|
||||
<StackPanel Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="2">
|
||||
<Label>◉ You do not need to install SPT in the same drive as EFT</Label>
|
||||
<Label Margin="0" Padding="0">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Label VerticalAlignment="Center">◉ This tool does</Label>
|
||||
<TextBlock TextDecorations="Underline" FontWeight="SemiBold" Foreground="Crimson" VerticalAlignment="Center">NOT</TextBlock>
|
||||
<Label VerticalAlignment="Center">update an existing SPT install</Label>
|
||||
</StackPanel>
|
||||
</Label>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Next button -->
|
||||
<Button Grid.Row="5" Grid.Column="2"
|
||||
MinWidth="100"
|
||||
MinHeight="30"
|
||||
FontSize="16"
|
||||
CornerRadius="20"
|
||||
FontWeight="SemiBold"
|
||||
VerticalAlignment="Bottom"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Classes="yellow"
|
||||
Content="Next"
|
||||
Command="{Binding NextCommand}"
|
||||
IsEnabled="{Binding ValidPath}"
|
||||
/>
|
||||
</Grid>
|
||||
</UserControl>
|
12
SPTInstaller/Views/OverviewView.axaml.cs
Normal file
12
SPTInstaller/Views/OverviewView.axaml.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using Avalonia.ReactiveUI;
|
||||
using SPTInstaller.ViewModels;
|
||||
|
||||
namespace SPTInstaller.Views;
|
||||
|
||||
public partial class OverviewView : ReactiveUserControl<OverviewViewModel>
|
||||
{
|
||||
public OverviewView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user