Remove the reverse song constant lookup
This commit is contained in:
parent
669c81b50b
commit
d87d5e6f00
3 changed files with 1 additions and 26 deletions
|
@ -203,11 +203,7 @@ void MainWindow::displayMapProperties() {
|
||||||
|
|
||||||
QStringList songs = project->getSongNames();
|
QStringList songs = project->getSongNames();
|
||||||
ui->comboBox_Song->addItems(songs);
|
ui->comboBox_Song->addItems(songs);
|
||||||
QString song = map->song;
|
ui->comboBox_Song->setCurrentText(map->song);
|
||||||
if (!songs.contains(song)) {
|
|
||||||
song = project->getSongName(song.toInt());
|
|
||||||
}
|
|
||||||
ui->comboBox_Song->setCurrentText(song);
|
|
||||||
|
|
||||||
ui->comboBox_Location->addItems(project->getLocations());
|
ui->comboBox_Location->addItems(project->getLocations());
|
||||||
ui->comboBox_Location->setCurrentText(map->location);
|
ui->comboBox_Location->setCurrentText(map->location);
|
||||||
|
|
20
project.cpp
20
project.cpp
|
@ -1114,26 +1114,6 @@ QStringList Project::getSongNames() {
|
||||||
return names;
|
return names;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Project::getSongName(int songNumber) {
|
|
||||||
QStringList names;
|
|
||||||
QString text = readTextFile(root + "/include/constants/songs.h");
|
|
||||||
if (!text.isNull()) {
|
|
||||||
QStringList songDefinePrefixes;
|
|
||||||
songDefinePrefixes << "SE_" << "BGM_";
|
|
||||||
QMap<QString, int> songDefines = readCDefines(text, songDefinePrefixes);
|
|
||||||
|
|
||||||
// Loop through song defines, and fine the one with the matching song number.
|
|
||||||
QMap<QString, int>::iterator iter = songDefines.begin();
|
|
||||||
while (iter != songDefines.end()) {
|
|
||||||
if (iter.value() == songNumber) {
|
|
||||||
return iter.key();
|
|
||||||
}
|
|
||||||
iter++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
QMap<QString, int> Project::getMapObjGfxConstants() {
|
QMap<QString, int> Project::getMapObjGfxConstants() {
|
||||||
QMap<QString, int> constants;
|
QMap<QString, int> constants;
|
||||||
QString text = readTextFile(root + "/include/constants/map_objects.h");
|
QString text = readTextFile(root + "/include/constants/map_objects.h");
|
||||||
|
|
|
@ -69,7 +69,6 @@ public:
|
||||||
|
|
||||||
QList<QStringList>* parse(QString text);
|
QList<QStringList>* parse(QString text);
|
||||||
QStringList getSongNames();
|
QStringList getSongNames();
|
||||||
QString getSongName(int);
|
|
||||||
QStringList getLocations();
|
QStringList getLocations();
|
||||||
QStringList getVisibilities();
|
QStringList getVisibilities();
|
||||||
QStringList getWeathers();
|
QStringList getWeathers();
|
||||||
|
|
Loading…
Reference in a new issue