diff --git a/include/ui/neweventtoolbutton.h b/include/ui/neweventtoolbutton.h index 007dcd51..1168d447 100644 --- a/include/ui/neweventtoolbutton.h +++ b/include/ui/neweventtoolbutton.h @@ -10,6 +10,14 @@ class NewEventToolButton : public QToolButton public: explicit NewEventToolButton(QWidget *parent = nullptr); QString getSelectedEventType(); + QAction *newObjectAction; + QAction *newWarpAction; + QAction *newHealLocationAction; + QAction *newTriggerAction; + QAction *newWeatherTriggerAction; + QAction *newSignAction; + QAction *newHiddenItemAction; + QAction *newSecretBaseAction; public slots: void newObject(); void newWarp(); @@ -23,14 +31,6 @@ signals: void newEventAdded(QString); private: QString selectedEventType; - QAction *newObjectAction; - QAction *newWarpAction; - QAction *newHealLocationAction; - QAction *newTriggerAction; - QAction *newWeatherTriggerAction; - QAction *newSignAction; - QAction *newHiddenItemAction; - QAction *newSecretBaseAction; void init(); }; diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 2a1ed2d4..510ff4e9 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -50,7 +50,6 @@ MainWindow::MainWindow(QWidget *parent) : // Re-initialize everything to a blank slate if opening the recent project failed. this->initWindow(); } - on_toolButton_Paint_clicked(); } @@ -185,6 +184,11 @@ void MainWindow::setProjectSpecificUIVisibility() ui->label_AllowBiking->setVisible(true); ui->label_AllowEscapeRope->setVisible(true); ui->label_FloorNumber->setVisible(true); + ui->newEventToolButton->newWeatherTriggerAction->setVisible(false); + ui->newEventToolButton->newSecretBaseAction->setVisible(false); + // TODO: pokefirered is not set up for the Region Map Editor and vice versa. + // porymap will crash on attempt. Remove below once resolved + ui->actionRegion_Map_Editor->setVisible(false); break; } } @@ -639,7 +643,6 @@ bool MainWindow::loadDataStructures() { && project->readMapTypes() && project->readMapBattleScenes() && project->readWeatherNames() - && project->readCoordEventWeatherNames() && project->readBgEventFacingDirections() && project->readMetatileBehaviors() && project->readTilesetProperties() @@ -648,7 +651,9 @@ bool MainWindow::loadDataStructures() { && project->readSpeciesIconPaths() && project->readWildMonData(); if (projectConfig.getBaseGameVersion() == BaseGameVersion::pokeemerald || projectConfig.getBaseGameVersion() == BaseGameVersion::pokeruby) - success = success && project->readSecretBaseIds(); + success = success + && project->readSecretBaseIds() + && project->readCoordEventWeatherNames(); if (!success) { return false; } diff --git a/src/project.cpp b/src/project.cpp index 3783f4b2..a7a2ccfe 100644 --- a/src/project.cpp +++ b/src/project.cpp @@ -1961,8 +1961,6 @@ bool Project::readWeatherNames() { } bool Project::readCoordEventWeatherNames() { - if (projectConfig.getBaseGameVersion() == BaseGameVersion::pokefirered) - return true; coordEventWeatherNames->clear(); QStringList prefixes = (QStringList() << "COORD_EVENT_WEATHER_"); QString filename = "include/constants/weather.h";