diff --git a/FModel/FModel.csproj b/FModel/FModel.csproj index 468059d7..f922844f 100644 --- a/FModel/FModel.csproj +++ b/FModel/FModel.csproj @@ -91,9 +91,6 @@ ..\packages\Cyotek.Windows.Forms.ColorPicker.1.7.2\lib\net35\Cyotek.Windows.Forms.ColorPicker.dll - - ..\packages\TweetMoaSharp.6.0.0\lib\4.5\Hammock.ClientProfile.dll - ..\packages\HtmlAgilityPack.1.11.12\lib\Net45\HtmlAgilityPack.dll @@ -124,9 +121,6 @@ - - ..\packages\TweetMoaSharp.6.0.0\lib\4.5\TweetSharp.dll - @@ -162,6 +156,7 @@ + diff --git a/FModel/MainWindow.cs b/FModel/MainWindow.cs index 8749b854..6f8da305 100644 --- a/FModel/MainWindow.cs +++ b/FModel/MainWindow.cs @@ -192,6 +192,7 @@ namespace FModel AddBackupFiles(); Utilities.SetFolderPermission(App.DefaultOutputPath); Utilities.CreateDefaultFolders(); + Methods.Serializer.LocRes.HotfixedStrings.setHotfixedStrings(); }); MyScintilla.SetScintillaStyle(scintilla1); diff --git a/FModel/Methods/IconGenerator/ItemGenerator/Rarity.cs b/FModel/Methods/IconGenerator/ItemGenerator/Rarity.cs index 91802b89..67a2132e 100644 --- a/FModel/Methods/IconGenerator/ItemGenerator/Rarity.cs +++ b/FModel/Methods/IconGenerator/ItemGenerator/Rarity.cs @@ -80,6 +80,21 @@ namespace FModel toDrawOn.DrawImage(ImageUtilities.ResizeImage(opacityImage, 512, 512), new Point(5, 5)); } } + else if (theSeries.Equals("DCUSeries")) + { + DrawBackground(toDrawOn, Color.FromArgb(255, 45, 68, 93), Color.FromArgb(255, 16, 25, 40), Color.FromArgb(255, 62, 94, 122)); + string cubeBG = JohnWick.AssetToTexture2D("T-BlackMonday-Background"); + if (!string.IsNullOrEmpty(cubeBG)) + { + Image itemIcon; + using (var bmpTemp = new Bitmap(cubeBG)) + { + itemIcon = new Bitmap(bmpTemp); + } + Image opacityImage = ImageUtilities.SetImageOpacity(itemIcon, (float)0.6); + toDrawOn.DrawImage(ImageUtilities.ResizeImage(opacityImage, 512, 512), new Point(5, 5)); + } + } else { DrawRarityBackground(theItem, toDrawOn); diff --git a/FModel/Methods/IconGenerator/Translations/SearchResource.cs b/FModel/Methods/IconGenerator/Translations/SearchResource.cs index 16df5210..64c8c928 100644 --- a/FModel/Methods/IconGenerator/Translations/SearchResource.cs +++ b/FModel/Methods/IconGenerator/Translations/SearchResource.cs @@ -1,3 +1,5 @@ +using FModel.Methods.Serializer.LocRes; +using FModel.Properties; using System.Collections.Generic; namespace FModel @@ -8,13 +10,20 @@ namespace FModel { try { - if (string.IsNullOrEmpty(theNamespace)) + if (HotfixedStrings.HotfixedStringsDict != null && HotfixedStrings.HotfixedStringsDict.ContainsKey(theKey)) { - return LocResSerializer.LocResDict[theKey]; + return HotfixedStrings.HotfixedStringsDict[theKey][GetLanguageCode()]; } else { - return LocResSerializer.LocResDict[theNamespace][theKey]; + if (string.IsNullOrEmpty(theNamespace)) + { + return LocResSerializer.LocResDict[theKey]; + } + else + { + return LocResSerializer.LocResDict[theNamespace][theKey]; + } } } catch (KeyNotFoundException) @@ -26,7 +35,16 @@ namespace FModel public static string getTextByKey(string key, string defaultText, string namespac = null) { if (Properties.Settings.Default.IconLanguage.Equals("English")) - return defaultText; + { + if (HotfixedStrings.HotfixedStringsDict != null && HotfixedStrings.HotfixedStringsDict.ContainsKey(key)) + { + return HotfixedStrings.HotfixedStringsDict[key][GetLanguageCode()]; + } + else + { + return defaultText; + } + } string text = defaultText; if (LocResSerializer.LocResDict != null) @@ -38,5 +56,42 @@ namespace FModel return text; } + + private static string GetLanguageCode() + { + switch (Settings.Default.IconLanguage) + { + case "French": + return "fr"; + case "German": + return "de"; + case "Italian": + return "it"; + case "Spanish": + return "es"; + case "Spanish (LA)": + return "es-419"; + case "Arabic": + return "ar"; + case "Japanese": + return "ja"; + case "Korean": + return "ko"; + case "Polish": + return "pl"; + case "Portuguese (Brazil)": + return "pt-BR"; + case "Russian": + return "ru"; + case "Turkish": + return "tr"; + case "Chinese (S)": + return "zh-CN"; + case "Traditional Chinese": + return "zh-Hant"; + default: + return "en"; + } + } } } diff --git a/FModel/Methods/Serializer/LocRes/HotfixedStrings.cs b/FModel/Methods/Serializer/LocRes/HotfixedStrings.cs new file mode 100644 index 00000000..9f03f12d --- /dev/null +++ b/FModel/Methods/Serializer/LocRes/HotfixedStrings.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.RegularExpressions; + +namespace FModel.Methods.Serializer.LocRes +{ + class HotfixedStrings + { + public static Dictionary HotfixedStringsDict { get; set; } + + public static void setHotfixedStrings() + { + string pdd = Path.GetFullPath(Path.Combine(Properties.Settings.Default.PAKsPath, @"..\..\PersistentDownloadDir\EMS\")); + if (File.Exists(pdd + "a22d837b6a2b46349421259c0a5411bf")) + { + HotfixedStringsDict = new Dictionary(); + using (StreamReader sr = new StreamReader(File.Open(pdd + "a22d837b6a2b46349421259c0a5411bf", FileMode.Open, FileAccess.Read, FileShare.ReadWrite))) + { + while (!sr.EndOfStream) + { + string line = sr.ReadLine(); + if (line.StartsWith("+TextReplacements=(Category=Game,")) + { + string txtNamespace = GetValueFromParam(line, "Namespace=\"", "\","); + string txtKey = GetValueFromParam(line, "Key=\"", "\","); + + int trIndex = line.IndexOf("LocalizedStrings=(") + "LocalizedStrings=(".Length; + string translations = GetValueFromParam(line, "LocalizedStrings=(", "))"); + if (!translations.EndsWith(")")) { translations = translations + ")"; } + + HotfixedStringsDict[txtKey] = new Dictionary(); + HotfixedStringsDict[txtKey]["namespace"] = txtNamespace; + Regex regex = new Regex(@"(?<=\().+?(?=\))"); + foreach (Match match in regex.Matches(translations)) + { + try + { + string[] langParts = match.Value.Substring(1, match.Value.Length - 2).Split(new string[] { "\",\"" }, StringSplitOptions.None); + + HotfixedStringsDict[txtKey][langParts[0]] = langParts[1]; + } + catch (IndexOutOfRangeException) + { + string[] langParts = match.Value.Substring(1, match.Value.Length - 2).Split(new string[] { "\", \"" }, StringSplitOptions.None); + + HotfixedStringsDict[txtKey][langParts[0]] = langParts[1]; + } + } + } + } + } + } + } + + private static string GetValueFromParam(string fullLine, string startWith, string endWith) + { + int startIndex = fullLine.IndexOf(startWith) + startWith.Length; + int endIndex = fullLine.Substring(startIndex).IndexOf(endWith); + return fullLine.Substring(startIndex, endIndex); + } + } +} diff --git a/FModel/Methods/Serializer/LocRes/LocResSerializer.cs b/FModel/Methods/Serializer/LocRes/LocResSerializer.cs index bd59b1b3..7fa52653 100644 --- a/FModel/Methods/Serializer/LocRes/LocResSerializer.cs +++ b/FModel/Methods/Serializer/LocRes/LocResSerializer.cs @@ -1,6 +1,4 @@ -using Newtonsoft.Json; -using System; -using System.Collections; +using System; using System.Collections.Generic; using System.IO; using System.Linq; diff --git a/FModel/Properties/AssemblyInfo.cs b/FModel/Properties/AssemblyInfo.cs index 54c6d4af..3e2c425d 100644 --- a/FModel/Properties/AssemblyInfo.cs +++ b/FModel/Properties/AssemblyInfo.cs @@ -33,7 +33,7 @@ using System.Runtime.InteropServices; // Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut // en utilisant '*', comme indiqué ci-dessous : // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.4.5.1")] -[assembly: AssemblyFileVersion("2.4.5.1")] +[assembly: AssemblyVersion("2.4.5.2")] +[assembly: AssemblyFileVersion("2.4.5.2")] [assembly: NeutralResourcesLanguage("en")] diff --git a/FModel/packages.config b/FModel/packages.config index d9b359c7..0b127b20 100644 --- a/FModel/packages.config +++ b/FModel/packages.config @@ -6,5 +6,4 @@ - \ No newline at end of file diff --git a/README.md b/README.md index 8f5b063e..8269c3c6 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # FModel [![](https://img.shields.io/github/downloads/iAmAsval/FModel/total.svg?color=green&label=Total%20Downloads&logo=buzzfeed&logoColor=white)](https://github.com/iAmAsval/FModel/releases) -[![](https://img.shields.io/github/downloads/iAmAsval/FModel/latest/total.svg?label=2.4.5.1&logo=buzzfeed&logoColor=white)](https://github.com/iAmAsval/FModel//releases/latest) +[![](https://img.shields.io/github/downloads/iAmAsval/FModel/latest/total.svg?label=2.4.5.2&logo=buzzfeed&logoColor=white)](https://github.com/iAmAsval/FModel//releases/latest) [![](https://img.shields.io/badge/License-GPL-blue.svg?logo=gnu)](https://github.com/iAmAsval/FModel/blob/master/LICENSE) [![](https://img.shields.io/badge/Twitter-@AsvalFN-1da1f2.svg?logo=twitter)](https://twitter.com/AsvalFN) [![](https://img.shields.io/badge/Discord-Need%20Help%3F-7289da.svg?logo=discord)](https://discord.gg/JmWvXKb) @@ -12,7 +12,7 @@ ### Prerequisites [.NET Framework 4.7.1](https://dotnet.microsoft.com/download/dotnet-framework/net471) ### Download -[![](https://img.shields.io/badge/Release-2.4.5.1-orange.svg?logo=github)](https://github.com/iAmAsval/FModel/releases/latest) +[![](https://img.shields.io/badge/Release-2.4.5.2-orange.svg?logo=github)](https://github.com/iAmAsval/FModel/releases/latest) ### How To Use >

Video Tutorial by FireMonkey