Search in sources :

Example 6 with TableModel

use of info.ata4.disunity.cli.util.TableModel 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)

Example 7 with TableModel

use of info.ata4.disunity.cli.util.TableModel in project disunity by ata4.

the class AssetObjectIDs method tableModel.

@Override
protected TableModel tableModel(SerializedFile serialized) {
    TableBuilder table = new TableBuilder();
    table.row("Asset Index", "ID in file");
    serialized.metadata().objectIDTable().elements().forEach(objectID -> {
        table.row(objectID.serializedFileIndex(), objectID.identifierInFile());
    });
    return new TableModel("Object IDs", table.get());
}
Also used : TableBuilder(info.ata4.disunity.cli.util.TableBuilder) TableModel(info.ata4.disunity.cli.util.TableModel)

Example 8 with TableModel

use of info.ata4.disunity.cli.util.TableModel in project disunity by ata4.

the class AssetHeader method tableModel.

@Override
protected TableModel tableModel(SerializedFile serialized) {
    SerializedFileHeader header = serialized.header();
    TableBuilder table = new TableBuilder();
    table.row("Field", "Value");
    table.row("metadataSize", header.metadataSize());
    table.row("fileSize", header.fileSize());
    table.row("version", header.version());
    table.row("dataOffset", header.dataOffset());
    if (header.version() >= 9) {
        table.row("endianness", header.endianness());
    }
    return new TableModel("Header", table.get());
}
Also used : TableBuilder(info.ata4.disunity.cli.util.TableBuilder) SerializedFileHeader(info.ata4.junity.serialize.SerializedFileHeader) TableModel(info.ata4.disunity.cli.util.TableModel)

Aggregations

TableModel (info.ata4.disunity.cli.util.TableModel)7 TableBuilder (info.ata4.disunity.cli.util.TableBuilder)5 Formatters (info.ata4.disunity.cli.util.Formatters)3 TablePrinter (info.ata4.disunity.cli.util.TablePrinter)3 TextTableFormat (info.ata4.disunity.cli.util.TextTableFormat)3 ArrayList (java.util.ArrayList)2 Parameters (com.beust.jcommander.Parameters)1 SerializedFile (info.ata4.junity.serialize.SerializedFile)1 SerializedFileHeader (info.ata4.junity.serialize.SerializedFileHeader)1 SerializedFileMetadata (info.ata4.junity.serialize.SerializedFileMetadata)1 FileIdentifier (info.ata4.junity.serialize.fileidentifier.FileIdentifier)1 ObjectInfo (info.ata4.junity.serialize.objectinfo.ObjectInfo)1 Type (info.ata4.junity.serialize.typetree.Type)1 DataBlock (info.ata4.util.io.DataBlock)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1