Skip to content

Commit

Permalink
= _ =
Browse files Browse the repository at this point in the history
  • Loading branch information
BigSpice committed Mar 6, 2023
1 parent bdee339 commit 488f9d8
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 127 deletions.
Binary file modified VTOL_2.0.0/.vs/VTOL/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
16 changes: 15 additions & 1 deletion VTOL_2.0.0/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ public MainWindow()
NotificationManager = new NotificationManager();
minimize_to_tray = Properties.Settings.Default.Minimize_to_Tray;
Profile_TAG.Content = Properties.Settings.Default.Profile_Name;

Properties.Settings.Default.Profile_Name = "";
Properties.Settings.Default.Save();
if (!File.Exists(AppDataFolder + @"\VTOL_DATA\Settings\User_Settings.Json"))
{ string DocumentsFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);

Expand Down Expand Up @@ -718,9 +719,22 @@ private void NORTHSTAR_BUTTON_Click(object sender, RoutedEventArgs e)

private void Changelog_Click(object sender, RoutedEventArgs e)
{
try {
string url = @"https://github.com/R2Northstar/Northstar/releases/tag/v" + NORTHSTAR_BUTTON.Content.ToString().Replace("Northstar Version", "").Replace("-", "").Trim().Replace(" ", "");

OPEN_WEBPAGE(url);

}


catch (Exception ex)
{
MessageBox.Show("Exception Encountered! - " + ex.Message);
Log.Error(ex, $"A crash happened at {DateTime.Now.ToString("yyyy - MM - dd HH - mm - ss.ff", CultureInfo.InvariantCulture)}{Environment.NewLine}");
logger2.Open();
logger2.Log($"A crash happened at {DateTime.Now.ToString("yyyy - MM - dd HH - mm - ss.ff", CultureInfo.InvariantCulture)}{Environment.NewLine}" + ex.Message + Environment.NewLine + ex.StackTrace + Environment.NewLine + ex.Source + Environment.NewLine + ex.InnerException + Environment.NewLine + ex.TargetSite + Environment.NewLine + "From VERSION - " + Assembly.GetExecutingAssembly().GetName().Version.ToString() + Environment.NewLine);
logger2.Close();
}
}

private void Troubleshoot_Click(object sender, RoutedEventArgs e)
Expand Down
73 changes: 12 additions & 61 deletions VTOL_2.0.0/Pages/Page_Home.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,7 @@
using System.Globalization;
using Ionic.Zip;
using VTOL.Scripts;
using GameFinder.StoreHandlers.Steam;
using System.Runtime.InteropServices;
using GameFinder.RegistryUtils;
using GameFinder.StoreHandlers.Origin;
using VTOL.Properties;
using Pixelmaniac.Notifications;
using System.Xml;
Expand Down Expand Up @@ -836,62 +833,7 @@ async void Auto_Install_(bool resart_ = false)


}
public string Search_Using_Game_Lib()
{
try
{
//////SteamFirst///
// use the Windows registry on Windows
// Linux doesn't have a registry
var handler = RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
? new SteamHandler(new WindowsRegistry())
: new SteamHandler(null);

// method 1: iterate over the game-error result
SteamGame? steamgame = handler.FindOneGameById(432912, out string[] errors);

if (steamgame != null && steamgame.Name.Count() > 2)
{
return steamgame.Path;
}
else
{
/////Failed/////
return null;

}



///////Origin////
var Origin_handler = new OriginHandler();

// method 1: iterate over the game-error result
foreach (var (game, error) in Origin_handler.FindAllGames())
{
if (game.InstallPath.Contains("Titanfall2") || game.InstallPath.Contains("TitanFall2"))
{
return game.InstallPath;
}
else
{
/////Failed/////
return null;
}
}
}

catch (Exception ex)
{
Log.Error(ex, $"A crash happened at {DateTime.Now.ToString("yyyy - MM - dd HH - mm - ss.ff", CultureInfo.InvariantCulture)}{Environment.NewLine}");
Main.logger2.Open();
Main.logger2.Log($"A crash happened at {DateTime.Now.ToString("yyyy - MM - dd HH - mm - ss.ff", CultureInfo.InvariantCulture)}{Environment.NewLine}" + ex.Message + Environment.NewLine + ex.StackTrace + Environment.NewLine + ex.Source + Environment.NewLine + ex.InnerException + Environment.NewLine + ex.TargetSite + Environment.NewLine + "From VERSION - " + Assembly.GetExecutingAssembly().GetName().Version.ToString() + Environment.NewLine + System.Reflection.MethodBase.GetCurrentMethod().Name);
Main.logger2.Close();

}
return null;

}

void Restart()
{
var currentExecutablePath = Process.GetCurrentProcess().MainModule.FileName;
Expand Down Expand Up @@ -4221,15 +4163,24 @@ private void Button_MouseLeave_1(object sender, MouseEventArgs e)

void ShowBanner()
{

WARNING_BANNER.Visibility = Visibility.Visible;


WARNING_BANNER.Visibility = Visibility.Visible;


}
void ShowWelcome()
{
DispatchIfNecessary(() =>
{
DispatchIfNecessary(async () =>
{
Main.Profile_TAG.Content = "";
Properties.Settings.Default.Profile_Name = "";
Properties.Settings.Default.Save();
Main.Profile_TAG.Content = Properties.Settings.Default.Profile_Name;
Main.Profile_TAG.Refresh();
});
WELCOME_BANNER.Visibility = Visibility.Visible;
Main.RootNavigation.IsEnabled = false;
Expand Down
2 changes: 1 addition & 1 deletion VTOL_2.0.0/Pages/Page_Profiles.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
<ui:Button x:Name="Import_Profile" Icon="ArrowImport24" Height="30" Margin="0,395,245,0" VerticalAlignment="Top" BorderBrush="{x:Null}" Content="{x:Static properties:Language.Page_Profiles_ImportProfile}" Padding="0,0,0,0" ToolTip="Import Profile" Background="#FF383838" ClickMode="Press" HorizontalAlignment="Right" Width="190" Visibility="Collapsed" />
<ui:Button x:Name="Export_Profile" Icon="ArrowExportLtr24" Height="30" Margin="0,548,50,0" VerticalAlignment="Top" BorderBrush="{x:Null}" Content="{x:Static properties:Language.Page_Profiles_ExportProfile}" Padding="0,0,0,0" ToolTip="Export Profile" Background="#FF383838" ClickMode="Press" HorizontalAlignment="Right" Width="190" Click="Export_Profile_Click" MouseOverBackground="#FF484848" PressedBackground="#FF7F7F7F" />
<ui:Button x:Name="Add_Profile" Icon="Add12" Height="30" Margin="50,548,0,0" VerticalAlignment="Top" BorderBrush="{x:Null}" Content="{x:Static properties:Language.Page_Profiles_AddProfile}" Padding="0,0,0,0" ToolTip="Add Profile" Background="#FF383838" ClickMode="Press" Width="195" Click="Add_Profile_Click" MouseOverBackground="#FF484848" PressedBackground="#FF7F7F7F" />
<ui:Button x:Name="Clear_Profile" Icon="New20" Height="30" Margin="0,76,50,0" VerticalAlignment="Top" BorderBrush="{x:Null}" Content="Clear Profile Data" Padding="0,0,0,0" ToolTip="Clear Profile" Background="#FF383838" ClickMode="Press" HorizontalAlignment="Right" Width="190" MouseOverBackground="#FF484848" PressedBackground="#FF7F7F7F" Click="Clear_Profile_Click" Initialized="Clear_Profile_Initialized" />
<ui:Button x:Name="Clear_Profile" Icon="New20" Height="30" Margin="0,76,50,0" VerticalAlignment="Top" BorderBrush="{x:Null}" Content="Clear Profile Data" Padding="0,0,0,0" ToolTip="Clear Profile" Background="#FF383838" ClickMode="Press" HorizontalAlignment="Right" Width="190" MouseOverBackground="#FF484848" PressedBackground="#FF7F7F7F" Click="Clear_Profile_Click" Initialized="Clear_Profile_Initialized" Loaded="Clear_Profile_Loaded" />

<ComboBox x:Name="Extra_Menu" Margin="246,396,0,0" VerticalAlignment="Top" Padding="0,0,0,0" BorderBrush="{x:Null}" BorderThickness="0,0,0,0" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" HorizontalAlignment="Left" Background="#FF383838" Height="26" DropDownClosed="ComboBox_DropDownClosed" RenderTransformOrigin="0.5,0.5" MinHeight="28" SelectionChanged="Extra_Menu_SelectionChanged" Visibility="Hidden" >

Expand Down
58 changes: 29 additions & 29 deletions VTOL_2.0.0/Pages/Page_Profiles.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
using System.Runtime.Serialization.Formatters.Binary;
using System.IO.Compression;
using System.Threading;
using NLog.Targets;
using System.Text.RegularExpressions;
using HandyControl.Tools;
using System.Windows.Media.Animation;
Expand Down Expand Up @@ -2000,6 +1999,21 @@ private void Page_Loaded(object sender, RoutedEventArgs e)
try {
DispatchIfNecessary(async () =>
{
if (Main.Profile_TAG.Content == null || Main.Profile_TAG.Content == "" || Main.Profile_TAG.Content.ToString().Length < 1)
{
Clear_Profile.IsEnabled = false;
}else if (Properties.Settings.Default.Profile_Name == "" || Properties.Settings.Default.Profile_Name == null || Properties.Settings.Default.Profile_Name.Length < 1)
{
Clear_Profile.IsEnabled = false;
}
else
{
Clear_Profile.IsEnabled = true;
}
LoadProfiles();
//PopulateListBoxWithRandomPaths();
});
Expand Down Expand Up @@ -2232,11 +2246,15 @@ private void I_Backup_Mods_Checked(object sender, RoutedEventArgs e)

private void Clear_Profile_Click(object sender, RoutedEventArgs e)
{
try {

Properties.Settings.Default.Profile_Name = "";
Properties.Settings.Default.Save();
Main.Profile_TAG.Content = Properties.Settings.Default.Profile_Name;
try {
DispatchIfNecessary(async () =>
{
Main.Profile_TAG.Content = "";
Properties.Settings.Default.Profile_Name = "";
Properties.Settings.Default.Save();
Main.Profile_TAG.Content = Properties.Settings.Default.Profile_Name;
Main.Profile_TAG.Refresh();
});
}

catch (Exception ex)
Expand All @@ -2251,30 +2269,12 @@ private void Clear_Profile_Click(object sender, RoutedEventArgs e)

private void Clear_Profile_Initialized(object sender, EventArgs e)
{
try
{


if(Main.Profile_TAG.Content != null || Main.Profile_TAG.Content != ""){
Clear_Profile.IsEnabled = false;

}
else
{
Clear_Profile.IsEnabled = true;


}
}

catch (Exception ex)
{
Main.logger2.Open();
Main.logger2.Log($"A crash happened at {DateTime.Now.ToString("yyyy - MM - dd HH - mm - ss.ff", CultureInfo.InvariantCulture)}{Environment.NewLine}" + ex.Message + Environment.NewLine + ex.StackTrace + Environment.NewLine + ex.Source + Environment.NewLine + ex.InnerException + Environment.NewLine + ex.TargetSite + Environment.NewLine + "From VERSION - " + Assembly.GetExecutingAssembly().GetName().Version.ToString() + Environment.NewLine + System.Reflection.MethodBase.GetCurrentMethod().Name);
Main.logger2.Close();


}

}
private void Clear_Profile_Loaded(object sender, RoutedEventArgs e)
{

}
}
}
2 changes: 1 addition & 1 deletion VTOL_2.0.0/Pages/Page_Tools.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@
</ui:Button.PressedBackground>
</ui:Button>
<ui:Button x:Name="LEGION_INSTALL" VerticalAlignment="Top" Icon="ArrowDown28" HorizontalAlignment="Stretch" Background="#FF5B0606" Margin="10,237,10,0" Height="55" Content="Install" BorderBrush="{x:Null}" ClickMode="Press" Click="LEGION_INSTALL_Click"/>
<Label Margin="10,211,421,68" Content="1.5.0" FontSize="14" Foreground="#FFB7B7B7" HorizontalContentAlignment="Center" Background="{x:Null}"/>
<Label Margin="10,211,421,68" Content="1.6.0" FontSize="14" Foreground="#FFB7B7B7" HorizontalContentAlignment="Center" Background="{x:Null}"/>

</Grid >

Expand Down
64 changes: 42 additions & 22 deletions VTOL_2.0.0/Pages/Page_Tools.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing;
using Syncfusion;
using Wpf.Ui.Common;
using Brushes = System.Windows.Media.Brushes;
using Image = SixLabors.ImageSharp.Image;
Expand All @@ -39,7 +38,6 @@
using System.Diagnostics;
using System.Windows.Media.Animation;
using System.Text.RegularExpressions;
using NLog;
using System.Reflection;
using Downloader;
using System.ComponentModel;
Expand Down Expand Up @@ -404,6 +402,7 @@ public partial class Page_Tools : Page
public Page_Tools()
{
InitializeComponent();
try {
string defualt_repak = @"for %%i in ("+'\u0022' + @"%~dp0maps\*" + '\u0022'+ ") do " + '\u0022'+ @"% ~dp0RePak.exe" + '\u0022' + " "+ '\u0022' + "%%i"+ '\u0022' + Environment.NewLine + "pause";
if (Properties.Settings.Default.RePak_Launch_Args == "" || Properties.Settings.Default.RePak_Launch_Args == null)
{
Expand Down Expand Up @@ -579,6 +578,14 @@ YOUR DESCRIPTION
Output_Directory.Text = Environment.CurrentDirectory;
Output_Box.Text = Environment.CurrentDirectory;
Tools_Dir = Main.User_Settings_Vars.NorthstarInstallLocation + @"VTOL_ExternalTools\";
}
catch (Exception ex)
{
Log.Error(ex, $"A crash happened at {DateTime.Now.ToString("yyyy - MM - dd HH - mm - ss.ff", CultureInfo.InvariantCulture)}{Environment.NewLine}");
Main.logger2.Open();
Main.logger2.Log($"A crash happened at {DateTime.Now.ToString("yyyy - MM - dd HH - mm - ss.ff", CultureInfo.InvariantCulture)}{Environment.NewLine}" + ex.Message + Environment.NewLine + ex.StackTrace + Environment.NewLine + ex.Source + Environment.NewLine + ex.InnerException + Environment.NewLine + ex.TargetSite + Environment.NewLine + "From VERSION - " + Assembly.GetExecutingAssembly().GetName().Version.ToString() + Environment.NewLine + System.Reflection.MethodBase.GetCurrentMethod().Name);
Main.logger2.Close();
}

}
private static MainWindow GetMainWindow()
Expand Down Expand Up @@ -2872,34 +2879,47 @@ await Task.Run(() =>
}
private void Tabs_SelectionChanged(object sender, SelectionChangedEventArgs e)
{

if (Tabs.SelectedItem.ToString() != null)
{

if (Tabs.SelectedValue.ToString().Contains("External Tools"))
if (Directory.Exists(Tools_Dir)) {
if (Tabs.SelectedItem.ToString() != null)
{
Check_For_Tools();
fade_dav(false);

}
else if (Tabs.SelectedValue.ToString().Contains("Advocate"))
{
fade_dav(true);
if (Directory.Exists(Tools_Dir + @"RePak") && File.Exists(Tools_Dir + @"RePak\" + "RePak.exe") && !File.Exists(Mod_Adv_Repak_Path))
if (Tabs.SelectedValue.ToString().Contains("External Tools"))
{
Properties.Settings.Default.REpak_Folder_Path = Tools_Dir + @"RePak\" + "RePak.exe"; ;
Properties.Settings.Default.Save();
Mod_Adv_Repak_Path = Tools_Dir + @"RePak\" + "RePak.exe";
Zip_Box_Advocate_Copy.Text = Mod_Adv_Repak_Path;
Check_For_Tools();
fade_dav(false);

}
else if (Tabs.SelectedValue.ToString().Contains("Advocate"))
{
fade_dav(true);
if (Directory.Exists(Tools_Dir + @"RePak") && File.Exists(Tools_Dir + @"RePak\" + "RePak.exe") && !File.Exists(Mod_Adv_Repak_Path))
{
Properties.Settings.Default.REpak_Folder_Path = Tools_Dir + @"RePak\" + "RePak.exe"; ;
Properties.Settings.Default.Save();
Mod_Adv_Repak_Path = Tools_Dir + @"RePak\" + "RePak.exe";
Zip_Box_Advocate_Copy.Text = Mod_Adv_Repak_Path;
}


}
else
else
{
fade_dav(false);
}


}
}
else
{
TryCreateDirectory(Tools_Dir);
if (!Directory.Exists(Tools_Dir))
{
fade_dav(false);
SnackBar.Icon = SymbolRegular.ErrorCircle20;
SnackBar.Appearance = ControlAppearance.Danger; SnackBar.Title = "ERROR";
SnackBar.Message = "Tools Directory Empty and could not be created!";
SnackBar.Show();
}


}


Expand Down
16 changes: 4 additions & 12 deletions VTOL_2.0.0/VTOL.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -267,27 +267,21 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="GameFinder.Common" Version="2.5.0" />
<PackageReference Include="GameFinder.RegistryUtils" Version="2.5.0" />
<PackageReference Include="GameFinder.StoreHandlers.Origin" Version="2.5.0" />
<PackageReference Include="GameFinder.StoreHandlers.Steam" Version="2.5.0" />
<PackageReference Include="Magick.NET-Q16-x86" Version="12.2.1" />
<PackageReference Include="Microsoft.NETCore.Targets" Version="5.0.0" PrivateAssets="all" />
<PackageReference Include="Aspose.Zip" Version="22.12.0" />
<PackageReference Include="Aspose.Zip" Version="23.2.0" />
<PackageReference Include="BCnEncoder.Net" Version="2.1.0" />
<PackageReference Include="BCnEncoder.Net.ImageSharp" Version="1.1.1" />
<PackageReference Include="ByteSize" Version="2.1.1" />
<PackageReference Include="DotNetZip" Version="1.16.0" />
<PackageReference Include="Downloader" Version="3.0.2" />
<PackageReference Include="Downloader" Version="3.0.3" />
<PackageReference Include="HandyControls" Version="3.4.4" />
<PackageReference Include="Iconic.Zlib.Netstandard" Version="1.0.0" />
<PackageReference Include="Json.Net" Version="1.0.33" />
<PackageReference Include="LiveCharts.Wpf" Version="0.9.7" />
<PackageReference Include="Microsoft.Build" Version="17.4.0" />
<PackageReference Include="Microsoft.Build" Version="17.5.0" />
<PackageReference Include="MSBuild.Microsoft.VisualStudio.Web.targets" Version="14.0.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="NLog" Version="5.1.1" />
<PackageReference Include="NLog.Targets.Syslog" Version="7.0.0" />
<PackageReference Include="Octokit" Version="5.0.0" />
<PackageReference Include="Ookii.Dialogs.Wpf" Version="5.0.1" />
<PackageReference Include="Parallax.WPF" Version="1.0.8" />
Expand All @@ -299,15 +293,13 @@
<PackageReference Include="Serilog.Sinks.FastConsole" Version="2.3.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.3" />
<PackageReference Include="Syncfusion.SfImageEditor.WPF" Version="20.3.0.50" />
<PackageReference Include="Syncfusion.SfSkinManager.WPF" Version="20.3.0.50" />
<PackageReference Include="System.Drawing.Common" Version="7.0.0" />
<PackageReference Include="System.Management" Version="7.0.0" />
<PackageReference Include="System.Runtime.InteropServices" Version="4.3.0" />
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="7.0.0" />
<PackageReference Include="Walterlv.Windows.Interop" Version="7.4.0" />
<PackageReference Include="WPF-UI" Version="2.0.3" />
<PackageReference Include="XamlAnimatedGif" Version="2.1.0" />
<PackageReference Include="XamlAnimatedGif" Version="2.1.1" />
<PackageReference Include="XamlFlair.WPF" Version="1.2.13" />
</ItemGroup>

Expand Down
Binary file modified [Titanfall2_Downloadable_Tools]/LEGION+.zip
Binary file not shown.

0 comments on commit 488f9d8

Please sign in to comment.