From 1846b828022d64fe6f7c24b37e6f7b0f830873a1 Mon Sep 17 00:00:00 2001 From: LongerWarrior Date: Mon, 24 Nov 2025 00:40:29 +0200 Subject: [PATCH] Aion2 dat files and HTML5 Emscripten data files support --- CUE4Parse | 2 +- FModel/ViewModels/CUE4ParseViewModel.cs | 37 +++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/CUE4Parse b/CUE4Parse index a06d37d8..d08d717e 160000 --- a/CUE4Parse +++ b/CUE4Parse @@ -1 +1 @@ -Subproject commit a06d37d8e0288183db38379560e05118a4b04400 +Subproject commit d08d717e6103738079d657221f4c04f7b1a4f91e diff --git a/FModel/ViewModels/CUE4ParseViewModel.cs b/FModel/ViewModels/CUE4ParseViewModel.cs index fc12685d..e5a9393b 100644 --- a/FModel/ViewModels/CUE4ParseViewModel.cs +++ b/FModel/ViewModels/CUE4ParseViewModel.cs @@ -17,6 +17,7 @@ using CUE4Parse.Encryption.Aes; using CUE4Parse.FileProvider; using CUE4Parse.FileProvider.Objects; using CUE4Parse.FileProvider.Vfs; +using CUE4Parse.GameTypes.Aion2.Objects; using CUE4Parse.GameTypes.AshEchoes.FileProvider; using CUE4Parse.GameTypes.KRD.Assets.Exports; using CUE4Parse.MappingsProvider; @@ -637,6 +638,11 @@ public class CUE4ParseViewModel : ViewModel break; } + case "dat" when Provider.ProjectName.Equals("Aion2", StringComparison.OrdinalIgnoreCase): + { + ProcessAion2DatFile(entry, updateUi, saveProperties); + break; + } case "upluginmanifest": case "code-workspace": case "projectstore": @@ -906,6 +912,37 @@ public class CUE4ParseViewModel : ViewModel break; } } + + void ProcessAion2DatFile(GameFile entry, bool updateUi, bool saveProperties) + { + TabControl.SelectedTab.Highlighter = AvalonExtensions.HighlighterSelector("json"); + if (entry.NameWithoutExtension.EndsWith("_MapEvent")) + { + var data = Provider.SaveAsset(entry); + FAion2DatFileArchive.DecryptData(data); + using var stream = new MemoryStream(data) { Position = 0 }; + using var reader = new StreamReader(stream); + + TabControl.SelectedTab.SetDocumentText(reader.ReadToEnd(), saveProperties, updateUi); + } + else if (entry.NameWithoutExtension.Equals("L10NString")) + { + var l10nData = new FAion2L10NFile(entry); + TabControl.SelectedTab.SetDocumentText(JsonConvert.SerializeObject(l10nData, Formatting.Indented), saveProperties, updateUi); + } + else + { + FAion2DataFile datfile = entry.NameWithoutExtension switch + { + "MapDataHierarchy" => new FAion2MapHierarchyFile(entry), + "MapData" => new FAion2MapDataFile(entry, Provider), + _ when entry.Directory.EndsWith("Data/WorldMap", StringComparison.OrdinalIgnoreCase) => new FAion2MapDataFile(entry, Provider), + _ => new FAion2DataTableFile(entry, Provider) + }; + + TabControl.SelectedTab.SetDocumentText(JsonConvert.SerializeObject(datfile, Formatting.Indented), saveProperties, updateUi); + } + } } public void ExtractAndScroll(CancellationToken cancellationToken, string fullPath, string objectName, string parentExportType)