diff --git a/FModel/App.config b/FModel/App.config index 175c75f5..99863990 100644 --- a/FModel/App.config +++ b/FModel/App.config @@ -85,6 +85,15 @@ True + + False + + + False + + + False + diff --git a/FModel/FModel.csproj b/FModel/FModel.csproj index 6eebf3ec..fd14f544 100644 --- a/FModel/FModel.csproj +++ b/FModel/FModel.csproj @@ -236,6 +236,8 @@ + + @@ -314,7 +316,7 @@ - + diff --git a/FModel/FModel_Main.xaml b/FModel/FModel_Main.xaml index bfa2e831..aa7acee3 100644 --- a/FModel/FModel_Main.xaml +++ b/FModel/FModel_Main.xaml @@ -5,6 +5,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:FModel" xmlns:commands="clr-namespace:FModel.Commands" + xmlns:properties="clr-namespace:FModel.Properties" xmlns:TreeViewModel="clr-namespace:FModel.Methods.TreeViewModel" xmlns:avalonedit="http://icsharpcode.net/sharpdevelop/avalonedit" x:Class="FModel.MainWindow" @@ -18,7 +19,7 @@ WindowStartupLocation="CenterScreen" Icon="Logo.ico" Loaded="Window_Loaded" - UseLayoutRounding="True"> + UseLayoutRounding="True" Closed="Window_Closed"> @@ -64,14 +65,14 @@ - + - + @@ -85,7 +86,7 @@ - + diff --git a/FModel/FModel_Main.xaml.cs b/FModel/FModel_Main.xaml.cs index f93a4468..dccd949d 100644 --- a/FModel/FModel_Main.xaml.cs +++ b/FModel/FModel_Main.xaml.cs @@ -60,6 +60,10 @@ namespace FModel AvalonEdit.SetAEConfig(); } + private void Window_Closed(object sender, System.EventArgs e) + { + FProp.Default.Save(); + } #region BUTTON EVENTS private void Button_AESManager_Click(object sender, RoutedEventArgs e) diff --git a/FModel/Forms/AESManager.xaml.cs b/FModel/Forms/AESManager.xaml.cs index cf09820f..918b0fd9 100644 --- a/FModel/Forms/AESManager.xaml.cs +++ b/FModel/Forms/AESManager.xaml.cs @@ -1,15 +1,10 @@ using FModel.Methods; using FModel.Methods.AESManager; using FModel.Methods.Utilities; -using Newtonsoft.Json; -using System; using System.Collections.Generic; using System.IO; using System.Linq; -using System.Net; -using System.Net.Http; using System.Text.RegularExpressions; -using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Media; @@ -31,47 +26,10 @@ namespace FModel.Forms this.SetValue(TextOptions.TextFormattingModeProperty, TextFormattingMode.Display); } - private async void Window_Loaded(object sender, RoutedEventArgs e) + private void Window_Loaded(object sender, RoutedEventArgs e) { AddLblTxtForDynamicPAKs(); GetUserSettings(); - if (string.IsNullOrEmpty(FProp.Default.FPak_MainAES)) - { - await SetMainKey(); - } - } - - /// - /// Fetch latest version's main aes key. - /// - /// - private async Task SetMainKey() - { - dynamic key = null; - if (DLLImport.IsInternetAvailable()) - { - try - { - using (HttpClient web = new HttpClient()) - { - //Not using BenBot api since Rate Limit - key = JsonConvert.DeserializeObject(await web.GetStringAsync("https://fnbot.shop/api/aes.json")); - } - MAesTextBox.Text = $"0x{key.aes}"; - FProp.Default.FPak_MainAES = $"{key.aes}"; - } - catch (Exception) - { - new UpdateMyConsole("There was a problem getting the latest aes key for main pak files.", CColors.Blue, true).Append(); - } - - } - else - { - new UpdateMyConsole("Your internet connection is currently unavailable, can't check for dynamic keys at the moment.", CColors.Blue, true).Append(); - - } - } private void Button_Click(object sender, RoutedEventArgs e) diff --git a/FModel/Forms/FModel_ImagesMerger.xaml b/FModel/Forms/FModel_ImagesMerger.xaml index e4bcd6db..24d3b04d 100644 --- a/FModel/Forms/FModel_ImagesMerger.xaml +++ b/FModel/Forms/FModel_ImagesMerger.xaml @@ -17,7 +17,9 @@