diff --git a/include/ui/paletteeditor.h b/include/ui/paletteeditor.h index 679e2872..9cd4da03 100644 --- a/include/ui/paletteeditor.h +++ b/include/ui/paletteeditor.h @@ -23,7 +23,7 @@ public: class PaletteEditor : public QMainWindow { Q_OBJECT public: - explicit PaletteEditor(Project*, Tileset*, Tileset*, QWidget *parent = nullptr); + explicit PaletteEditor(Project*, Tileset*, Tileset*, int paletteId, QWidget *parent = nullptr); ~PaletteEditor(); void setPaletteId(int); void setTilesets(Tileset*, Tileset*); diff --git a/src/ui/paletteeditor.cpp b/src/ui/paletteeditor.cpp index c573fa79..87169784 100644 --- a/src/ui/paletteeditor.cpp +++ b/src/ui/paletteeditor.cpp @@ -5,7 +5,7 @@ #include #include "log.h" -PaletteEditor::PaletteEditor(Project *project, Tileset *primaryTileset, Tileset *secondaryTileset, QWidget *parent) : +PaletteEditor::PaletteEditor(Project *project, Tileset *primaryTileset, Tileset *secondaryTileset, int paletteId, QWidget *parent) : QMainWindow(parent), ui(new Ui::PaletteEditor) { @@ -110,8 +110,7 @@ PaletteEditor::PaletteEditor(Project *project, Tileset *primaryTileset, Tileset } this->initColorSliders(); - this->refreshColorSliders(); - this->refreshColors(); + this->setPaletteId(paletteId); this->commitEditHistory(this->ui->spinBox_PaletteId->value()); } diff --git a/src/ui/tileseteditor.cpp b/src/ui/tileseteditor.cpp index 85b94c35..2ace3e77 100644 --- a/src/ui/tileseteditor.cpp +++ b/src/ui/tileseteditor.cpp @@ -591,7 +591,7 @@ void TilesetEditor::on_actionChange_Metatiles_Count_triggered() void TilesetEditor::on_actionChange_Palettes_triggered() { if (!this->paletteEditor) { - this->paletteEditor = new PaletteEditor(this->project, this->primaryTileset, this->secondaryTileset, this); + this->paletteEditor = new PaletteEditor(this->project, this->primaryTileset, this->secondaryTileset, this->paletteId, this); connect(this->paletteEditor, SIGNAL(changedPaletteColor()), this, SLOT(onPaletteEditorChangedPaletteColor())); connect(this->paletteEditor, SIGNAL(changedPalette(int)), this, SLOT(onPaletteEditorChangedPalette(int))); }