Skip to content

Commit 4099697

Browse files
committed
Code Vein 2, Infinity Nikki update
Ashes of Creation dbc extraction
1 parent 14e05da commit 4099697

2 files changed

Lines changed: 39 additions & 7 deletions

File tree

CUE4Parse

Submodule CUE4Parse updated 29 files

FModel/ViewModels/CUE4ParseViewModel.cs

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
using CUE4Parse.FileProvider.Objects;
2121
using CUE4Parse.FileProvider.Vfs;
2222
using CUE4Parse.GameTypes.Aion2.Objects;
23+
using CUE4Parse.GameTypes.AoC.Objects;
2324
using CUE4Parse.GameTypes.AshEchoes.FileProvider;
2425
using CUE4Parse.GameTypes.SMG.UE4.Assets.Exports.Wwise;
2526
using CUE4Parse.GameTypes.KRD.Assets.Exports;
@@ -657,11 +658,16 @@ public void Extract(CancellationToken cancellationToken, GameFile entry, bool ad
657658

658659
break;
659660
}
660-
case "dat" when Provider.ProjectName.Equals("Aion2", StringComparison.OrdinalIgnoreCase):
661-
{
662-
ProcessAion2DatFile(entry, updateUi, saveProperties);
663-
break;
664-
}
661+
case "dat" when Provider.Versions.Game is EGame.GAME_Aion2:
662+
{
663+
ProcessAion2DatFile(entry, updateUi, saveProperties);
664+
break;
665+
}
666+
case "dbc" when Provider.Versions.Game is EGame.GAME_AshesOfCreation:
667+
{
668+
ProcessCacheDBFile(entry, updateUi, saveProperties);
669+
break;
670+
}
665671
case "upluginmanifest":
666672
case "code-workspace":
667673
case "projectstore":
@@ -690,6 +696,7 @@ public void Extract(CancellationToken cancellationToken, GameFile entry, bool ad
690696
case "usda":
691697
case "ocio":
692698
case "data" when Provider.ProjectName is "OakGame":
699+
case "scss":
693700
case "ini":
694701
case "txt":
695702
case "log":
@@ -705,6 +712,7 @@ public void Extract(CancellationToken cancellationToken, GameFile entry, bool ad
705712
case "css":
706713
case "csv":
707714
case "pem":
715+
case "tsv":
708716
case "tps":
709717
case "tgc": // State of Decay 2
710718
case "cpp":
@@ -969,6 +977,30 @@ void ProcessAion2DatFile(GameFile entry, bool updateUi, bool saveProperties)
969977
TabControl.SelectedTab.SetDocumentText(JsonConvert.SerializeObject(datfile, Formatting.Indented), saveProperties, updateUi);
970978
}
971979
}
980+
981+
// Ashhes of Creation
982+
void ProcessCacheDBFile(GameFile entry, bool updateUi, bool saveProperties)
983+
{
984+
var data = entry.Read();
985+
var dbc = new FAoCDBCReader(data, Provider.MappingsForGame, Provider.Versions);
986+
for (var i = 0; i < dbc.Chunks.Length; i++)
987+
{
988+
if (!dbc.TryReadChunk(i, out var category, out var files))
989+
{
990+
Log.Warning("Couldn't read {i} chuck in AoC CacheDB", i);
991+
continue;
992+
}
993+
var fileName = Path.ChangeExtension(category, ".json");
994+
var directory = Path.Combine(UserSettings.Default.PropertiesDirectory,
995+
UserSettings.Default.KeepDirectoryStructure ? entry.Directory : "", entry.Name, fileName).Replace('\\', '/');
996+
997+
Directory.CreateDirectory(directory.SubstringBeforeLast('/'));
998+
999+
File.WriteAllText(directory, JsonConvert.SerializeObject(files, Formatting.Indented));
1000+
}
1001+
1002+
TabControl.SelectedTab.SetDocumentText(JsonConvert.SerializeObject(dbc, Formatting.Indented), saveProperties, updateUi);
1003+
}
9721004
}
9731005

9741006
public void ExtractAndScroll(CancellationToken cancellationToken, string fullPath, string objectName, string parentExportType)
@@ -1076,7 +1108,7 @@ public void ExtractAndScroll(CancellationToken cancellationToken, string fullPat
10761108
TabControl.SelectedTab.AddImage(sourceFile.SubstringAfterLast('/'), false, bitmap, false, updateUi);
10771109
return false;
10781110
}
1079-
// The Dark Pictures Anthology: House of Ashes
1111+
// The Dark Pictures Anthology
10801112
case UExternalSource when (isNone || saveAudio) && pointer.Object.Value is UExternalSource externalSource:
10811113
{
10821114
var audioName = Path.GetFileNameWithoutExtension(externalSource.ExternalSourcePath);

0 commit comments

Comments
 (0)