Skip to content

Commit

Permalink
Updated Enabled mods Json checks
Browse files Browse the repository at this point in the history
  • Loading branch information
BigSpice committed Feb 4, 2024
1 parent 3f6f73f commit 4b0bd50
Show file tree
Hide file tree
Showing 26 changed files with 21 additions and 293 deletions.
Binary file modified VTOL_2.0.0/.vs/ProjectEvaluation/vtol.metadata.v7.bin
Binary file not shown.
Binary file modified VTOL_2.0.0/.vs/ProjectEvaluation/vtol.projects.v7.bin
Binary file not shown.
Binary file modified VTOL_2.0.0/.vs/VTOL/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified VTOL_2.0.0/.vs/VTOL/v17/.futdcache.v2
Binary file not shown.
13 changes: 2 additions & 11 deletions VTOL_2.0.0/Pages/Page_Home.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1414,18 +1414,9 @@ public string Read_From_TextFile_OneLine(string Filepath)

}
catch (FileNotFoundException ex)
{
var st = new System.Diagnostics.StackTrace(ex, true);
var frame = st.GetFrame(0);
var line = frame.GetFileLineNumber();
var method = frame.GetMethod().Name;
var className = frame.GetMethod().DeclaringType.Name;
var variables = ""; // You would need to add logic to capture variable values
{
Log.Error(ex, $"A crash happened at {DateTime.Now.ToString("yyyy - MM - dd HH - mm - ss.ff", CultureInfo.InvariantCulture)}{Environment.NewLine}{ex.InnerException}{Environment.NewLine}");

Log.Fatal(ex, $"An error occurred at {DateTime.Now.ToString("yyyy - MM - dd HH - mm - ss.ff", CultureInfo.InvariantCulture)}" +
$" Line Number: {line}, Method Name: {method}, Class Name: {className}, Variables: {variables}" +
$"{Environment.NewLine}{ex.InnerException}{Environment.NewLine}");//Send_Error_Notif(GetTextResource("NOTIF_ERROR_CANNOT_FIND") + Filepath);
//Write_To_Log(ErrorManager(e));


}
Expand Down
17 changes: 10 additions & 7 deletions VTOL_2.0.0/Pages/Page_Mods.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2322,11 +2322,17 @@ protected virtual void Delete_Action(object sender, RoutedEventArgs e)
// Read the JSON file
string jsonContent = File.ReadAllText(Json_Path);

if (jsonContent.IsNullOrEmpty() != true && jsonContent.Length > 5)

if (jsonContent.IsNullOrEmpty() == true || jsonContent.Length > 2 || jsonContent == "null")
{// Parse the JSON content


JObject jsonObject = JObject.Parse(jsonContent);
jsonContent = "{\t\t\n\n}";
//File.WriteAllText(Json_Path, "{\t\t\n\n}");

}

JObject jsonObject = JObject.Parse(jsonContent);
string Name = workingmod;
if (jsonObject.TryGetValue(Name, out _))
{
Expand All @@ -2341,15 +2347,12 @@ protected virtual void Delete_Action(object sender, RoutedEventArgs e)
// Write back to the file
File.WriteAllText(Json_Path, updatedJson);

}
else
{
File.WriteAllText(Json_Path, "{\t\t\n\n}");


}


}


string delete_mod_path = Dialog.Tag.ToString();
if (Directory.Exists(temp_Dir))
Expand Down
10 changes: 9 additions & 1 deletion VTOL_2.0.0/Pages/Page_Thunderstore.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Downloader;
using FuzzyString;
using Lsj.Util.Text;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Serilog;
Expand Down Expand Up @@ -3747,6 +3748,14 @@ public async Task Unpack_To_Location_Custom(string Target_Zip, string Destinatio
// Read the JSON file
string jsonContent = File.ReadAllText(Json_Path);

if (jsonContent.IsNullOrEmpty() == true || jsonContent.Length > 2 || jsonContent == "null")
{// Parse the JSON content


jsonContent = "{\t\t\n\n}";
//File.WriteAllText(Json_Path, "{\t\t\n\n}");

}
// Parse the JSON content
JObject jsonObject = JObject.Parse(jsonContent);

Expand Down Expand Up @@ -3789,7 +3798,6 @@ public async Task Unpack_To_Location_Custom(string Target_Zip, string Destinatio
else
{

Console.WriteLine("Candidate Detected ------\n\n\n\n\n");

DispatchIfNecessary(async () =>
{
Expand Down
Binary file removed VTOL_2.0.0/Tools-Silhouette-Transparent.png
Binary file not shown.
274 changes: 0 additions & 274 deletions VTOL_2.0.0/UpgradeLog.htm

This file was deleted.

Binary file removed VTOL_2.0.0/UpgradeLog2.htm
Binary file not shown.
Binary file removed VTOL_2.0.0/UpgradeLog3.htm
Binary file not shown.
Binary file removed VTOL_2.0.0/UpgradeLog4.htm
Binary file not shown.
Binary file removed VTOL_2.0.0/UpgradeLog5.htm
Binary file not shown.
Binary file removed VTOL_2.0.0/UpgradeLog6.htm
Binary file not shown.
Binary file removed VTOL_2.0.0/alternator.jpg
Binary file not shown.
Binary file removed VTOL_2.0.0/server-icon-download-icons-17.png
Binary file not shown.

0 comments on commit 4b0bd50

Please sign in to comment.