mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-13 20:36:19 -05:00
Support bg_hidden_item_event
This commit is contained in:
45
project.cpp
45
project.cpp
@@ -667,7 +667,7 @@ void Project::loadObjectPixmaps(QList<Event*> objects) {
|
||||
object->pixmap = QPixmap(":/images/Entities_16x16.png").copy(16, 0, 16, 16);
|
||||
} else if (event_type == "trap" || event_type == "trap_weather") {
|
||||
object->pixmap = QPixmap(":/images/Entities_16x16.png").copy(32, 0, 16, 16);
|
||||
} else if (event_type == "sign" || event_type == "hidden item") {
|
||||
} else if (event_type == "sign" || event_type == "event_hidden_item") {
|
||||
object->pixmap = QPixmap(":/images/Entities_16x16.png").copy(48, 0, 16, 16);
|
||||
}
|
||||
|
||||
@@ -768,7 +768,7 @@ void Project::saveMapEvents(Map *map) {
|
||||
text += "\n";
|
||||
}
|
||||
|
||||
if (map->events["sign"].length() + map->events["hidden item"].length() > 0) {
|
||||
if (map->events["sign"].length() + map->events["event_hidden_item"].length() > 0) {
|
||||
text += QString("%1::\n").arg(map->bg_events_label);
|
||||
for (Event *sign : map->events["sign"]) {
|
||||
text += QString("\tbg_event %1").arg(sign->get("x"));
|
||||
@@ -779,15 +779,12 @@ void Project::saveMapEvents(Map *map) {
|
||||
text += QString(", %1").arg(sign->get("script_label"));
|
||||
text += "\n";
|
||||
}
|
||||
for (Event *item : map->events["hidden item"]) {
|
||||
text += QString("\tbg_event %1").arg(item->get("x"));
|
||||
for (Event *item : map->events["event_hidden_item"]) {
|
||||
text += QString("\tbg_hidden_item_event %1").arg(item->get("x"));
|
||||
text += QString(", %1").arg(item->get("y"));
|
||||
text += QString(", %1").arg(item->get("elevation"));
|
||||
text += QString(", %1").arg(item->get("type"));
|
||||
text += QString(", 0");
|
||||
text += QString(", %1").arg(item->get("item"));
|
||||
text += QString(", %1").arg(item->get("item_unknown5"));
|
||||
text += QString(", %1").arg(item->get("item_unknown6"));
|
||||
text += QString(", %1").arg(item->get("flag"));
|
||||
text += "\n";
|
||||
}
|
||||
text += "\n";
|
||||
@@ -924,7 +921,7 @@ void Project::readMapEvents(Map *map) {
|
||||
}
|
||||
|
||||
QList<QStringList> *bgs = getLabelMacros(parse(text), map->bg_events_label);
|
||||
map->events["hidden item"].clear();
|
||||
map->events["event_hidden_item"].clear();
|
||||
map->events["sign"].clear();
|
||||
for (QStringList command : *bgs) {
|
||||
if (command.value(0) == "bg_event") {
|
||||
@@ -936,23 +933,23 @@ void Project::readMapEvents(Map *map) {
|
||||
bg->put("elevation", command.value(i++));
|
||||
bg->put("type", command.value(i++));
|
||||
i++;
|
||||
if (bg->is_hidden_item()) {
|
||||
bg->put("item", command.value(i++));
|
||||
bg->put("item_unknown5", command.value(i++));
|
||||
bg->put("item_unknown6", command.value(i++));
|
||||
|
||||
bg->put("event_type", "hidden item");
|
||||
map->events["hidden item"].append(bg);
|
||||
} else {
|
||||
bg->put("script_label", command.value(i++));
|
||||
//sign_unknown7
|
||||
|
||||
bg->put("event_type", "sign");
|
||||
map->events["sign"].append(bg);
|
||||
}
|
||||
bg->put("script_label", command.value(i++));
|
||||
//sign_unknown7
|
||||
bg->put("event_type", "sign");
|
||||
map->events["sign"].append(bg);
|
||||
} else if (command.value(0) == "bg_hidden_item_event") {
|
||||
Event *bg = new Event;
|
||||
bg->put("map_name", map->name);
|
||||
int i = 1;
|
||||
bg->put("x", command.value(i++));
|
||||
bg->put("y", command.value(i++));
|
||||
bg->put("elevation", command.value(i++));
|
||||
bg->put("item", command.value(i++));
|
||||
bg->put("flag", command.value(i++));
|
||||
bg->put("event_type", "event_hidden_item");
|
||||
map->events["event_hidden_item"].append(bg);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
QStringList Project::readCArray(QString text, QString label) {
|
||||
|
||||
Reference in New Issue
Block a user