From 83f7a38e43b04f90bdf3f04a7766a2c07b60a0c1 Mon Sep 17 00:00:00 2001 From: Asval Date: Sun, 3 Nov 2019 22:43:47 +0100 Subject: [PATCH] added merger up down + auto things properties are saved + cleaned last pr (auto pak path + auto main aes) + no more save raw data freeze + diff mode with deleted assets log --- FModel/App.config | 9 +++ FModel/FModel.csproj | 4 +- FModel/FModel_Main.xaml | 9 +-- FModel/FModel_Main.xaml.cs | 4 ++ FModel/Forms/AESManager.xaml.cs | 44 +------------- FModel/Forms/FModel_ImagesMerger.xaml | 4 +- FModel/Forms/FModel_ImagesMerger.xaml.cs | 55 +++++++++++++++++ FModel/Forms/FModel_Settings.xaml.cs | 60 ++++--------------- FModel/Methods/Assets/AssetsLoader.cs | 9 +-- FModel/Methods/PAKs/PAKsLoader.cs | 31 ++++++++-- FModel/Methods/PAKs/RegisterFromPath.cs | 46 ++++++++++++++ .../FDictionaryHeader/FDictionaryHeader.cs | 24 ++++++++ .../FDictionaryHeader/FOodleCompressedData.cs | 18 ++++++ .../UDictionary/UDictionary.cs} | 34 ----------- FModel/Methods/Utilities/AssetsUtility.cs | 54 ++++++++++++++++- FModel/Methods/Utilities/EndpointsUtility.cs | 8 +++ FModel/Methods/Utilities/UIUtility.cs | 5 +- FModel/Properties/Settings.Designer.cs | 36 +++++++++++ FModel/Properties/Settings.settings | 9 +++ 19 files changed, 314 insertions(+), 149 deletions(-) create mode 100644 FModel/Methods/PakReader/ExportObject/UDictionary/FDictionaryHeader/FDictionaryHeader.cs create mode 100644 FModel/Methods/PakReader/ExportObject/UDictionary/FDictionaryHeader/FOodleCompressedData.cs rename FModel/Methods/PakReader/{UDicReader.cs => ExportObject/UDictionary/UDictionary.cs} (69%) 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 @@