create edit history for region map tilemap and layout

This commit is contained in:
garak
2022-04-26 17:02:03 -04:00
committed by garakmon
parent 43ebeb1662
commit 2b152ce64e
9 changed files with 152 additions and 176 deletions

View File

@@ -45,9 +45,6 @@ public:
void onRegionMapEntriesSelectedTileChanged(QString) {};
void onRegionMapEntryDragged(int, int);
void undo();
void redo();
void resize(int width, int height);
QObjectList shortcutableObjects() const;
@@ -61,7 +58,7 @@ private:
poryjson::Json rmConfigJson;
History<RegionMapHistoryItem*> history;
QUndoGroup history;
int currIndex = 0;
unsigned selectedCityTile;
@@ -124,8 +121,6 @@ private:
private slots:
void on_action_RegionMap_Save_triggered();
void on_action_RegionMap_Undo_triggered();
void on_action_RegionMap_Redo_triggered();
void on_action_RegionMap_Resize_triggered();
void on_action_RegionMap_ClearImage_triggered();
void on_action_RegionMap_ClearLayout_triggered();

View File

@@ -123,7 +123,9 @@ public:
this->tileset = QImage(tilesetFilepath);
this->format = format;
bool err;
this->palette = PaletteUtil::parse(palFilepath, &err);
if (!palFilepath.isEmpty()) {
this->palette = PaletteUtil::parse(palFilepath, &err);
}
this->setPixmap(QPixmap::fromImage(this->tileset));
this->numTilesWide = this->tileset.width() / 8;
this->selectedTile = 0x00;