diff --git a/CUE4Parse b/CUE4Parse index 5655c30f..2d5e2bdd 160000 --- a/CUE4Parse +++ b/CUE4Parse @@ -1 +1 @@ -Subproject commit 5655c30f180a50bd07dc0282daace6b6edc9ea72 +Subproject commit 2d5e2bdd35db42759d8320076778737fcf9d53a2 diff --git a/EpicManifestParser b/EpicManifestParser index 97174265..21df8a55 160000 --- a/EpicManifestParser +++ b/EpicManifestParser @@ -1 +1 @@ -Subproject commit 97174265894eddcb0d94ef570d36ddc559a8573a +Subproject commit 21df8a55d474f14148a35bc943e06f3fdc20c997 diff --git a/FModel/App.xaml.cs b/FModel/App.xaml.cs index f889e0f4..f5de48d8 100644 --- a/FModel/App.xaml.cs +++ b/FModel/App.xaml.cs @@ -1,4 +1,4 @@ -using AdonisUI.Controls; +using AdonisUI.Controls; using Microsoft.Win32; using Serilog; using System; diff --git a/FModel/Constants.cs b/FModel/Constants.cs index e2667514..2f53fc8a 100644 --- a/FModel/Constants.cs +++ b/FModel/Constants.cs @@ -1,4 +1,5 @@ -using System.Reflection; +using System.Numerics; +using System.Reflection; using CUE4Parse.UE4.Objects.Core.Misc; namespace FModel; @@ -27,4 +28,19 @@ public static class Constants public const string _VAL_LIVE_TRIGGER = "valorant-live.manifest"; public const string _NO_PRESET_TRIGGER = "Hand Made"; + + public static int PALETTE_LENGTH => COLOR_PALETTE.Length; + public static readonly Vector3[] COLOR_PALETTE = + { + new (0.231f, 0.231f, 0.231f), // Dark gray + new (0.376f, 0.490f, 0.545f), // Teal + new (0.957f, 0.263f, 0.212f), // Red + new (0.196f, 0.804f, 0.196f), // Green + new (0.957f, 0.647f, 0.212f), // Orange + new (0.612f, 0.153f, 0.690f), // Purple + new (0.129f, 0.588f, 0.953f), // Blue + new (1.000f, 0.920f, 0.424f), // Yellow + new (0.824f, 0.412f, 0.118f), // Brown + new (0.612f, 0.800f, 0.922f) // Light blue + }; } diff --git a/FModel/Creator/Bases/FN/BaseMaterialInstance.cs b/FModel/Creator/Bases/FN/BaseMaterialInstance.cs index 55e06923..c9776b8b 100644 --- a/FModel/Creator/Bases/FN/BaseMaterialInstance.cs +++ b/FModel/Creator/Bases/FN/BaseMaterialInstance.cs @@ -47,7 +47,12 @@ public class BaseMaterialInstance : BaseIcon } if (Preview == null) + { + if (material.TryGetValue(out FPackageIndex parent, "Parent")) + Utils.TryGetPackageIndexExport(parent, out material); + goto texture_finding; + } foreach (var vectorParameter in material.VectorParameterValues) { diff --git a/FModel/Creator/Bases/FN/BaseUserControl.cs b/FModel/Creator/Bases/FN/BaseUserControl.cs index 39bbae5d..768ced14 100644 --- a/FModel/Creator/Bases/FN/BaseUserControl.cs +++ b/FModel/Creator/Bases/FN/BaseUserControl.cs @@ -37,9 +37,9 @@ public class BaseUserControl : UCreator public override void ParseForInfo() { - if (Object.TryGetValue(out FText optionDisplayName, "OptionDisplayName")) + if (Object.TryGetValue(out FText optionDisplayName, "OptionDisplayName", "OptionText")) DisplayName = optionDisplayName.Text.ToUpperInvariant(); - if (Object.TryGetValue(out FText optionDescription, "OptionDescription")) + if (Object.TryGetValue(out FText optionDescription, "OptionDescription", "OptionToolTip")) { Description = optionDescription.Text; @@ -48,12 +48,12 @@ public class BaseUserControl : UCreator Height += (int) _descriptionPaint.TextSize; } - if (Object.TryGetValue(out FStructFallback[] optionValues, "OptionValues")) + if (Object.TryGetValue(out FStructFallback[] optionValues, "OptionValues", "Options")) { _optionValues = new List(); foreach (var option in optionValues) { - if (option.TryGetValue(out FText displayName, "DisplayName")) + if (option.TryGetValue(out FText displayName, "DisplayName", "DisplayText")) { var opt = new Options { Option = displayName.Text.ToUpperInvariant() }; if (option.TryGetValue(out FLinearColor color, "Value")) @@ -189,4 +189,4 @@ public class Options c.DrawText(Option, margin + _SPACE * 2, top + 20 * 1.1f, _optionPaint); top += _HEIGHT + _SPACE; } -} \ No newline at end of file +} diff --git a/FModel/Creator/CreatorPackage.cs b/FModel/Creator/CreatorPackage.cs index ac794ab2..7d44f685 100644 --- a/FModel/Creator/CreatorPackage.cs +++ b/FModel/Creator/CreatorPackage.cs @@ -107,8 +107,11 @@ public class CreatorPackage : IDisposable case "FortChallengeBundleScheduleDefinition": case "FortWeaponMeleeDualWieldItemDefinition": case "FortDailyRewardScheduleTokenDefinition": + case "FortCreativeWeaponRangedItemDefinition": case "FortCreativeRealEstatePlotItemDefinition": case "AthenaDanceItemDefinition_AdHocSquadsJoin_C": + case "StWFortAccoladeItemDefinition": + case "FortSmartBuildingItemDefinition": creator = _style switch { EIconStyle.Cataba => new BaseCommunity(_object, _style, "Cataba"), @@ -148,6 +151,7 @@ public class CreatorPackage : IDisposable case "FortFeatItemDefinition": case "FortQuestItemDefinition": case "FortQuestItemDefinition_Athena": + case "FortQuestItemDefinition_Campaign": case "AthenaDailyQuestDefinition": case "FortUrgentQuestItemDefinition": creator = new Bases.FN.BaseQuest(_object, _style); @@ -162,6 +166,7 @@ public class CreatorPackage : IDisposable case "FortItemAccessTokenType": creator = new BaseItemAccessToken(_object, _style); return true; + case "FortCreativeOption": case "PlaylistUserOptionEnum": case "PlaylistUserOptionBool": case "PlaylistUserOptionString": diff --git a/FModel/Creator/Typefaces.cs b/FModel/Creator/Typefaces.cs index 4e11a74a..38a9a90f 100644 --- a/FModel/Creator/Typefaces.cs +++ b/FModel/Creator/Typefaces.cs @@ -201,7 +201,7 @@ public class Typefaces Description = OnTheFly(_SPELLBREAK_BASE_PATH + _MONTSERRAT_SEMIBOLD + _EXT); break; } - case FGame.PandaGame: + case FGame.MultiVersus: { DisplayName = OnTheFly(_PANDAGAME_BASE_PATH + language switch { diff --git a/FModel/Creator/Utils.cs b/FModel/Creator/Utils.cs index 40970544..5e33bbfa 100644 --- a/FModel/Creator/Utils.cs +++ b/FModel/Creator/Utils.cs @@ -146,9 +146,9 @@ public static class Utils return _applicationView.CUE4Parse.Provider.TryLoadObject(fullPath, out export); } - public static IEnumerable LoadExports(string fullPath) + public static IEnumerable LoadExports(string packagePath) { - return _applicationView.CUE4Parse.Provider.LoadObjectExports(fullPath); + return _applicationView.CUE4Parse.Provider.LoadAllObjects(packagePath); } public static float GetMaxFontSize(double sectorSize, SKTypeface typeface, string text, float degreeOfCertainty = 1f, float maxFont = 100f) diff --git a/FModel/Enums.cs b/FModel/Enums.cs index 1fa255bd..eaa7cd24 100644 --- a/FModel/Enums.cs +++ b/FModel/Enums.cs @@ -92,8 +92,10 @@ public enum FGame Gameface, [Description("Sea of Thieves")] Athena, - [Description("Your Beloved ™ Panda")] + [Description("DEPRECATED")] PandaGame, + [Description("MultiVersus")] + MultiVersus, [Description("Tower of Fantasy")] Hotta, [Description("eFootball 2023")] diff --git a/FModel/Extensions/AvalonExtensions.cs b/FModel/Extensions/AvalonExtensions.cs index 9c058b51..86627fcb 100644 --- a/FModel/Extensions/AvalonExtensions.cs +++ b/FModel/Extensions/AvalonExtensions.cs @@ -13,7 +13,7 @@ public static class AvalonExtensions private static readonly IHighlightingDefinition _xmlHighlighter = LoadHighlighter("Xml.xshd"); private static readonly IHighlightingDefinition _cppHighlighter = LoadHighlighter("Cpp.xshd"); private static readonly IHighlightingDefinition _changelogHighlighter = LoadHighlighter("Changelog.xshd"); - private static readonly IHighlightingDefinition _ulangHighlighter = LoadHighlighter("ULang.xshd"); + private static readonly IHighlightingDefinition _verseHighlighter = LoadHighlighter("Verse.xshd"); [MethodImpl(MethodImplOptions.AggressiveInlining)] private static IHighlightingDefinition LoadHighlighter(string resourceName) @@ -40,8 +40,8 @@ public static class AvalonExtensions return _cppHighlighter; case "changelog": return _changelogHighlighter; - case "ulang": - return _ulangHighlighter; + case "verse": + return _verseHighlighter; case "bat": case "txt": case "pem": diff --git a/FModel/Extensions/StringExtensions.cs b/FModel/Extensions/StringExtensions.cs index cbfa8ddd..67dec4ba 100644 --- a/FModel/Extensions/StringExtensions.cs +++ b/FModel/Extensions/StringExtensions.cs @@ -1,6 +1,7 @@ -using System; +using System; using System.IO; using System.Runtime.CompilerServices; +using System.Text.RegularExpressions; namespace FModel.Extensions; @@ -112,6 +113,37 @@ public static class StringExtensions return 1; } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int GetKismetLineNumber(this string s, string input) + { + var match = Regex.Match(input, @"^(.+)\[(\d+)\]$"); + var name = match.Groups[1].Value; + int index = int.Parse(match.Groups[2].Value); + var lineToFind = $" \"Name\": \"{name}\","; + var offset = $"\"StatementIndex\": {index}"; + using var reader = new StringReader(s); + var lineNum = 0; + string line; + + while ((line = reader.ReadLine()) != null) + { + lineNum++; + if (line.Equals(lineToFind, StringComparison.OrdinalIgnoreCase)) + { + var objectLine = lineNum; + while ((line = reader.ReadLine()) != null) + { + lineNum++; + if (line.Contains(offset, StringComparison.OrdinalIgnoreCase)) + return lineNum; + } + return objectLine; + } + } + + return 1; + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static int GetLineNumber(this string s, int index) { @@ -130,4 +162,4 @@ public static class StringExtensions return 1; } -} \ No newline at end of file +} diff --git a/FModel/FModel.csproj b/FModel/FModel.csproj index cb392a09..76fd09f2 100644 --- a/FModel/FModel.csproj +++ b/FModel/FModel.csproj @@ -5,9 +5,9 @@ net6.0-windows true FModel.ico - 4.4.1.1 - 4.4.1.1 - 4.4.1.1 + 4.4.3.0 + 4.4.3.0 + 4.4.3.0 false true win-x64 @@ -69,7 +69,7 @@ - + @@ -112,7 +112,7 @@ - + @@ -135,19 +135,19 @@ - - + + - - - - - + + + + + - - - + + + @@ -227,6 +227,15 @@ + + + + + + + + + diff --git a/FModel/Framework/ImGuiController.cs b/FModel/Framework/ImGuiController.cs index 982b7e7f..3c099c7b 100644 --- a/FModel/Framework/ImGuiController.cs +++ b/FModel/Framework/ImGuiController.cs @@ -3,11 +3,14 @@ using System.Collections.Generic; using System.Diagnostics; using System.Numerics; using System.Runtime.CompilerServices; +using System.Windows; +using System.Windows.Forms; using ImGuiNET; using OpenTK.Graphics.OpenGL4; using OpenTK.Windowing.Desktop; using OpenTK.Windowing.GraphicsLibraryFramework; using ErrorCode = OpenTK.Graphics.OpenGL4.ErrorCode; +using Keys = OpenTK.Windowing.GraphicsLibraryFramework.Keys; namespace FModel.Framework; @@ -33,11 +36,12 @@ public class ImGuiController : IDisposable private int _windowHeight; // private string _iniPath; - private ImFontPtr _normal; - private ImFontPtr _bold; - private ImFontPtr _semiBold; + public ImFontPtr FontNormal; + public ImFontPtr FontBold; + public ImFontPtr FontSemiBold; private readonly Vector2 _scaleFactor = Vector2.One; + public readonly float DpiScale = GetDpiScale(); private static bool KHRDebugAvailable = false; @@ -57,9 +61,9 @@ public class ImGuiController : IDisposable // ImGui.LoadIniSettingsFromDisk(_iniPath); var io = ImGui.GetIO(); - _normal = io.Fonts.AddFontFromFileTTF("C:\\Windows\\Fonts\\segoeui.ttf", 16); - _bold = io.Fonts.AddFontFromFileTTF("C:\\Windows\\Fonts\\segoeuib.ttf", 16); - _semiBold = io.Fonts.AddFontFromFileTTF("C:\\Windows\\Fonts\\seguisb.ttf", 16); + FontNormal = io.Fonts.AddFontFromFileTTF("C:\\Windows\\Fonts\\segoeui.ttf", 16 * DpiScale); + FontBold = io.Fonts.AddFontFromFileTTF("C:\\Windows\\Fonts\\segoeuib.ttf", 16 * DpiScale); + FontSemiBold = io.Fonts.AddFontFromFileTTF("C:\\Windows\\Fonts\\seguisb.ttf", 16 * DpiScale); io.BackendFlags |= ImGuiBackendFlags.RendererHasVtxOffset; io.ConfigFlags |= ImGuiConfigFlags.NavEnableKeyboard; @@ -75,13 +79,13 @@ public class ImGuiController : IDisposable _frameBegun = true; } - public void Bold() => PushFont(_bold); - public void SemiBold() => PushFont(_semiBold); + public void Bold() => PushFont(FontBold); + public void SemiBold() => PushFont(FontSemiBold); public void PopFont() { ImGui.PopFont(); - PushFont(_normal); + PushFont(FontNormal); } private void PushFont(ImFontPtr ptr) => ImGui.PushFont(ptr); @@ -634,4 +638,9 @@ outputColor = color * texture(in_fontTexture, texCoord); Debug.Print($"{title} ({i++}): {error}"); } } + + public static float GetDpiScale() + { + return Math.Max((float)(Screen.PrimaryScreen.Bounds.Width / SystemParameters.PrimaryScreenWidth), (float)(Screen.PrimaryScreen.Bounds.Height / SystemParameters.PrimaryScreenHeight)); + } } diff --git a/FModel/Helper.cs b/FModel/Helper.cs index a44a3d09..67cd659f 100644 --- a/FModel/Helper.cs +++ b/FModel/Helper.cs @@ -16,11 +16,6 @@ public static class Helper internal readonly ulong UlongValue; } - public static bool IAmThePanda(string key) - => key.Length == 11 && - key.StartsWith("mu", StringComparison.OrdinalIgnoreCase) && - key.EndsWith("sus", StringComparison.OrdinalIgnoreCase); - public static string FixKey(string key) { if (string.IsNullOrEmpty(key)) diff --git a/FModel/MainWindow.xaml b/FModel/MainWindow.xaml index 9f32042d..3db666be 100644 --- a/FModel/MainWindow.xaml +++ b/FModel/MainWindow.xaml @@ -4,6 +4,8 @@ xmlns:local="clr-namespace:FModel" xmlns:controls="clr-namespace:FModel.Views.Resources.Controls" xmlns:converters="clr-namespace:FModel.Views.Resources.Converters" + xmlns:settings="clr-namespace:FModel.Settings" + xmlns:services="clr-namespace:FModel.Services" xmlns:adonisUi="clr-namespace:AdonisUI;assembly=AdonisUI" xmlns:adonisControls="clr-namespace:AdonisUI.Controls;assembly=AdonisUI" xmlns:adonisExtensions="clr-namespace:AdonisUI.Extensions;assembly=AdonisUI" @@ -12,10 +14,18 @@ Width="{Binding Source={x:Static SystemParameters.MaximizedPrimaryScreenWidth}, Converter={converters:RatioConverter}, ConverterParameter='0.75'}"> @@ -95,7 +105,7 @@ + IsChecked="{Binding IsAutoOpenSounds, Source={x:Static settings:UserSettings.Default}}" /> @@ -221,7 +231,7 @@ + SelectedItem="{Binding LoadingMode, Source={x:Static settings:UserSettings.Default}, Mode=TwoWay}"> @@ -308,15 +318,15 @@ - -