diff --git a/FModel/FModel_Main.xaml b/FModel/FModel_Main.xaml
index 3bec7842..e9ca9800 100644
--- a/FModel/FModel_Main.xaml
+++ b/FModel/FModel_Main.xaml
@@ -37,7 +37,7 @@
-
+
diff --git a/FModel/FModel_Main.xaml.cs b/FModel/FModel_Main.xaml.cs
index 7e2806e8..5265afa2 100644
--- a/FModel/FModel_Main.xaml.cs
+++ b/FModel/FModel_Main.xaml.cs
@@ -51,8 +51,7 @@ namespace FModel
FoldersUtility.LoadFolders();
FoldersUtility.CheckWatermark();
RegisterFromPath.FilterPAKs();
- if (FProp.Default.ReloadAES)
- DynamicKeysChecker.SetDynamicKeys();
+ DynamicKeysChecker.SetDynamicKeys();
RegisterDownloadedBackups.LoadBackupFiles();
}).ContinueWith(TheTask =>
{
@@ -155,6 +154,10 @@ namespace FModel
//not done yet
}
}
+ private void MI_ReloadAESs_Click(object sender, RoutedEventArgs e)
+ {
+ DynamicKeysChecker.SetDynamicKeys(true);
+ }
private async void MI_BackupPAKs_Click(object sender, RoutedEventArgs e)
{
await BackupPAKs.CreateBackupFile();
@@ -357,10 +360,5 @@ namespace FModel
}
}
#endregion
-
- private void MenuItem_Click(object sender, RoutedEventArgs e)
- {
- DynamicKeysChecker.SetDynamicKeys();
- }
}
}
diff --git a/FModel/Forms/FModel_Settings.xaml b/FModel/Forms/FModel_Settings.xaml
index 56583351..45e025a4 100644
--- a/FModel/Forms/FModel_Settings.xaml
+++ b/FModel/Forms/FModel_Settings.xaml
@@ -6,7 +6,7 @@
xmlns:local="clr-namespace:FModel.Forms"
mc:Ignorable="d"
Title="Settings"
- Height="585"
+ Height="581.5"
Width="610"
Style="{StaticResource {x:Type Window}}"
WindowStartupLocation="CenterScreen"
@@ -14,23 +14,23 @@
ResizeMode="CanMinimize" Loaded="Window_Loaded"
>
-
+
-
+
-
+
-
+
@@ -76,7 +76,7 @@
-
+
diff --git a/FModel/Methods/AESManager/DynamicKeysChecker.cs b/FModel/Methods/AESManager/DynamicKeysChecker.cs
index 9ae260c6..7193cb5a 100644
--- a/FModel/Methods/AESManager/DynamicKeysChecker.cs
+++ b/FModel/Methods/AESManager/DynamicKeysChecker.cs
@@ -12,66 +12,71 @@ namespace FModel.Methods.AESManager
private static readonly string AESManager_PATH = FProp.Default.FOutput_Path + "\\FAESManager.xml";
private static List _oldAESEntriesList;
- public static void SetDynamicKeys()
+ public static void SetDynamicKeys(bool reaload = false)
{
- if (!File.Exists(AESManager_PATH))
+ if (FProp.Default.ReloadAES || reaload)
{
- AESEntries.AESEntriesList = new List();
- KeysManager.Serialize(string.Empty, string.Empty);
- }
- else
- {
- KeysManager.Deserialize();
- _oldAESEntriesList = AESEntries.AESEntriesList;
- }
-
- if (PAKEntries.PAKEntriesList != null && PAKEntries.PAKEntriesList.Any())
- {
- string KeysFromBen = EndpointsUtility.GetKeysFromBen();
- if (!string.IsNullOrEmpty(KeysFromBen))
+ if (!File.Exists(AESManager_PATH))
{
- Dictionary KeysDict = JsonConvert.DeserializeObject>(KeysFromBen);
- if (KeysDict != null)
- {
- AESEntries.AESEntriesList = new List();
- foreach (PAKInfosEntry Pak in PAKEntries.PAKEntriesList.Where(x => x.bTheDynamicPAK == true //DYNAMIC PAK ONLY
- && !AESEntries.AESEntriesList.Where(w => string.Equals(w.ThePAKName, Path.GetFileNameWithoutExtension(x.ThePAKPath))).Any() //IS NOT ALREADY ADDED
- ))
- {
- if (KeysDict.ContainsKey(Path.GetFileName(Pak.ThePAKPath)))
- {
- KeysManager.Serialize(Path.GetFileNameWithoutExtension(Pak.ThePAKPath), KeysDict[Path.GetFileName(Pak.ThePAKPath)].ToUpperInvariant().Substring(2));
+ AESEntries.AESEntriesList = new List();
+ KeysManager.Serialize(string.Empty, string.Empty);
+ }
+ else
+ {
+ KeysManager.Deserialize();
+ _oldAESEntriesList = AESEntries.AESEntriesList;
+ }
- if (_oldAESEntriesList != null)
+ if (PAKEntries.PAKEntriesList != null && PAKEntries.PAKEntriesList.Any())
+ {
+ string KeysFromBen = EndpointsUtility.GetKeysFromBen();
+ if (!string.IsNullOrEmpty(KeysFromBen))
+ {
+ Dictionary KeysDict = JsonConvert.DeserializeObject>(KeysFromBen);
+ if (KeysDict != null)
+ {
+ AESEntries.AESEntriesList = new List();
+ foreach (PAKInfosEntry Pak in PAKEntries.PAKEntriesList.Where(x => x.bTheDynamicPAK == true //DYNAMIC PAK ONLY
+ && !AESEntries.AESEntriesList.Where(w => string.Equals(w.ThePAKName, Path.GetFileNameWithoutExtension(x.ThePAKPath))).Any() //IS NOT ALREADY ADDED
+ ))
+ {
+ if (KeysDict.ContainsKey(Path.GetFileName(Pak.ThePAKPath)))
{
- if (!_oldAESEntriesList.Where(x => string.Equals(x.ThePAKKey, KeysDict[Path.GetFileName(Pak.ThePAKPath)].ToUpperInvariant().Substring(2))).Any())
+ KeysManager.Serialize(Path.GetFileNameWithoutExtension(Pak.ThePAKPath), KeysDict[Path.GetFileName(Pak.ThePAKPath)].ToUpperInvariant().Substring(2));
+
+ if (_oldAESEntriesList != null)
{
- new UpdateMyConsole(Path.GetFileName(Pak.ThePAKPath), CColors.Blue).Append();
- new UpdateMyConsole(" can now be opened.", CColors.White, true).Append();
+ if (!_oldAESEntriesList.Where(x => string.Equals(x.ThePAKKey, KeysDict[Path.GetFileName(Pak.ThePAKPath)].ToUpperInvariant().Substring(2))).Any())
+ {
+ new UpdateMyConsole(Path.GetFileName(Pak.ThePAKPath), CColors.Blue).Append();
+ new UpdateMyConsole(" can now be opened.", CColors.White, true).Append();
+ }
+ //else mean there was a FAESManager.xml but the key was already there and didn't change
+ }
+ else
+ {
+ //mostly for new users
+ new UpdateMyConsole(Path.GetFileName(Pak.ThePAKPath), CColors.Blue).Append();
+ new UpdateMyConsole(" can be opened.", CColors.White, true).Append();
}
- //else mean there was a FAESManager.xml but the key was already there and didn't change
}
else
{
- //mostly for new users
- new UpdateMyConsole(Path.GetFileName(Pak.ThePAKPath), CColors.Blue).Append();
- new UpdateMyConsole(" can be opened.", CColors.White, true).Append();
+ KeysManager.Serialize(Path.GetFileName(Pak.ThePAKPath), string.Empty);
}
}
- else
- {
- KeysManager.Serialize(Path.GetFileName(Pak.ThePAKPath), string.Empty);
- }
}
}
}
- }
- Directory.CreateDirectory(Path.GetDirectoryName(AESManager_PATH));
- using (var fileStream = new FileStream(AESManager_PATH, FileMode.Create))
- {
- KeysManager.serializer.Serialize(fileStream, AESEntries.AESEntriesList);
+ Directory.CreateDirectory(Path.GetDirectoryName(AESManager_PATH));
+ using (var fileStream = new FileStream(AESManager_PATH, FileMode.Create))
+ {
+ KeysManager.serializer.Serialize(fileStream, AESEntries.AESEntriesList);
+ }
}
+ else
+ KeysManager.Deserialize();
FWindow.FMain.Dispatcher.InvokeAsync(() =>
{
diff --git a/FModel/Methods/Assets/AssetsLoader.cs b/FModel/Methods/Assets/AssetsLoader.cs
index fbfc8c1a..08c9824e 100644
--- a/FModel/Methods/Assets/AssetsLoader.cs
+++ b/FModel/Methods/Assets/AssetsLoader.cs
@@ -19,6 +19,7 @@ namespace FModel.Methods.Assets
public static async Task LoadSelectedAsset()
{
+ new UpdateMyProcessEvents("", "").Update();
FWindow.FMain.Button_Extract.IsEnabled = false;
FWindow.FMain.Button_Stop.IsEnabled = true;
FWindow.FMain.AssetPropertiesBox_Main.Text = string.Empty;
@@ -57,6 +58,7 @@ namespace FModel.Methods.Assets
public static async Task ExtractFoldersAndSub(string path)
{
+ new UpdateMyProcessEvents("", "").Update();
FWindow.FMain.Button_Extract.IsEnabled = false;
FWindow.FMain.Button_Stop.IsEnabled = true;
FWindow.FMain.AssetPropertiesBox_Main.Text = string.Empty;
diff --git a/FModel/Methods/Assets/IconCreator/IconCreator.cs b/FModel/Methods/Assets/IconCreator/IconCreator.cs
index 20e7d7d2..cbab2f56 100644
--- a/FModel/Methods/Assets/IconCreator/IconCreator.cs
+++ b/FModel/Methods/Assets/IconCreator/IconCreator.cs
@@ -17,6 +17,7 @@ namespace FModel.Methods.Assets.IconCreator
public static DrawingVisual DrawNormalIconKThx(JArray AssetProperties)
{
FoldersUtility.CheckWatermark();
+
new UpdateMyProcessEvents("Creating Icon...", "Waiting").Update();
DrawingVisual drawingVisual = new DrawingVisual();
diff --git a/FModel/Methods/Assets/IconCreator/IconText.cs b/FModel/Methods/Assets/IconCreator/IconText.cs
index 6e72588b..09a764e5 100644
--- a/FModel/Methods/Assets/IconCreator/IconText.cs
+++ b/FModel/Methods/Assets/IconCreator/IconText.cs
@@ -182,11 +182,11 @@ namespace FModel.Methods.Assets.IconCreator
private static void DrawDisplayName(string DisplayName)
{
- Typeface typeface = new Typeface(TextsUtility.FBurbank, FontStyles.Normal, FontWeights.Normal, FontStretches.Normal);
+ Typeface typeface = new Typeface(TextsUtility.FBurbank, FontStyles.Normal, string.Equals(FProp.Default.FLanguage, "Japanese") ? FontWeights.Black : FontWeights.Normal, FontStretches.Normal);
FormattedText formattedText =
new FormattedText(
- string.Equals(FProp.Default.FRarity_Design, "Minimalist") ? DisplayName.ToUpperInvariant() : DisplayName,
+ string.Equals(FProp.Default.FRarity_Design, "Minimalist") || string.Equals(FProp.Default.FLanguage, "Russian") ? DisplayName.ToUpperInvariant() : DisplayName,
CultureInfo.CurrentUICulture,
FlowDirection.LeftToRight,
typeface,
diff --git a/FModel/Methods/PAKs/BackupPAKs.cs b/FModel/Methods/PAKs/BackupPAKs.cs
index a2f52545..4d4a2d5b 100644
--- a/FModel/Methods/PAKs/BackupPAKs.cs
+++ b/FModel/Methods/PAKs/BackupPAKs.cs
@@ -29,49 +29,51 @@ namespace FModel.Methods.PAKs
{
new UpdateMyProcessEvents($"Writing {Path.GetFileName(BACKUP_FILE_PATH)}", "Waiting").Update();
Directory.CreateDirectory(Path.GetDirectoryName(BACKUP_FILE_PATH));
- var fileStream = new FileStream(BACKUP_FILE_PATH, FileMode.Create);
- var writer = new BinaryWriter(fileStream);
- foreach (PAKInfosEntry Pak in PAKEntries.PAKEntriesList)
+
+ using (FileStream fileStream = new FileStream(BACKUP_FILE_PATH, FileMode.Create))
+ using (BinaryWriter writer = new BinaryWriter(fileStream))
{
- byte[] AESKey = null;
- if (Pak.bTheDynamicPAK)
+ foreach (PAKInfosEntry Pak in PAKEntries.PAKEntriesList)
{
- if (AESEntries.AESEntriesList != null && AESEntries.AESEntriesList.Any())
+ byte[] AESKey = null;
+ if (Pak.bTheDynamicPAK)
{
- string AESFromManager = AESEntries.AESEntriesList.Where(x => string.Equals(x.ThePAKName, Path.GetFileNameWithoutExtension(Pak.ThePAKPath))).Select(x => x.ThePAKKey).FirstOrDefault();
- if (!string.IsNullOrEmpty(AESFromManager))
+ if (AESEntries.AESEntriesList != null && AESEntries.AESEntriesList.Any())
{
- AESKey = AESUtility.StringToByteArray(AESFromManager);
+ string AESFromManager = AESEntries.AESEntriesList.Where(x => string.Equals(x.ThePAKName, Path.GetFileNameWithoutExtension(Pak.ThePAKPath))).Select(x => x.ThePAKKey).FirstOrDefault();
+ if (!string.IsNullOrEmpty(AESFromManager))
+ {
+ AESKey = AESUtility.StringToByteArray(AESFromManager);
+ }
}
}
- }
- else
- {
- AESKey = AESUtility.StringToByteArray(FProp.Default.FPak_MainAES);
- }
-
- if (AESKey != null)
- {
- PakReader.PakReader reader = new PakReader.PakReader(Pak.ThePAKPath, AESKey);
- if (reader != null)
+ else
{
- new UpdateMyProcessEvents($"{Path.GetFileNameWithoutExtension(Pak.ThePAKPath)} mount point: {reader.MountPoint}", "Waiting").Update();
+ AESKey = AESUtility.StringToByteArray(FProp.Default.FPak_MainAES);
+ }
- foreach (FPakEntry entry in reader.FileInfos)
+ if (AESKey != null)
+ {
+ PakReader.PakReader reader = new PakReader.PakReader(Pak.ThePAKPath, AESKey);
+ if (reader != null)
{
- writer.Write(entry.Pos);
- writer.Write(entry.Size);
- writer.Write(entry.UncompressedSize);
- writer.Write(entry.Encrypted);
- writer.Write(entry.StructSize);
- writer.Write(entry.Name);
- writer.Write(entry.CompressionMethod);
+ new UpdateMyProcessEvents($"{Path.GetFileNameWithoutExtension(Pak.ThePAKPath)} mount point: {reader.MountPoint}", "Waiting").Update();
+
+ foreach (FPakEntry entry in reader.FileInfos)
+ {
+ writer.Write(entry.Pos);
+ writer.Write(entry.Size);
+ writer.Write(entry.UncompressedSize);
+ writer.Write(entry.Encrypted);
+ writer.Write(entry.StructSize);
+ writer.Write(entry.Name);
+ writer.Write(entry.CompressionMethod);
+ }
}
}
}
}
- fileStream.Close();
- writer.Close();
+
if (new FileInfo(BACKUP_FILE_PATH).Length > 0) //HENCE WE CHECK THE LENGTH
{
new UpdateMyProcessEvents($"\\Backups\\{Path.GetFileName(BACKUP_FILE_PATH)} successfully created", "Success").Update();
diff --git a/FModel/Methods/PAKs/PAKsLoader.cs b/FModel/Methods/PAKs/PAKsLoader.cs
index 3ddb4e9f..39946a8d 100644
--- a/FModel/Methods/PAKs/PAKsLoader.cs
+++ b/FModel/Methods/PAKs/PAKsLoader.cs
@@ -91,6 +91,7 @@ namespace FModel.Methods.PAKs
ListBoxUtility.FilesListWithoutPath = null;
FWindow.FMain.ListBox_Main.Items.Clear();
+ FWindow.FMain.TreeView_Main.IsEnabled = false;
await Task.Run(async () =>
{
PAKEntries.PAKToDisplay = new Dictionary();
@@ -102,6 +103,7 @@ namespace FModel.Methods.PAKs
{
TasksUtility.TaskCompleted(TheTask.Exception);
});
+ FWindow.FMain.TreeView_Main.IsEnabled = true;
FWindow.FMain.MI_LoadAllPAKs.IsEnabled = true;
FWindow.FMain.MI_BackupPAKs.IsEnabled = true;
@@ -244,13 +246,13 @@ namespace FModel.Methods.PAKs
new UpdateMyProcessEvents("Comparing Files", "Waiting").Update();
FPakEntry[] BackupEntries;
- using (var fileStream = new FileStream(openFiledialog.FileName, FileMode.Open))
+ using (FileStream fileStream = new FileStream(openFiledialog.FileName, FileMode.Open))
+ using (BinaryReader reader = new BinaryReader(fileStream))
{
List entries = new List();
- var reader = new BinaryReader(fileStream);
- while(reader.BaseStream.Position < reader.BaseStream.Length)
+ while (reader.BaseStream.Position < reader.BaseStream.Length)
{
- var entry = new FPakEntry();
+ FPakEntry entry = new FPakEntry();
entry.Pos = reader.ReadInt64();
entry.Size = reader.ReadInt64();
entry.UncompressedSize = reader.ReadInt64();
@@ -274,18 +276,22 @@ namespace FModel.Methods.PAKs
//FILTER WITH THE OVERRIDED EQUALS METHOD (CHECKING FILE NAME AND FILE UNCOMPRESSED SIZE)
IEnumerable newAssets = LocalEntries.ToArray().Except(BackupEntries);
+
+ //ADD TO TREE
+ foreach (FPakEntry entry in newAssets)
+ {
+ string onlyFolders = entry.Name.Substring(0, entry.Name.LastIndexOf('/'));
+ await FWindow.FMain.Dispatcher.InvokeAsync(() =>
+ {
+ TreeViewUtility.PopulateTreeView(srt, onlyFolders.Substring(1));
+ });
+ }
+
+ //ONLY LOAD THE DIFFERENCE WHEN WE CLICK ON A FOLDER
+ FWindow.FCurrentPAK = "ComparedPAK-WindowsClient.pak";
+ PAKEntries.PAKToDisplay.Add("ComparedPAK-WindowsClient.pak", newAssets.ToArray());
await FWindow.FMain.Dispatcher.InvokeAsync(() =>
{
- //ADD TO TREE
- foreach (FPakEntry entry in newAssets)
- {
- string onlyFolders = entry.Name.Substring(0, entry.Name.LastIndexOf('/'));
- TreeViewUtility.PopulateTreeView(srt, onlyFolders.Substring(1));
- }
-
- //ONLY LOAD THE DIFFERENCE WHEN WE CLICK ON A FOLDER
- FWindow.FCurrentPAK = "ComparedPAK-WindowsClient.pak";
- PAKEntries.PAKToDisplay.Add("ComparedPAK-WindowsClient.pak", newAssets.ToArray());
FWindow.FMain.ViewModel = srt;
});
diff --git a/FModel/Methods/Utilities/AssetsUtility.cs b/FModel/Methods/Utilities/AssetsUtility.cs
index 9f813379..4e384edb 100644
--- a/FModel/Methods/Utilities/AssetsUtility.cs
+++ b/FModel/Methods/Utilities/AssetsUtility.cs
@@ -185,6 +185,11 @@ namespace FModel.Methods.Utilities
FWindow.FMain.Dispatcher.InvokeAsync(() =>
{
FWindow.FMain.ImageBox_Main.Source = BitmapFrame.Create((BitmapSource)img); //thread safe and fast af
+
+ if (FWindow.FMain.MI_Auto_Save_Images.IsChecked) //auto save images
+ {
+ ImagesUtility.SaveImage(FProp.Default.FOutput_Path + "\\Icons\\" + FWindow.FCurrentAsset + ".png");
+ }
});
}
}
diff --git a/FModel/Methods/Utilities/UIUtility.cs b/FModel/Methods/Utilities/UIUtility.cs
index 6423cfee..d886176f 100644
--- a/FModel/Methods/Utilities/UIUtility.cs
+++ b/FModel/Methods/Utilities/UIUtility.cs
@@ -53,6 +53,7 @@ namespace FModel.Methods.Utilities
FWindow.FMain.StateTextBlock.Background = new SolidColorBrush(Color.FromRgb(0, 158, 63));
break;
default:
+ FWindow.FMain.StateTextBlock.Background = new SolidColorBrush(Color.FromRgb(28, 32, 38));
break;
}
});
diff --git a/README.md b/README.md
index e38dc2b7..12358853 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,7 @@
-