|
@@ -665,7 +665,7 @@ void Project::loadObjectPixmaps(QList<Event*> objects) {
|
665
|
665
|
object->pixmap = QPixmap(":/images/Entities_16x16.png").copy(0, 0, 16, 16);
|
666
|
666
|
} else if (event_type == "warp") {
|
667
|
667
|
object->pixmap = QPixmap(":/images/Entities_16x16.png").copy(16, 0, 16, 16);
|
668
|
|
- } else if (event_type == "trap") {
|
|
668
|
+ } else if (event_type == "trap" || event_type == "trap_weather") {
|
669
|
669
|
object->pixmap = QPixmap(":/images/Entities_16x16.png").copy(32, 0, 16, 16);
|
670
|
670
|
} else if (event_type == "sign" || event_type == "hidden item") {
|
671
|
671
|
object->pixmap = QPixmap(":/images/Entities_16x16.png").copy(48, 0, 16, 16);
|
|
@@ -745,7 +745,7 @@ void Project::saveMapEvents(Map *map) {
|
745
|
745
|
text += "\n";
|
746
|
746
|
}
|
747
|
747
|
|
748
|
|
- if (map->events["trap"].length() > 0) {
|
|
748
|
+ if (map->events["trap"].length() + map->events["trap_weather"].length() > 0) {
|
749
|
749
|
text += QString("%1::\n").arg(map->coord_events_label);
|
750
|
750
|
for (Event *coords : map->events["trap"]) {
|
751
|
751
|
text += QString("\tcoord_event %1").arg(coords->get("x"));
|
|
@@ -758,6 +758,13 @@ void Project::saveMapEvents(Map *map) {
|
758
|
758
|
text += QString(", %1").arg(coords->get("script_label"));
|
759
|
759
|
text += "\n";
|
760
|
760
|
}
|
|
761
|
+ for (Event *coords : map->events["trap_weather"]) {
|
|
762
|
+ text += QString("\tcoord_weather_event %1").arg(coords->get("x"));
|
|
763
|
+ text += QString(", %1").arg(coords->get("y"));
|
|
764
|
+ text += QString(", %1").arg(coords->get("elevation"));
|
|
765
|
+ text += QString(", %1").arg(coords->get("weather"));
|
|
766
|
+ text += "\n";
|
|
767
|
+ }
|
761
|
768
|
text += "\n";
|
762
|
769
|
}
|
763
|
770
|
|
|
@@ -880,6 +887,7 @@ void Project::readMapEvents(Map *map) {
|
880
|
887
|
|
881
|
888
|
QList<QStringList> *coords = getLabelMacros(parse(text), map->coord_events_label);
|
882
|
889
|
map->events["trap"].clear();
|
|
890
|
+ map->events["trap_weather"].clear();
|
883
|
891
|
for (QStringList command : *coords) {
|
884
|
892
|
if (command.value(0) == "coord_event") {
|
885
|
893
|
Event *coord = new Event;
|
|
@@ -902,6 +910,16 @@ void Project::readMapEvents(Map *map) {
|
902
|
910
|
|
903
|
911
|
coord->put("event_type", "trap");
|
904
|
912
|
map->events["trap"].append(coord);
|
|
913
|
+ } else if (command.value(0) == "coord_weather_event") {
|
|
914
|
+ Event *coord = new Event;
|
|
915
|
+ coord->put("map_name", map->name);
|
|
916
|
+ int i = 1;
|
|
917
|
+ coord->put("x", command.value(i++));
|
|
918
|
+ coord->put("y", command.value(i++));
|
|
919
|
+ coord->put("elevation", command.value(i++));
|
|
920
|
+ coord->put("weather", command.value(i++));
|
|
921
|
+ coord->put("event_type", "trap_weather");
|
|
922
|
+ map->events["trap_weather"].append(coord);
|
905
|
923
|
}
|
906
|
924
|
}
|
907
|
925
|
|