Update map view when tilesets change

This commit is contained in:
Marcus Huderle
2018-07-08 11:17:43 -05:00
parent 37529d37ec
commit 48a562d1eb
8 changed files with 143 additions and 32 deletions

View File

@@ -34,6 +34,7 @@ MainWindow::MainWindow(QWidget *parent) :
connect(editor, SIGNAL(objectsChanged()), this, SLOT(updateSelectedObjects()));
connect(editor, SIGNAL(selectedObjectsChanged()), this, SLOT(updateSelectedObjects()));
connect(editor, SIGNAL(loadMapRequested(QString, QString)), this, SLOT(onLoadMapRequested(QString, QString)));
connect(editor, SIGNAL(tilesetChanged(QString)), this, SLOT(onTilesetChanged(QString)));
on_toolButton_Paint_clicked();
@@ -206,6 +207,8 @@ void MainWindow::displayMapProperties() {
ui->comboBox_Weather->clear();
ui->comboBox_Type->clear();
ui->comboBox_BattleScene->clear();
ui->comboBox_PrimaryTileset->clear();
ui->comboBox_SecondaryTileset->clear();
ui->checkBox_ShowLocation->setChecked(false);
if (!editor || !editor->map || !editor->project) {
ui->frame_3->setEnabled(false);
@@ -418,6 +421,11 @@ void MainWindow::onAddNewMapToGroupClick(QAction* triggeredAction)
setMap(newMapName);
}
void MainWindow::onTilesetChanged(QString mapName)
{
setMap(mapName);
}
void MainWindow::on_mapList_activated(const QModelIndex &index)
{
QVariant data = index.data(Qt::UserRole);
@@ -820,3 +828,13 @@ void MainWindow::on_comboBox_EmergeMap_currentTextChanged(const QString &mapName
{
editor->updateEmergeMap(mapName);
}
void MainWindow::on_comboBox_PrimaryTileset_activated(const QString &tilesetLabel)
{
editor->updatePrimaryTileset(tilesetLabel);
}
void MainWindow::on_comboBox_SecondaryTileset_activated(const QString &tilesetLabel)
{
editor->updateSecondaryTileset(tilesetLabel);
}