feat: add DLC dumping
This commit is contained in:
@@ -37,6 +37,13 @@ struct OfferingInfo
|
||||
public EPlayerRole role;
|
||||
}
|
||||
|
||||
struct DLCInfo
|
||||
{
|
||||
public string id;
|
||||
public string? name;
|
||||
public Dictionary<string, string> dlcIds;
|
||||
}
|
||||
|
||||
class Dumper
|
||||
{
|
||||
private DefaultFileProvider? _provider;
|
||||
@@ -207,6 +214,37 @@ class Dumper
|
||||
WriteJson("offerings", _offeringMap.Values);
|
||||
}
|
||||
|
||||
public void DumpDLCs()
|
||||
{
|
||||
List<DLCInfo> dlcList = new List<DLCInfo>();
|
||||
|
||||
ProcessDataTables("/DlcDB.uasset", "dlcs", (rowKey, props) =>
|
||||
{
|
||||
if (!TryGetProp(props, "DlcIdSteam", out string steamId)
|
||||
|| !TryGetProp(props, "DlcIdEpic", out string epicId)
|
||||
|| !TryGetProp(props, "DlcIdGRDK", out string grdkId)
|
||||
)
|
||||
throw new KeyNotFoundException("DLC id or DisplayName was not found");
|
||||
|
||||
|
||||
string? displayName = null;
|
||||
if (TryGetStringProp<FText>(props, "DisplayName", out string foundName) && !string.IsNullOrWhiteSpace(foundName))
|
||||
displayName = foundName;
|
||||
|
||||
DLCInfo info = new DLCInfo
|
||||
{
|
||||
id = rowKey,
|
||||
name = displayName,
|
||||
dlcIds = new Dictionary<string, string> { { "steam", steamId }, { "epic", epicId }, { "grdk", grdkId } }
|
||||
};
|
||||
|
||||
dlcList.Add(info);
|
||||
});
|
||||
|
||||
_log.Info("Dumped {0} dlcs", dlcList.Count);
|
||||
WriteJson("dlcs", dlcList.ToArray());
|
||||
}
|
||||
|
||||
public void DumpCharacterIcons() => ExportIcons(_characterMap.Values.Select(x => x.iconFilePath), "character", "/character-icons/");
|
||||
public void DumpItemIcons() => ExportIcons(_itemMap.Values.Select(x => x.iconFilePath), "item", "/item-icons/");
|
||||
public void DumpOfferingIcons() => ExportIcons(_offeringMap.Values.Select(x => x.iconFilePath), "offering", "/offering-icons/");
|
||||
|
||||
Reference in New Issue
Block a user