Skip to content

Commit 1846b82

Browse files
committed
Aion2 dat files and HTML5 Emscripten data files support
1 parent 5d3ab10 commit 1846b82

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

CUE4Parse

Submodule CUE4Parse updated 61 files

FModel/ViewModels/CUE4ParseViewModel.cs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
using CUE4Parse.FileProvider;
1818
using CUE4Parse.FileProvider.Objects;
1919
using CUE4Parse.FileProvider.Vfs;
20+
using CUE4Parse.GameTypes.Aion2.Objects;
2021
using CUE4Parse.GameTypes.AshEchoes.FileProvider;
2122
using CUE4Parse.GameTypes.KRD.Assets.Exports;
2223
using CUE4Parse.MappingsProvider;
@@ -637,6 +638,11 @@ public void Extract(CancellationToken cancellationToken, GameFile entry, bool ad
637638

638639
break;
639640
}
641+
case "dat" when Provider.ProjectName.Equals("Aion2", StringComparison.OrdinalIgnoreCase):
642+
{
643+
ProcessAion2DatFile(entry, updateUi, saveProperties);
644+
break;
645+
}
640646
case "upluginmanifest":
641647
case "code-workspace":
642648
case "projectstore":
@@ -906,6 +912,37 @@ public void Extract(CancellationToken cancellationToken, GameFile entry, bool ad
906912
break;
907913
}
908914
}
915+
916+
void ProcessAion2DatFile(GameFile entry, bool updateUi, bool saveProperties)
917+
{
918+
TabControl.SelectedTab.Highlighter = AvalonExtensions.HighlighterSelector("json");
919+
if (entry.NameWithoutExtension.EndsWith("_MapEvent"))
920+
{
921+
var data = Provider.SaveAsset(entry);
922+
FAion2DatFileArchive.DecryptData(data);
923+
using var stream = new MemoryStream(data) { Position = 0 };
924+
using var reader = new StreamReader(stream);
925+
926+
TabControl.SelectedTab.SetDocumentText(reader.ReadToEnd(), saveProperties, updateUi);
927+
}
928+
else if (entry.NameWithoutExtension.Equals("L10NString"))
929+
{
930+
var l10nData = new FAion2L10NFile(entry);
931+
TabControl.SelectedTab.SetDocumentText(JsonConvert.SerializeObject(l10nData, Formatting.Indented), saveProperties, updateUi);
932+
}
933+
else
934+
{
935+
FAion2DataFile datfile = entry.NameWithoutExtension switch
936+
{
937+
"MapDataHierarchy" => new FAion2MapHierarchyFile(entry),
938+
"MapData" => new FAion2MapDataFile(entry, Provider),
939+
_ when entry.Directory.EndsWith("Data/WorldMap", StringComparison.OrdinalIgnoreCase) => new FAion2MapDataFile(entry, Provider),
940+
_ => new FAion2DataTableFile(entry, Provider)
941+
};
942+
943+
TabControl.SelectedTab.SetDocumentText(JsonConvert.SerializeObject(datfile, Formatting.Indented), saveProperties, updateUi);
944+
}
945+
}
909946
}
910947

911948
public void ExtractAndScroll(CancellationToken cancellationToken, string fullPath, string objectName, string parentExportType)

0 commit comments

Comments
 (0)