fix event tabs not updating with group size changes
This commit is contained in:
parent
9e54537ba2
commit
679f2419b7
4 changed files with 15 additions and 9 deletions
|
@ -208,7 +208,6 @@ private slots:
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void objectsChanged();
|
void objectsChanged();
|
||||||
void selectedObjectsChanged();
|
|
||||||
void loadMapRequested(QString, QString);
|
void loadMapRequested(QString, QString);
|
||||||
void wildMonDataChanged();
|
void wildMonDataChanged();
|
||||||
void warpEventDoubleClicked(QString, int, Event::Group);
|
void warpEventDoubleClicked(QString, int, Event::Group);
|
||||||
|
|
|
@ -219,6 +219,7 @@ private slots:
|
||||||
void on_toolButton_deleteObject_clicked();
|
void on_toolButton_deleteObject_clicked();
|
||||||
|
|
||||||
void addNewEvent(Event::Type type);
|
void addNewEvent(Event::Type type);
|
||||||
|
void displayEventTabs();
|
||||||
void updateSelectedObjects();
|
void updateSelectedObjects();
|
||||||
void updateObjects();
|
void updateObjects();
|
||||||
|
|
||||||
|
|
|
@ -2009,7 +2009,7 @@ void Editor::updateSelectedEvents() {
|
||||||
redrawObject(item);
|
redrawObject(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
emit selectedObjectsChanged();
|
emit objectsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Editor::selectMapEvent(DraggablePixmapItem *object) {
|
void Editor::selectMapEvent(DraggablePixmapItem *object) {
|
||||||
|
|
|
@ -252,7 +252,6 @@ void MainWindow::initExtraSignals() {
|
||||||
void MainWindow::initEditor() {
|
void MainWindow::initEditor() {
|
||||||
this->editor = new Editor(ui);
|
this->editor = new Editor(ui);
|
||||||
connect(this->editor, &Editor::objectsChanged, this, &MainWindow::updateObjects);
|
connect(this->editor, &Editor::objectsChanged, this, &MainWindow::updateObjects);
|
||||||
connect(this->editor, &Editor::selectedObjectsChanged, this, &MainWindow::updateSelectedObjects);
|
|
||||||
connect(this->editor, &Editor::loadMapRequested, this, &MainWindow::onLoadMapRequested);
|
connect(this->editor, &Editor::loadMapRequested, this, &MainWindow::onLoadMapRequested);
|
||||||
connect(this->editor, &Editor::warpEventDoubleClicked, this, &MainWindow::openWarpMap);
|
connect(this->editor, &Editor::warpEventDoubleClicked, this, &MainWindow::openWarpMap);
|
||||||
connect(this->editor, &Editor::currentMetatilesSelectionChanged, this, &MainWindow::currentMetatilesSelectionChanged);
|
connect(this->editor, &Editor::currentMetatilesSelectionChanged, this, &MainWindow::currentMetatilesSelectionChanged);
|
||||||
|
@ -1910,12 +1909,9 @@ void MainWindow::addNewEvent(Event::Type type) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::updateObjects() {
|
void MainWindow::displayEventTabs() {
|
||||||
selectedObject = nullptr;
|
const QSignalBlocker blocker(ui->tabWidget_EventType);
|
||||||
selectedWarp = nullptr;
|
|
||||||
selectedTrigger = nullptr;
|
|
||||||
selectedBG = nullptr;
|
|
||||||
selectedHealspot = nullptr;
|
|
||||||
ui->tabWidget_EventType->clear();
|
ui->tabWidget_EventType->clear();
|
||||||
|
|
||||||
if (editor->map->events.value(Event::Group::Object).length())
|
if (editor->map->events.value(Event::Group::Object).length())
|
||||||
|
@ -1932,6 +1928,16 @@ void MainWindow::updateObjects() {
|
||||||
|
|
||||||
if (editor->map->events.value(Event::Group::Heal).length())
|
if (editor->map->events.value(Event::Group::Heal).length())
|
||||||
ui->tabWidget_EventType->addTab(eventTabHealspotWidget, "Healspots");
|
ui->tabWidget_EventType->addTab(eventTabHealspotWidget, "Healspots");
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::updateObjects() {
|
||||||
|
selectedObject = nullptr;
|
||||||
|
selectedWarp = nullptr;
|
||||||
|
selectedTrigger = nullptr;
|
||||||
|
selectedBG = nullptr;
|
||||||
|
selectedHealspot = nullptr;
|
||||||
|
|
||||||
|
displayEventTabs();
|
||||||
|
|
||||||
updateSelectedObjects();
|
updateSelectedObjects();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue