QtCraft API C++ classes QML types Handbook

QcHangingParser Namespace

Parses the "hangs" object of an item (decision E-790): "type" ("item_frame" or "painting"), for a painting its "motifs" ({"name", "texture", "width", "height"}, sizes 1 to 4) and its "back" texture. More...

Header: #include <common/content/blockbehaviour/QcHangingParser.h>

Functions

QStringList checkTextures(const QString &item, const QcHangingDefinition &hangs, const QcAssetCatalog &assets)
QcHangingDefinition parseHanging(const QJsonObject &json, const QString &packNamespace, QcJsonFieldReader &reader)

Detailed Description

Function Documentation

QStringList QcHangingParser::checkTextures(const QString &item, const QcHangingDefinition &hangs, const QcAssetCatalog &assets)

Returns what is wrong with the textures of the motifs hangs of the painting item, looked up in assets once every pack is loaded (decision E-791): a motif of one block needs its texture, a larger one a procedural texture whose "tiles" are exactly its width and height. One line per motif in error.

QcHangingDefinition QcHangingParser::parseHanging(const QJsonObject &json, const QString &packNamespace, QcJsonFieldReader &reader)

Returns the hanging definition of the "hangs" object json. Failures go to reader; names get packNamespace.