|
@@ -20,6 +20,10 @@ Project::Project()
|
20
|
20
|
itemNames = new QStringList;
|
21
|
21
|
flagNames = new QStringList;
|
22
|
22
|
varNames = new QStringList;
|
|
23
|
+ movementTypes = new QStringList;
|
|
24
|
+ coordEventWeatherNames = new QStringList;
|
|
25
|
+ secretBaseIds = new QStringList;
|
|
26
|
+ bgEventFacingDirections = new QStringList;
|
23
|
27
|
map_cache = new QMap<QString, Map*>;
|
24
|
28
|
mapConstantsToMapNames = new QMap<QString, QString>;
|
25
|
29
|
mapNamesToMapConstants = new QMap<QString, QString>;
|
|
@@ -1086,6 +1090,30 @@ void Project::readVarNames() {
|
1086
|
1090
|
readCDefinesSorted(filepath, prefixes, varNames);
|
1087
|
1091
|
}
|
1088
|
1092
|
|
|
1093
|
+void Project::readMovementTypes() {
|
|
1094
|
+ QString filepath = root + "/include/constants/event_object_movement_constants.h";
|
|
1095
|
+ QStringList prefixes = (QStringList() << "MOVEMENT_TYPE_");
|
|
1096
|
+ readCDefinesSorted(filepath, prefixes, movementTypes);
|
|
1097
|
+}
|
|
1098
|
+
|
|
1099
|
+void Project::readCoordEventWeatherNames() {
|
|
1100
|
+ QString filepath = root + "/include/constants/weather.h";
|
|
1101
|
+ QStringList prefixes = (QStringList() << "COORD_EVENT_WEATHER_");
|
|
1102
|
+ readCDefinesSorted(filepath, prefixes, coordEventWeatherNames);
|
|
1103
|
+}
|
|
1104
|
+
|
|
1105
|
+void Project::readSecretBaseIds() {
|
|
1106
|
+ QString filepath = root + "/include/constants/secret_bases.h";
|
|
1107
|
+ QStringList prefixes = (QStringList() << "SECRET_BASE_");
|
|
1108
|
+ readCDefinesSorted(filepath, prefixes, secretBaseIds);
|
|
1109
|
+}
|
|
1110
|
+
|
|
1111
|
+void Project::readBgEventFacingDirections() {
|
|
1112
|
+ QString filepath = root + "/include/constants/bg_event_constants.h";
|
|
1113
|
+ QStringList prefixes = (QStringList() << "BG_EVENT_PLAYER_FACING_");
|
|
1114
|
+ readCDefinesSorted(filepath, prefixes, bgEventFacingDirections);
|
|
1115
|
+}
|
|
1116
|
+
|
1089
|
1117
|
void Project::readCDefinesSorted(QString filepath, QStringList prefixes, QStringList* definesToSet) {
|
1090
|
1118
|
QString text = readTextFile(filepath);
|
1091
|
1119
|
if (!text.isNull()) {
|
|
@@ -1098,6 +1126,8 @@ void Project::readCDefinesSorted(QString filepath, QStringList prefixes, QString
|
1098
|
1126
|
definesInverse.insert(defines[defineName], defineName);
|
1099
|
1127
|
}
|
1100
|
1128
|
*definesToSet = definesInverse.values();
|
|
1129
|
+ } else {
|
|
1130
|
+ qDebug() << "Failed to read C defines file: " << filepath;
|
1101
|
1131
|
}
|
1102
|
1132
|
}
|
1103
|
1133
|
|
|
@@ -1319,7 +1349,7 @@ void Project::readMapEvents(Map *map) {
|
1319
|
1349
|
object->put("x", command.value(i++).toInt(nullptr, 0));
|
1320
|
1350
|
object->put("y", command.value(i++).toInt(nullptr, 0));
|
1321
|
1351
|
object->put("elevation", command.value(i++));
|
1322
|
|
- object->put("behavior", command.value(i++));
|
|
1352
|
+ object->put("movement_type", command.value(i++));
|
1323
|
1353
|
object->put("radius_x", command.value(i++).toInt(nullptr, 0));
|
1324
|
1354
|
object->put("radius_y", command.value(i++).toInt(nullptr, 0));
|
1325
|
1355
|
object->put("trainer_see_type", command.value(i++));
|
|
@@ -1363,12 +1393,6 @@ void Project::readMapEvents(Map *map) {
|
1363
|
1393
|
if (command.value(0) == "coord_event") {
|
1364
|
1394
|
Event *coord = new Event;
|
1365
|
1395
|
coord->put("map_name", map->name);
|
1366
|
|
- bool old_macro = false;
|
1367
|
|
- if (command.length() >= 9) {
|
1368
|
|
- command.removeAt(7);
|
1369
|
|
- command.removeAt(4);
|
1370
|
|
- old_macro = true;
|
1371
|
|
- }
|
1372
|
1396
|
int i = 1;
|
1373
|
1397
|
coord->put("x", command.value(i++));
|
1374
|
1398
|
coord->put("y", command.value(i++));
|
|
@@ -1376,9 +1400,6 @@ void Project::readMapEvents(Map *map) {
|
1376
|
1400
|
coord->put("script_var", command.value(i++));
|
1377
|
1401
|
coord->put("script_var_value", command.value(i++));
|
1378
|
1402
|
coord->put("script_label", command.value(i++));
|
1379
|
|
- //coord_unknown3
|
1380
|
|
- //coord_unknown4
|
1381
|
|
-
|
1382
|
1403
|
coord->put("event_group_type", "coord_event_group");
|
1383
|
1404
|
coord->put("event_type", EventType::CoordScript);
|
1384
|
1405
|
map->events["coord_event_group"].append(coord);
|
|
@@ -1407,7 +1428,6 @@ void Project::readMapEvents(Map *map) {
|
1407
|
1428
|
bg->put("y", command.value(i++));
|
1408
|
1429
|
bg->put("elevation", command.value(i++));
|
1409
|
1430
|
bg->put("player_facing_direction", command.value(i++));
|
1410
|
|
- i++;
|
1411
|
1431
|
bg->put("script_label", command.value(i++));
|
1412
|
1432
|
//sign_unknown7
|
1413
|
1433
|
bg->put("event_group_type", "bg_event_group");
|
|
@@ -1432,7 +1452,7 @@ void Project::readMapEvents(Map *map) {
|
1432
|
1452
|
bg->put("x", command.value(i++));
|
1433
|
1453
|
bg->put("y", command.value(i++));
|
1434
|
1454
|
bg->put("elevation", command.value(i++));
|
1435
|
|
- bg->put("secret_base_map", command.value(i++));
|
|
1455
|
+ bg->put("secret_base_id", command.value(i++));
|
1436
|
1456
|
bg->put("event_group_type", "bg_event_group");
|
1437
|
1457
|
bg->put("event_type", EventType::SecretBase);
|
1438
|
1458
|
map->events["bg_event_group"].append(bg);
|