Add getMaxTilesetMetatiles to API
This commit is contained in:
parent
b5bdac8d36
commit
6c1e5b516d
2 changed files with 14 additions and 0 deletions
|
@ -102,7 +102,9 @@ public:
|
||||||
Q_INVOKABLE QJSValue getSecondaryTilesetPalettePreview(int paletteIndex);
|
Q_INVOKABLE QJSValue getSecondaryTilesetPalettePreview(int paletteIndex);
|
||||||
Q_INVOKABLE QJSValue getSecondaryTilesetPalettesPreview();
|
Q_INVOKABLE QJSValue getSecondaryTilesetPalettesPreview();
|
||||||
Q_INVOKABLE int getNumPrimaryTilesetMetatiles();
|
Q_INVOKABLE int getNumPrimaryTilesetMetatiles();
|
||||||
|
Q_INVOKABLE int getMaxPrimaryTilesetMetatiles();
|
||||||
Q_INVOKABLE int getNumSecondaryTilesetMetatiles();
|
Q_INVOKABLE int getNumSecondaryTilesetMetatiles();
|
||||||
|
Q_INVOKABLE int getMaxSecondaryTilesetMetatiles();
|
||||||
Q_INVOKABLE bool isPrimaryTileset(QString tilesetName);
|
Q_INVOKABLE bool isPrimaryTileset(QString tilesetName);
|
||||||
Q_INVOKABLE bool isSecondaryTileset(QString tilesetName);
|
Q_INVOKABLE bool isSecondaryTileset(QString tilesetName);
|
||||||
Q_INVOKABLE QString getPrimaryTileset();
|
Q_INVOKABLE QString getPrimaryTileset();
|
||||||
|
|
|
@ -538,12 +538,24 @@ int MainWindow::getNumPrimaryTilesetMetatiles() {
|
||||||
return this->editor->map->layout->tileset_primary->metatiles.length();
|
return this->editor->map->layout->tileset_primary->metatiles.length();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int MainWindow::getMaxPrimaryTilesetMetatiles() {
|
||||||
|
if (!this->editor || !this->editor->project)
|
||||||
|
return 0;
|
||||||
|
return this->editor->project->getNumMetatilesPrimary();
|
||||||
|
}
|
||||||
|
|
||||||
int MainWindow::getNumSecondaryTilesetMetatiles() {
|
int MainWindow::getNumSecondaryTilesetMetatiles() {
|
||||||
if (!this->editor || !this->editor->map || !this->editor->map->layout || !this->editor->map->layout->tileset_secondary)
|
if (!this->editor || !this->editor->map || !this->editor->map->layout || !this->editor->map->layout->tileset_secondary)
|
||||||
return 0;
|
return 0;
|
||||||
return this->editor->map->layout->tileset_secondary->metatiles.length();
|
return this->editor->map->layout->tileset_secondary->metatiles.length();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int MainWindow::getMaxSecondaryTilesetMetatiles() {
|
||||||
|
if (!this->editor || !this->editor->project)
|
||||||
|
return 0;
|
||||||
|
return this->editor->project->getNumMetatilesTotal() - this->editor->project->getNumMetatilesPrimary();
|
||||||
|
}
|
||||||
|
|
||||||
bool MainWindow::isPrimaryTileset(QString tilesetName) {
|
bool MainWindow::isPrimaryTileset(QString tilesetName) {
|
||||||
if (!this->editor || !this->editor->project)
|
if (!this->editor || !this->editor->project)
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue