diff --git a/include/config.h b/include/config.h index b49d56dc..a48c7e45 100644 --- a/include/config.h +++ b/include/config.h @@ -157,6 +157,7 @@ public: } void setBaseGameVersion(BaseGameVersion baseGameVersion); BaseGameVersion getBaseGameVersion(); + QString getBaseGameVersionString(); void setRecentMap(const QString &map); QString getRecentMap(); void setEncounterJsonActive(bool active); diff --git a/include/mainwindow.h b/include/mainwindow.h index 0efb157b..0a53847b 100644 --- a/include/mainwindow.h +++ b/include/mainwindow.h @@ -172,7 +172,7 @@ public: Q_INVOKABLE void setMetatileTiles(int metatileId, int tileId, bool xflip, bool yflip, int palette, int tileStart = 0, int tileEnd = -1, bool forceRedraw = true); Q_INVOKABLE int getNumTilesInMetatile(); Q_INVOKABLE int getNumMetatileLayers(); - Q_INVOKABLE int getBaseGameVersion(); + Q_INVOKABLE QString getBaseGameVersion(); Q_INVOKABLE QList getCustomScripts(); Q_INVOKABLE int getMainTab(); Q_INVOKABLE void setMainTab(int index); diff --git a/src/config.cpp b/src/config.cpp index 2bfd5439..f9597b4e 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -654,6 +654,10 @@ BaseGameVersion ProjectConfig::getBaseGameVersion() { return this->baseGameVersion; } +QString ProjectConfig::getBaseGameVersionString() { + return baseGameVersionMap.value(this->baseGameVersion); +} + void ProjectConfig::setRecentMap(const QString &map) { this->recentMap = map; this->save(); diff --git a/src/mainwindow_scriptapi.cpp b/src/mainwindow_scriptapi.cpp index 02d4747f..fd5d3ab7 100644 --- a/src/mainwindow_scriptapi.cpp +++ b/src/mainwindow_scriptapi.cpp @@ -1014,8 +1014,8 @@ int MainWindow::getNumMetatileLayers() { return projectConfig.getTripleLayerMetatilesEnabled() ? 3 : 2; } -int MainWindow::getBaseGameVersion() { - return projectConfig.getBaseGameVersion(); +QString MainWindow::getBaseGameVersion() { + return projectConfig.getBaseGameVersionString(); } QList MainWindow::getCustomScripts() {