Skip to content

Commit

Permalink
Merge pull request #5 from thumpnail/Empty_Page_Fix
Browse files Browse the repository at this point in the history
Fix for Current globals.json files
  • Loading branch information
themaoci authored Mar 30, 2021
2 parents 52448fc + fa97764 commit a788394
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
12 changes: 10 additions & 2 deletions JET_ProfileEditor/ExtClasses.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -195,6 +195,14 @@ public class GridProps
}

public class ServerGlobals
{
//moved the Global Declaration to the Data Class -Fenex
public Data data { get; set; }
}

//basicly a dirty fix adding compatibility for the "data" json node right before the "config" json node -Fenex
//"HealthEffect" and "ItemPreset" related stuff might not work in the profile editor since the json path changed -Fenex
public class Data
{
public Global config { get; set; }
}
Expand Down Expand Up @@ -223,4 +231,4 @@ public class TraderSuit
public string _id { get; set; }
public string suiteId { get; set; }
}
}
}
10 changes: 6 additions & 4 deletions JET_ProfileEditor/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using MahApps.Metro.Controls;
Expand Down Expand Up @@ -244,7 +244,8 @@ private void LoadDataWorker_DoWork(object sender, DoWorkEventArgs e)
if (globalLang.Interface.ContainsKey(skill.Id))
commonSkills.Add(new SkillInfo { progress = (int)skill.Progress, name = globalLang.Interface[skill.Id], id = skill.Id });
}
foreach (var md in serverGlobals.config.Mastering)
//changed ...config... to ...data.config... -Fenex
foreach (var md in serverGlobals.data.config.Mastering)
{
string weapons = string.Empty;
foreach (var tmp in md.Templates.Where(x => globalLang.Templates.ContainsKey(x)))
Expand All @@ -268,7 +269,8 @@ private void LoadDataWorker_DoWork(object sender, DoWorkEventArgs e)
temp.Add(add);
Lang.Character.Skills.Mastering = temp.ToArray();
}
Dispatcher.Invoke(() => { allmastering_exp.Maximum = serverGlobals.config.Mastering.OrderByDescending(x => x.Level3).First()?.Level3 ?? 1000; });
//changed ...config... to ...data.config... -Fenex
Dispatcher.Invoke(() => { allmastering_exp.Maximum = serverGlobals.data.config.Mastering.OrderByDescending(x => x.Level3).First()?.Level3 ?? 1000; });
}
if (Lang.Character.TraderStandings != null)
{
Expand Down Expand Up @@ -1234,4 +1236,4 @@ private async void ShutdownCozServerRunned()
System.Windows.Application.Current.Shutdown();
}
}
}
}

0 comments on commit a788394

Please sign in to comment.