|
@@ -18,6 +18,7 @@ Project::Project()
|
18
|
18
|
groupNames = new QStringList;
|
19
|
19
|
map_groups = new QMap<QString, int>;
|
20
|
20
|
mapNames = new QStringList;
|
|
21
|
+ itemNames = new QStringList;
|
21
|
22
|
map_cache = new QMap<QString, Map*>;
|
22
|
23
|
mapConstantsToMapNames = new QMap<QString, QString>;
|
23
|
24
|
mapNamesToMapConstants = new QMap<QString, QString>;
|
|
@@ -1062,6 +1063,29 @@ QStringList Project::getBattleScenes() {
|
1062
|
1063
|
return names;
|
1063
|
1064
|
}
|
1064
|
1065
|
|
|
1066
|
+void Project::readItemNames() {
|
|
1067
|
+ QString text = readTextFile(root + "/include/constants/items.h");
|
|
1068
|
+ if (!text.isNull()) {
|
|
1069
|
+ QStringList itemDefinePrefixes;
|
|
1070
|
+ itemDefinePrefixes << "ITEM_";
|
|
1071
|
+ QMap<QString, int> itemDefines = readCDefines(text, itemDefinePrefixes);
|
|
1072
|
+
|
|
1073
|
+ // The item names should to be sorted by their underlying value, not alphabetically.
|
|
1074
|
+ // Reverse the map and read out the resulting keys in order.
|
|
1075
|
+ QMultiMap<int, QString> itemDefinesInverse;
|
|
1076
|
+ for (QString itemName : itemDefines.keys()) {
|
|
1077
|
+ itemDefinesInverse.insert(itemDefines[itemName], itemName);
|
|
1078
|
+ }
|
|
1079
|
+
|
|
1080
|
+ for (int itemValue : itemDefinesInverse.keys()) {
|
|
1081
|
+ QList<QString> names = itemDefinesInverse.values(itemValue);
|
|
1082
|
+ for (QString name : names) {
|
|
1083
|
+ itemNames->append(name);
|
|
1084
|
+ }
|
|
1085
|
+ }
|
|
1086
|
+ }
|
|
1087
|
+}
|
|
1088
|
+
|
1065
|
1089
|
QStringList Project::getSongNames() {
|
1066
|
1090
|
QStringList names;
|
1067
|
1091
|
QString text = readTextFile(root + "/include/constants/songs.h");
|