added different installation methods
All checks were successful
Java CI / test (push) Successful in 1m27s
All checks were successful
Java CI / test (push) Successful in 1m27s
This commit is contained in:
parent
0479843d47
commit
b69cac606a
6 changed files with 21 additions and 4 deletions
|
@ -3,7 +3,7 @@
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||||
Height="349"
|
Height="389"
|
||||||
Width="598"
|
Width="598"
|
||||||
CanResize="False"
|
CanResize="False"
|
||||||
x:Class="PS2_Manager.AddGameWindow"
|
x:Class="PS2_Manager.AddGameWindow"
|
||||||
|
@ -39,6 +39,10 @@
|
||||||
<TextBlock Text="ISO Path"/>
|
<TextBlock Text="ISO Path"/>
|
||||||
<TextBox Name="IsoPathBox" IsEnabled="False"/>
|
<TextBox Name="IsoPathBox" IsEnabled="False"/>
|
||||||
|
|
||||||
|
<TextBlock Text="Installation Method"/>
|
||||||
|
<ComboBox Name="InstallationMethodBox" Margin="5,0" HorizontalAlignment="Stretch" SelectionChanged="InstallationMethodBox_OnSelectionChanged">
|
||||||
|
</ComboBox>
|
||||||
|
|
||||||
<Button Name="InstallButton" Content="Install Game" HorizontalAlignment="Center"
|
<Button Name="InstallButton" Content="Install Game" HorizontalAlignment="Center"
|
||||||
Background="#aa4de8"
|
Background="#aa4de8"
|
||||||
Foreground="Black"
|
Foreground="Black"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
@ -22,6 +23,9 @@ public partial class AddGameWindow : Window
|
||||||
{
|
{
|
||||||
this.newGame = new Game(filePath);
|
this.newGame = new Game(filePath);
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
InstallationMethodBox.Items.Add("Move");
|
||||||
|
InstallationMethodBox.Items.Add("Copy");
|
||||||
|
InstallationMethodBox.SelectedItem = settings.preferred_installation_method.GetValue<string>() ?? "Move";
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RefreshPreview()
|
private void RefreshPreview()
|
||||||
|
@ -100,4 +104,9 @@ public partial class AddGameWindow : Window
|
||||||
Console.Error("OpenFilePicker was called but Canceled or no Files selected");
|
Console.Error("OpenFilePicker was called but Canceled or no Files selected");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void InstallationMethodBox_OnSelectionChanged(object? sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
settings.preferred_installation_method.SetValue(InstallationMethodBox.SelectionBoxItem?.ToString());
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -21,7 +21,7 @@ public static class ConfigUtils
|
||||||
return;
|
return;
|
||||||
config.SetValue(getStrType(_type), getStrName(_type), _value.ToString());
|
config.SetValue(getStrType(_type), getStrName(_type), _value.ToString());
|
||||||
}
|
}
|
||||||
public static T GetValue<T>(this Enum _type)
|
public static T? GetValue<T>(this Enum _type)
|
||||||
{
|
{
|
||||||
if (!checkIfInitialized())
|
if (!checkIfInitialized())
|
||||||
return default(T);
|
return default(T);
|
||||||
|
|
|
@ -119,6 +119,9 @@ public class Game
|
||||||
{
|
{
|
||||||
this.InstallProgress = new UpdateVar<double>();
|
this.InstallProgress = new UpdateVar<double>();
|
||||||
await this.CopyIsoWithProgressAsync();
|
await this.CopyIsoWithProgressAsync();
|
||||||
|
string installationMethod = settings.preferred_installation_method.GetValue<string>() ?? "Move";
|
||||||
|
if(installationMethod == "Move")
|
||||||
|
this.Uninstall();
|
||||||
}
|
}
|
||||||
|
|
||||||
private Bitmap DownloadCover(Artwork.Type type)
|
private Bitmap DownloadCover(Artwork.Type type)
|
||||||
|
|
|
@ -35,7 +35,8 @@ public static class Globals
|
||||||
|
|
||||||
public enum settings
|
public enum settings
|
||||||
{
|
{
|
||||||
library_path
|
library_path,
|
||||||
|
preferred_installation_method
|
||||||
}
|
}
|
||||||
|
|
||||||
public class UpdateVar<T>
|
public class UpdateVar<T>
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||||
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
|
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
|
||||||
<AssemblyVersion>1.0</AssemblyVersion>
|
<AssemblyVersion>1.0</AssemblyVersion>
|
||||||
<FileVersion>1.0</FileVersion>
|
<FileVersion>1.1</FileVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
Loading…
Add table
Reference in a new issue