mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-28 03:25:30 -05:00
Add edit-undo history for tileset palette changes
This commit is contained in:
@@ -6,11 +6,20 @@
|
||||
#include <QFrame>
|
||||
#include <QLabel>
|
||||
#include "project.h"
|
||||
#include "history.h"
|
||||
|
||||
namespace Ui {
|
||||
class PaletteEditor;
|
||||
}
|
||||
|
||||
class PaletteHistoryItem {
|
||||
public:
|
||||
QList<QRgb> colors;
|
||||
PaletteHistoryItem(QList<QRgb> colors) {
|
||||
this->colors = colors;
|
||||
}
|
||||
};
|
||||
|
||||
class PaletteEditor : public QMainWindow {
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -26,6 +35,7 @@ private:
|
||||
QList<QLabel*> rgbLabels;
|
||||
Tileset *primaryTileset;
|
||||
Tileset *secondaryTileset;
|
||||
QList<History<PaletteHistoryItem*>> palettesHistory;
|
||||
void disableSliderSignals();
|
||||
void enableSliderSignals();
|
||||
void initColorSliders();
|
||||
@@ -33,6 +43,8 @@ private:
|
||||
void refreshColors();
|
||||
void refreshColor(int);
|
||||
void setColor(int);
|
||||
void commitEditHistory();
|
||||
void setColorsFromHistory(PaletteHistoryItem*, int);
|
||||
|
||||
signals:
|
||||
void closed();
|
||||
@@ -40,6 +52,8 @@ signals:
|
||||
void changedPalette(int);
|
||||
private slots:
|
||||
void on_spinBox_PaletteId_valueChanged(int arg1);
|
||||
void on_actionUndo_triggered();
|
||||
void on_actionRedo_triggered();
|
||||
};
|
||||
|
||||
#endif // PALETTEEDITOR_H
|
||||
|
||||
Reference in New Issue
Block a user