Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Commit

Permalink
Added profile selector for use with Frosty Alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
Dyvinia committed May 13, 2021
1 parent 3a66c9e commit fff9cb9
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 27 deletions.
6 changes: 6 additions & 0 deletions FrostyFix2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@
<ApplicationManifest>Properties\app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.WindowsAPICodePack">
<HintPath>..\..\..\Downloads\Windows API Code Pack 1.1\Windows API Code Pack 1.1\binaries\Microsoft.WindowsAPICodePack.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAPICodePack.Shell">
<HintPath>..\..\..\Downloads\Windows API Code Pack 1.1\Windows API Code Pack 1.1\binaries\Microsoft.WindowsAPICodePack.Shell.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
Expand Down
2 changes: 1 addition & 1 deletion MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
</ControlTemplate>
</Button.Template>
</Button>
<TextBlock Name="lbl_enabled" Margin="180,0,180,97" TextWrapping="Wrap" Text="" Width="422" TextAlignment="Center" VerticalAlignment="Bottom"/>
<TextBlock Name="lbl_enabled" Margin="140,0,140,97" TextWrapping="Wrap" Text="" Width="502" TextAlignment="Center" VerticalAlignment="Bottom"/>
<RadioButton x:Name="rbtn_bf2015" Content="Star Wars: Battlefront (2015)" Margin="50,25,492,304" Foreground="#FFF1F1F1" FontSize="14" Height="20" VerticalContentAlignment="Center" Checked="rbtn_bf2015_Checked"/>
<RadioButton x:Name="rbtn_bf2017" Content="Star Wars: Battlefront II (2017)" Margin="50,50,492,279" Foreground="#FFF1F1F1" FontSize="14" Height="20" VerticalContentAlignment="Center" Checked="rbtn_bf2017_Checked"/>
<RadioButton x:Name="rbtn_bf1" Content="Battlefield One" Margin="50,75,492,254" Foreground="#FFF1F1F1" FontSize="14" Height="20" VerticalContentAlignment="Center" Checked="rbtn_bf1_Checked"/>
Expand Down
56 changes: 32 additions & 24 deletions MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
using Microsoft.WindowsAPICodePack.Dialogs;
using System.IO;

namespace FrostyFix2 {
/// <summary>
Expand All @@ -28,32 +30,32 @@ public void checkStatus() {
lbl_enabled.Text = "Registry Key is Currently Broken";
lbl_enabled.Foreground = Brushes.Orange;
}
else if (isenabled == bf2015 + "\\ModData") {
lbl_enabled.Text = "Mods are Currently Enabled for Star Wars: Battlefront (2015)";
else if (isenabled.Contains(bf2015)) {
lbl_enabled.Text = "Mods are Currently Enabled for Star Wars: Battlefront (2015) using profile: " + new DirectoryInfo(Environment.GetEnvironmentVariable("GAME_DATA_DIR", EnvironmentVariableTarget.User)).Name;
}
else if (isenabled == bf2017 + "\\ModData") {
lbl_enabled.Text = "Mods are Currently Enabled for Star Wars: Battlefront II (2017)";
else if (isenabled.Contains(bf2017)) {
lbl_enabled.Text = "Mods are Currently Enabled for Star Wars: Battlefront II (2017) using profile: " + new DirectoryInfo(Environment.GetEnvironmentVariable("GAME_DATA_DIR", EnvironmentVariableTarget.User)).Name;
}
else if (isenabled == mea + "\\ModData") {
lbl_enabled.Text = "Mods are Currently Enabled for Mass Effect: Andromeda";
else if (isenabled.Contains(mea)) {
lbl_enabled.Text = "Mods are Currently Enabled for Mass Effect: Andromeda using profile: " + new DirectoryInfo(Environment.GetEnvironmentVariable("GAME_DATA_DIR", EnvironmentVariableTarget.User)).Name;
}
else if (isenabled == bf1 + "\\ModData") {
lbl_enabled.Text = "Mods are Currently Enabled for Battlefield One";
else if (isenabled.Contains(bf1)) {
lbl_enabled.Text = "Mods are Currently Enabled for Battlefield One using profile: " + new DirectoryInfo(Environment.GetEnvironmentVariable("GAME_DATA_DIR", EnvironmentVariableTarget.User)).Name;
}
else if (isenabled == nfs + "\\ModData") {
lbl_enabled.Text = "Mods are Currently Enabled for Need for Speed";
else if (isenabled.Contains(nfs)) {
lbl_enabled.Text = "Mods are Currently Enabled for Need for Speed using profile: " + new DirectoryInfo(Environment.GetEnvironmentVariable("GAME_DATA_DIR", EnvironmentVariableTarget.User)).Name;
}
else if (isenabled == nfspayback + "\\ModData") {
lbl_enabled.Text = "Mods are Currently Enabled for Need for Speed: Payback";
else if (isenabled.Contains(nfspayback)) {
lbl_enabled.Text = "Mods are Currently Enabled for Need for Speed: Payback using profile: " + new DirectoryInfo(Environment.GetEnvironmentVariable("GAME_DATA_DIR", EnvironmentVariableTarget.User)).Name;
}
else if (isenabled == gw2 + "\\ModData") {
lbl_enabled.Text = "Mods are Currently Enabled for PvZ: Garden Warfare 2";
else if (isenabled.Contains(gw2)) {
lbl_enabled.Text = "Mods are Currently Enabled for PvZ: Garden Warfare 2 using profile: " + new DirectoryInfo(Environment.GetEnvironmentVariable("GAME_DATA_DIR", EnvironmentVariableTarget.User)).Name;
}
else if (isenabled == dai + "\\ModData") {
lbl_enabled.Text = "Mods are Currently Enabled for Dragon Age: Inquisition";
else if (isenabled.Contains(dai)) {
lbl_enabled.Text = "Mods are Currently Enabled for Dragon Age: Inquisition using profile: " + new DirectoryInfo(Environment.GetEnvironmentVariable("GAME_DATA_DIR", EnvironmentVariableTarget.User)).Name;
}
else {
lbl_enabled.Text = "Mods are Currently Enabled for Custom Game";
lbl_enabled.Text = "Mods are Currently Enabled for Custom Game using profile: " + new DirectoryInfo(Environment.GetEnvironmentVariable("GAME_DATA_DIR", EnvironmentVariableTarget.User)).Name;
}
}
else {
Expand All @@ -63,13 +65,19 @@ public void checkStatus() {
}

private async void btn_enable_Click(object sender, RoutedEventArgs e) {
Mouse.OverrideCursor = Cursors.Wait;
Environment.SetEnvironmentVariable("GAME_DATA_DIR", datadir + "\\ModData", EnvironmentVariableTarget.User);
await Task.Delay(10);
Mouse.OverrideCursor = null;
checkStatus();
AfterPatchWindow afterpatch = new AfterPatchWindow();
afterpatch.Show();
CommonOpenFileDialog dialog = new CommonOpenFileDialog();
dialog.Title = "Select Profile";
dialog.InitialDirectory = datadir + "ModData\\";
dialog.IsFolderPicker = true;
if (dialog.ShowDialog() == CommonFileDialogResult.Ok) {
Mouse.OverrideCursor = Cursors.Wait;
Environment.SetEnvironmentVariable("GAME_DATA_DIR", dialog.FileName, EnvironmentVariableTarget.User);
await Task.Delay(10);
Mouse.OverrideCursor = null;
checkStatus();
AfterPatchWindow afterpatch = new AfterPatchWindow();
afterpatch.Show();
}
}

private async void btn_disable_Click(object sender, RoutedEventArgs e) {
Expand Down
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.2.1")]
[assembly: AssemblyFileVersion("2.2.1")]
[assembly: AssemblyVersion("2.3.0")]
[assembly: AssemblyFileVersion("2.3.0")]

0 comments on commit fff9cb9

Please sign in to comment.