Merge pull request #559 from GriffinRichards/custom-images

Update settings window
This commit is contained in:
GriffinR
2023-12-27 23:05:22 -05:00
committed by GitHub
85 changed files with 4409 additions and 1956 deletions

View File

@@ -99,7 +99,7 @@ int MainWindow::getMetatileId(int x, int y) {
if (!this->editor->map->getBlock(x, y, &block)) {
return 0;
}
return block.metatileId;
return block.metatileId();
}
void MainWindow::setMetatileId(int x, int y, int metatileId, bool forceRedraw, bool commitChanges) {
@@ -109,7 +109,7 @@ void MainWindow::setMetatileId(int x, int y, int metatileId, bool forceRedraw, b
if (!this->editor->map->getBlock(x, y, &block)) {
return;
}
this->editor->map->setBlock(x, y, Block(metatileId, block.collision, block.elevation));
this->editor->map->setBlock(x, y, Block(metatileId, block.collision(), block.elevation()));
this->tryCommitMapChanges(commitChanges);
this->tryRedrawMapArea(forceRedraw);
}
@@ -121,7 +121,7 @@ int MainWindow::getCollision(int x, int y) {
if (!this->editor->map->getBlock(x, y, &block)) {
return 0;
}
return block.collision;
return block.collision();
}
void MainWindow::setCollision(int x, int y, int collision, bool forceRedraw, bool commitChanges) {
@@ -131,7 +131,7 @@ void MainWindow::setCollision(int x, int y, int collision, bool forceRedraw, boo
if (!this->editor->map->getBlock(x, y, &block)) {
return;
}
this->editor->map->setBlock(x, y, Block(block.metatileId, collision, block.elevation));
this->editor->map->setBlock(x, y, Block(block.metatileId(), collision, block.elevation()));
this->tryCommitMapChanges(commitChanges);
this->tryRedrawMapArea(forceRedraw);
}
@@ -143,7 +143,7 @@ int MainWindow::getElevation(int x, int y) {
if (!this->editor->map->getBlock(x, y, &block)) {
return 0;
}
return block.elevation;
return block.elevation();
}
void MainWindow::setElevation(int x, int y, int elevation, bool forceRedraw, bool commitChanges) {
@@ -153,7 +153,7 @@ void MainWindow::setElevation(int x, int y, int elevation, bool forceRedraw, boo
if (!this->editor->map->getBlock(x, y, &block)) {
return;
}
this->editor->map->setBlock(x, y, Block(block.metatileId, block.collision, elevation));
this->editor->map->setBlock(x, y, Block(block.metatileId(), block.collision(), elevation));
this->tryCommitMapChanges(commitChanges);
this->tryRedrawMapArea(forceRedraw);
}
@@ -625,7 +625,7 @@ int MainWindow::getMetatileLayerType(int metatileId) {
Metatile * metatile = this->getMetatile(metatileId);
if (!metatile)
return -1;
return metatile->layerType;
return metatile->layerType();
}
void MainWindow::setMetatileLayerType(int metatileId, int layerType) {
@@ -640,7 +640,7 @@ int MainWindow::getMetatileEncounterType(int metatileId) {
Metatile * metatile = this->getMetatile(metatileId);
if (!metatile)
return -1;
return metatile->encounterType;
return metatile->encounterType();
}
void MainWindow::setMetatileEncounterType(int metatileId, int encounterType) {
@@ -655,7 +655,7 @@ int MainWindow::getMetatileTerrainType(int metatileId) {
Metatile * metatile = this->getMetatile(metatileId);
if (!metatile)
return -1;
return metatile->terrainType;
return metatile->terrainType();
}
void MainWindow::setMetatileTerrainType(int metatileId, int terrainType) {
@@ -670,7 +670,7 @@ int MainWindow::getMetatileBehavior(int metatileId) {
Metatile * metatile = this->getMetatile(metatileId);
if (!metatile)
return -1;
return metatile->behavior;
return metatile->behavior();
}
void MainWindow::setMetatileBehavior(int metatileId, int behavior) {

View File

@@ -312,9 +312,9 @@ void Scripting::cb_BorderVisibilityToggled(bool visible) {
QJSValue Scripting::fromBlock(Block block) {
QJSValue obj = instance->engine->newObject();
obj.setProperty("metatileId", block.metatileId);
obj.setProperty("collision", block.collision);
obj.setProperty("elevation", block.elevation);
obj.setProperty("metatileId", block.metatileId());
obj.setProperty("collision", block.collision());
obj.setProperty("elevation", block.elevation());
obj.setProperty("rawValue", block.rawValue());
return obj;
}