|
|
@@ -1152,17 +1152,17 @@ void Project::loadEventPixmaps(QList<Event*> objects) {
|
|
1152
|
1152
|
continue;
|
|
1153
|
1153
|
}
|
|
1154
|
1154
|
QString event_type = object->get("event_type");
|
|
1155
|
|
- if (event_type == "object") {
|
|
|
1155
|
+ if (event_type == EventType::Object) {
|
|
1156
|
1156
|
object->pixmap = QPixmap(":/images/Entities_16x16.png").copy(0, 0, 16, 16);
|
|
1157
|
|
- } else if (event_type == "warp") {
|
|
|
1157
|
+ } else if (event_type == EventType::Warp) {
|
|
1158
|
1158
|
object->pixmap = QPixmap(":/images/Entities_16x16.png").copy(16, 0, 16, 16);
|
|
1159
|
|
- } else if (event_type == "trap" || event_type == "trap_weather") {
|
|
|
1159
|
+ } else if (event_type == EventType::CoordScript || event_type == EventType::CoordWeather) {
|
|
1160
|
1160
|
object->pixmap = QPixmap(":/images/Entities_16x16.png").copy(32, 0, 16, 16);
|
|
1161
|
|
- } else if (event_type == "sign" || event_type == "event_hidden_item" || event_type == "event_secret_base") {
|
|
|
1161
|
+ } else if (event_type == EventType::Sign || event_type == EventType::HiddenItem || event_type == EventType::SecretBase) {
|
|
1162
|
1162
|
object->pixmap = QPixmap(":/images/Entities_16x16.png").copy(48, 0, 16, 16);
|
|
1163
|
1163
|
}
|
|
1164
|
1164
|
|
|
1165
|
|
- if (event_type == "object") {
|
|
|
1165
|
+ if (event_type == EventType::Object) {
|
|
1166
|
1166
|
int sprite_id = constants.value(object->get("sprite"));
|
|
1167
|
1167
|
|
|
1168
|
1168
|
QString info_label = pointers.value(sprite_id).replace("&", "");
|
|
|
@@ -1178,10 +1178,8 @@ void Project::loadEventPixmaps(QList<Event*> objects) {
|
|
1178
|
1178
|
object->pixmap = pixmap;
|
|
1179
|
1179
|
}
|
|
1180
|
1180
|
}
|
|
1181
|
|
-
|
|
1182
|
1181
|
}
|
|
1183
|
1182
|
}
|
|
1184
|
|
-
|
|
1185
|
1183
|
}
|
|
1186
|
1184
|
|
|
1187
|
1185
|
void Project::saveMapEvents(Map *map) {
|
|
|
@@ -1331,7 +1329,7 @@ void Project::readMapEvents(Map *map) {
|
|
1331
|
1329
|
object->put("script_label", command.value(i++));
|
|
1332
|
1330
|
object->put("event_flag", command.value(i++));
|
|
1333
|
1331
|
|
|
1334
|
|
- object->put("event_type", "object");
|
|
|
1332
|
+ object->put("event_type", EventType::Object);
|
|
1335
|
1333
|
map->events["object"].append(object);
|
|
1336
|
1334
|
}
|
|
1337
|
1335
|
}
|
|
|
@@ -1352,7 +1350,7 @@ void Project::readMapEvents(Map *map) {
|
|
1352
|
1350
|
QString mapConstant = command.value(i++);
|
|
1353
|
1351
|
if (mapConstantsToMapNames->contains(mapConstant)) {
|
|
1354
|
1352
|
warp->put("destination_map_name", mapConstantsToMapNames->value(mapConstant));
|
|
1355
|
|
- warp->put("event_type", "warp");
|
|
|
1353
|
+ warp->put("event_type", EventType::Warp);
|
|
1356
|
1354
|
map->events["warp"].append(warp);
|
|
1357
|
1355
|
} else {
|
|
1358
|
1356
|
qDebug() << QString("Destination map constant '%1' is invalid for warp").arg(mapConstant);
|
|
|
@@ -1383,7 +1381,7 @@ void Project::readMapEvents(Map *map) {
|
|
1383
|
1381
|
//coord_unknown3
|
|
1384
|
1382
|
//coord_unknown4
|
|
1385
|
1383
|
|
|
1386
|
|
- coord->put("event_type", "trap");
|
|
|
1384
|
+ coord->put("event_type", EventType::CoordScript);
|
|
1387
|
1385
|
map->events["trap"].append(coord);
|
|
1388
|
1386
|
} else if (command.value(0) == "coord_weather_event") {
|
|
1389
|
1387
|
Event *coord = new Event;
|
|
|
@@ -1393,7 +1391,7 @@ void Project::readMapEvents(Map *map) {
|
|
1393
|
1391
|
coord->put("y", command.value(i++));
|
|
1394
|
1392
|
coord->put("elevation", command.value(i++));
|
|
1395
|
1393
|
coord->put("weather", command.value(i++));
|
|
1396
|
|
- coord->put("event_type", "trap_weather");
|
|
|
1394
|
+ coord->put("event_type", EventType::CoordWeather);
|
|
1397
|
1395
|
map->events["trap_weather"].append(coord);
|
|
1398
|
1396
|
}
|
|
1399
|
1397
|
}
|
|
|
@@ -1414,7 +1412,7 @@ void Project::readMapEvents(Map *map) {
|
|
1414
|
1412
|
i++;
|
|
1415
|
1413
|
bg->put("script_label", command.value(i++));
|
|
1416
|
1414
|
//sign_unknown7
|
|
1417
|
|
- bg->put("event_type", "sign");
|
|
|
1415
|
+ bg->put("event_type", EventType::Sign);
|
|
1418
|
1416
|
map->events["sign"].append(bg);
|
|
1419
|
1417
|
} else if (command.value(0) == "bg_hidden_item_event") {
|
|
1420
|
1418
|
Event *bg = new Event;
|
|
|
@@ -1425,7 +1423,7 @@ void Project::readMapEvents(Map *map) {
|
|
1425
|
1423
|
bg->put("elevation", command.value(i++));
|
|
1426
|
1424
|
bg->put("item", command.value(i++));
|
|
1427
|
1425
|
bg->put("flag", command.value(i++));
|
|
1428
|
|
- bg->put("event_type", "event_hidden_item");
|
|
|
1426
|
+ bg->put("event_type", EventType::HiddenItem);
|
|
1429
|
1427
|
map->events["event_hidden_item"].append(bg);
|
|
1430
|
1428
|
} else if (command.value(0) == "bg_secret_base_event") {
|
|
1431
|
1429
|
Event *bg = new Event;
|
|
|
@@ -1435,7 +1433,7 @@ void Project::readMapEvents(Map *map) {
|
|
1435
|
1433
|
bg->put("y", command.value(i++));
|
|
1436
|
1434
|
bg->put("elevation", command.value(i++));
|
|
1437
|
1435
|
bg->put("secret_base_map", command.value(i++));
|
|
1438
|
|
- bg->put("event_type", "event_secret_base");
|
|
|
1436
|
+ bg->put("event_type", EventType::SecretBase);
|
|
1439
|
1437
|
map->events["event_secret_base"].append(bg);
|
|
1440
|
1438
|
}
|
|
1441
|
1439
|
}
|