QtCraft API C++ classes QML types Handbook

QcTexturePackManifest Struct

The manifest texturepack.json of a texture pack (decision E-297): what the settings show and the resolution every image of the pack must have. More...

Header: #include <clientcore/texturepacks/QcTexturePackManifest.h>

Public Types

struct Credit

Public Functions

QString descriptionIn(const QString &language) const

Public Variables

QList<QcTexturePackManifest::Credit> credits
QString description
QHash<QString, QString> descriptions
int format
QString license
QString name
QString preview
bool procedural
int resolution

Static Public Members

const char *const fileName
const int formatVersion
bool isPlainFileName(const QString &name)
bool isValidResolution(int resolution)
const qint64 maxBytes
const int maxCredits
const int maxDescriptions
const int maxNameLength
const int maxResolution
const int maxTextLength
const int minResolution
std::expected<QcTexturePackManifest, QcTexturePackProblem> parse(const QByteArray &bytes)

Detailed Description

Member Function Documentation

QString QcTexturePackManifest::descriptionIn(const QString &language) const

Returns the description in language ("de"), the plain one without a text in that language.

[static] bool QcTexturePackManifest::isPlainFileName(const QString &name)

Returns whether name is a file name inside the pack folder: no path separators, no "..", no hidden file.

[static] bool QcTexturePackManifest::isValidResolution(int resolution)

Returns whether resolution is a power of two from minResolution to maxResolution.

[static] std::expected<QcTexturePackManifest, QcTexturePackProblem> QcTexturePackManifest::parse(const QByteArray &bytes)

Returns the manifest read from bytes after checking every field; the first problem found is the error.

Member Variable Documentation

QList<QcTexturePackManifest::Credit> QcTexturePackManifest::credits

Who made parts of the pack (optional "credits").

QString QcTexturePackManifest::description

Description shown when the game's language has none of its own in descriptions.

QHash<QString, QString> QcTexturePackManifest::descriptions

The description in other languages, by language code ("de"; keys read in lower case up to "_" or "-"), from the optional object "descriptions"; the settings show the one of the game's language (TP-2 of docs/Menue-Pruefung.md).

const char *const QcTexturePackManifest::fileName

Name of the manifest file in the pack folder.

int QcTexturePackManifest::format

Manifest format ("format").

const int QcTexturePackManifest::formatVersion

The only manifest format this game reads ("format").

QString QcTexturePackManifest::license

Licence of the pack as a whole (e.g. "CC0-1.0", "CC-BY-4.0").

const qint64 QcTexturePackManifest::maxBytes

Largest size of the manifest file in bytes.

const int QcTexturePackManifest::maxCredits

Most entries in "credits".

const int QcTexturePackManifest::maxDescriptions

Most languages in "descriptions".

const int QcTexturePackManifest::maxNameLength

Longest name (also of the preview file); the licence and each credit's author, license, source and note may be four times as long.

const int QcTexturePackManifest::maxResolution

Largest texture resolution of a pack.

const int QcTexturePackManifest::maxTextLength

Longest description, in each language.

const int QcTexturePackManifest::minResolution

Smallest texture resolution of a pack.

QString QcTexturePackManifest::name

Name of the pack shown in the settings.

QString QcTexturePackManifest::preview

Optional preview image in the pack folder: a plain file name ending in .png.

bool QcTexturePackManifest::procedural

Renders the procedural textures of the game and of mods (content/*/textures/*.json) at the pack's resolution, below the pack's own files.

int QcTexturePackManifest::resolution

Edge length of one texture in pixels: a power of two from 16 to 512.