Search in sources :

Example 1 with FileIdentifier

use of info.ata4.junity.serialize.fileidentifier.FileIdentifier in project disunity by ata4.

the class AssetExternalRefs method tableModel.

@Override
protected TableModel tableModel(SerializedFile serialized) {
    FileIdentifierTable<FileIdentifier> externals = serialized.metadata().externals();
    Class<FileIdentifier> factory = externals.elementFactory();
    boolean v2 = FileIdentifierV2.class.isAssignableFrom(factory);
    TableBuilder table = new TableBuilder();
    table.row("File Path");
    if (v2) {
        table.append("Asset Path");
    }
    table.append("GUID", "Type");
    externals.elements().forEach(external -> {
        table.row(external.filePath());
        if (v2) {
            table.append(((FileIdentifierV2) external).assetPath());
        }
        table.append(external.guid(), external.type());
    });
    return new TableModel("External References", table.get());
}
Also used : FileIdentifier(info.ata4.junity.serialize.fileidentifier.FileIdentifier) TableBuilder(info.ata4.disunity.cli.util.TableBuilder) TableModel(info.ata4.disunity.cli.util.TableModel)

Aggregations

TableBuilder (info.ata4.disunity.cli.util.TableBuilder)1 TableModel (info.ata4.disunity.cli.util.TableModel)1 FileIdentifier (info.ata4.junity.serialize.fileidentifier.FileIdentifier)1