Reflect palette changes in TE metatile selection
This commit is contained in:
parent
5798ef7fda
commit
cf9314eaa6
2 changed files with 6 additions and 0 deletions
|
@ -14,6 +14,7 @@ public:
|
|||
this->paletteId = 0;
|
||||
this->xFlip = false;
|
||||
this->yFlip = false;
|
||||
this->paletteChanged = false;
|
||||
setAcceptHoverEvents(true);
|
||||
}
|
||||
QPoint getSelectionDimensions();
|
||||
|
@ -48,6 +49,7 @@ private:
|
|||
int paletteId;
|
||||
bool xFlip;
|
||||
bool yFlip;
|
||||
bool paletteChanged;
|
||||
void updateSelectedTiles();
|
||||
uint16_t getTileId(int x, int y);
|
||||
QPoint getTileCoords(uint16_t);
|
||||
|
|
|
@ -71,6 +71,7 @@ void TilesetEditorTileSelector::setTilesets(Tileset *primaryTileset, Tileset *se
|
|||
|
||||
void TilesetEditorTileSelector::setPaletteId(int paletteId) {
|
||||
this->paletteId = paletteId;
|
||||
this->paletteChanged = true;
|
||||
this->draw();
|
||||
}
|
||||
|
||||
|
@ -118,6 +119,8 @@ QList<Tile> TilesetEditorTileSelector::buildSelectedTiles(int width, int height,
|
|||
Tile tile = selected.at(index);
|
||||
tile.xflip ^= this->xFlip;
|
||||
tile.yflip ^= this->yFlip;
|
||||
if (this->paletteChanged)
|
||||
tile.palette = this->paletteId;
|
||||
if (this->xFlip)
|
||||
layerRow.prepend(tile);
|
||||
else
|
||||
|
@ -145,6 +148,7 @@ QList<Tile> TilesetEditorTileSelector::buildSelectedTiles(int width, int height,
|
|||
|
||||
void TilesetEditorTileSelector::setExternalSelection(int width, int height, QList<Tile> tiles) {
|
||||
this->externalSelection = true;
|
||||
this->paletteChanged = false;
|
||||
this->externalSelectionWidth = width;
|
||||
this->externalSelectionHeight = height;
|
||||
this->externalSelectedTiles.clear();
|
||||
|
|
Loading…
Reference in a new issue