Properly read dynamically-set warps that use MAP_NONE as their destination
This commit is contained in:
parent
a2d95bfc72
commit
b3a30c91ae
3 changed files with 16 additions and 1 deletions
|
@ -1700,7 +1700,10 @@ void DraggablePixmapItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *) {
|
|||
|
||||
void DraggablePixmapItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *) {
|
||||
if (this->event->get("event_type") == EventType::Warp) {
|
||||
emit editor->warpEventDoubleClicked(this->event->get("destination_map_name"), this->event->get("destination_warp"));
|
||||
QString destMap = this->event->get("destination_map_name");
|
||||
if (destMap != NONE_MAP_NAME) {
|
||||
emit editor->warpEventDoubleClicked(this->event->get("destination_map_name"), this->event->get("destination_warp"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1010,6 +1010,10 @@ void Project::readMapGroups() {
|
|||
}
|
||||
}
|
||||
|
||||
mapConstantsToMapNames->insert(NONE_MAP_CONSTANT, NONE_MAP_NAME);
|
||||
mapNamesToMapConstants->insert(NONE_MAP_NAME, NONE_MAP_CONSTANT);
|
||||
maps->append(NONE_MAP_NAME);
|
||||
|
||||
groupNames = groups;
|
||||
groupedMapNames = groupedMaps;
|
||||
mapNames = maps;
|
||||
|
@ -1473,6 +1477,11 @@ void Project::readMapEvents(Map *map) {
|
|||
warp->put("event_group_type", "warp_event_group");
|
||||
warp->put("event_type", EventType::Warp);
|
||||
map->events["warp_event_group"].append(warp);
|
||||
} else if (mapConstant == NONE_MAP_CONSTANT) {
|
||||
warp->put("destination_map_name", NONE_MAP_NAME);
|
||||
warp->put("event_group_type", "warp_event_group");
|
||||
warp->put("event_type", EventType::Warp);
|
||||
map->events["warp_event_group"].append(warp);
|
||||
} else {
|
||||
qDebug() << QString("Destination map constant '%1' is invalid for warp").arg(mapConstant);
|
||||
}
|
||||
|
|
|
@ -9,6 +9,9 @@
|
|||
#include <QList>
|
||||
#include <QStandardItem>
|
||||
|
||||
static QString NONE_MAP_CONSTANT = "MAP_NONE";
|
||||
static QString NONE_MAP_NAME = "None";
|
||||
|
||||
class Project
|
||||
{
|
||||
public:
|
||||
|
|
Loading…
Reference in a new issue