public MainWindow() { AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); InitializeComponent(); DataContext = this; Settings.Reload(); TextSize = Settings.FontSize; TextColor = Settings.FontColor; Descriptions_Origin = AnalyzeTxt.AnalyzeTextFile(App.Filename_Origin); Descriptions_Chinese = AnalyzeTxt.AnalyzeTextFile(App.Filename_Translate); Dictionary_ItemName = AnalyzeDatcs.GetDictionary(AnalyzeDatcs.ConvertDatToCSV(App.Filename_Words)); if (!Directory.Exists(App.Directory_BaseType) || !File.Exists(Path.Combine(App.Directory_BaseType, "Active+Skill+Gem.json"))) { BaseTypeHelper.DownloadAsync().Wait(); } var jsonList = Directory.GetFiles(App.Directory_BaseType, "*.json").ToList(); foreach (var x in jsonList) { Dictionary_BaseType = BaseType.AnalyzeJsonFile(x, Dictionary_BaseType); } if (!string.IsNullOrWhiteSpace(Settings.AddonFile)) { Dictionary_Addons.Reload(Settings.AddonFile); } ApplicationHelper applicationHelper = new ApplicationHelper(); applicationHelper.ForegroundWindowChanged += () => { POE_Foreground = ApplicationHelper.IsPathOfExileTop(Handle); Opacity = POE_Foreground ? 1 : 0; if (POE_Foreground) { POE_Rect = ApplicationHelper.PathOfExileDimentions; Left = POE_Rect.Left; Top = POE_Rect.Top; Width = POE_Rect.Right - POE_Rect.Left; Height = POE_Rect.Bottom - POE_Rect.Top; } }; }