clean rme UI, undo / redo history, new city maps

This commit is contained in:
garak
2019-01-08 21:03:54 -05:00
parent d3a16d34df
commit 83f3cef52e
10 changed files with 1230 additions and 785 deletions

View File

@@ -12,4 +12,19 @@ public:
~HistoryItem();
};
enum RegionMapEditorBox {
BackgroundImage = 1,
CityMapImage = 2,
};
class RegionMapHistoryItem {
public:
int which;// region map or city map
int index;
unsigned tile;
unsigned prev;
RegionMapHistoryItem(int type, int index, unsigned prev, unsigned tile);
~RegionMapHistoryItem();
};
#endif // HISTORYITEM_H

View File

@@ -4,6 +4,8 @@
#include "project.h"
#include "map.h"
#include "tilemaptileselector.h"
#include "history.h"
#include "historyitem.h"
#include <QStringList>
#include <QString>
@@ -73,6 +75,8 @@ public:
//RegionMapSquare *map_squares = nullptr;// array of RegionMapSquares
QList<RegionMapSquare> map_squares;
History<RegionMapHistoryItem*> history;
QString temp_path;// delete this
QString city_map_squares_path;
QString region_map_png_path;
@@ -125,6 +129,8 @@ public:
unsigned getTileId(int, int);
int getMapSquareIndex(int, int);
void deleteLayoutSquare(int);
// implement these here?
void undo();
void redo();
@@ -134,6 +140,7 @@ public:
// TODO: move read / write functions to private (and others)
private:
//
//History<QPair<int, uint8_t>> *history;// (index, tile)
int layout_width_;
int layout_height_;
int img_width_;