From 4643330fdd2f458a4f714eb7ae1a586d2d24da37 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 18 Feb 2020 14:08:29 -0500 Subject: Name allow_cycling, floor_number header properties --- tools/mapjson/mapjson.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tools/mapjson/mapjson.cpp') diff --git a/tools/mapjson/mapjson.cpp b/tools/mapjson/mapjson.cpp index f4e7380b9..9f981e3e7 100644 --- a/tools/mapjson/mapjson.cpp +++ b/tools/mapjson/mapjson.cpp @@ -105,7 +105,7 @@ string generate_map_header_text(Json map_data, Json layouts_data) { << "\t.byte " << map_data["map_type"].string_value() << "\n"; if (version == "firered") - text << "\t.byte " << map_data["unknown_18"].int_value() << "\n" + text << "\t.byte " << map_data["allow_cycling"].bool_value() << "\n" << "\t.byte " << map_data["unknown_19"].int_value() << "\n"; else text << "\t.2byte 0\n"; @@ -115,13 +115,13 @@ string generate_map_header_text(Json map_data, Json layouts_data) { } else if (version == "emerald") { text << "\tmap_header_flags " - << "allow_bike=" << map_data["allow_bike"].bool_value() << ", " + << "allow_cycling=" << map_data["allow_cycling"].bool_value() << ", " << "allow_escape_rope=" << map_data["allow_escape_rope"].bool_value() << ", " << "allow_run=" << map_data["allow_running"].bool_value() << ", " << "show_map_name=" << map_data["show_map_name"].bool_value() << "\n"; } else if (version == "firered") { - text << "\t.byte " << map_data["elevator_flag"].int_value() << "\n"; + text << "\t.byte " << map_data["floor_number"].int_value() << "\n"; } text << "\t.byte " << map_data["battle_scene"].string_value() << "\n\n"; -- cgit v1.2.3 From e94f9c148358f2e25e6ebbd58d39eb9ddd27f7c3 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 18 Feb 2020 14:52:42 -0500 Subject: Name allow_escaping, allow_running, show_map_name header properties --- tools/mapjson/mapjson.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'tools/mapjson/mapjson.cpp') diff --git a/tools/mapjson/mapjson.cpp b/tools/mapjson/mapjson.cpp index 9f981e3e7..753fac11b 100644 --- a/tools/mapjson/mapjson.cpp +++ b/tools/mapjson/mapjson.cpp @@ -104,23 +104,21 @@ string generate_map_header_text(Json map_data, Json layouts_data) { << "\t.byte " << map_data["weather"].string_value() << "\n" << "\t.byte " << map_data["map_type"].string_value() << "\n"; - if (version == "firered") - text << "\t.byte " << map_data["allow_cycling"].bool_value() << "\n" - << "\t.byte " << map_data["unknown_19"].int_value() << "\n"; - else + if (version != "firered") text << "\t.2byte 0\n"; if (version == "ruby") { text << "\t.byte " << map_data["show_map_name"].bool_value() << "\n"; } - else if (version == "emerald") { + else if (version == "emerald" || version == "firered") { text << "\tmap_header_flags " << "allow_cycling=" << map_data["allow_cycling"].bool_value() << ", " - << "allow_escape_rope=" << map_data["allow_escape_rope"].bool_value() << ", " - << "allow_run=" << map_data["allow_running"].bool_value() << ", " + << "allow_escaping=" << map_data["allow_escaping"].bool_value() << ", " + << "allow_running=" << map_data["allow_running"].bool_value() << ", " << "show_map_name=" << map_data["show_map_name"].bool_value() << "\n"; } - else if (version == "firered") { + + if (version == "firered") { text << "\t.byte " << map_data["floor_number"].int_value() << "\n"; } -- cgit v1.2.3 From 2a2db28e57e78eb8861997422f998378d91bf9dc Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 18 Feb 2020 18:13:31 -0500 Subject: Split connection field from graphics id in object events --- tools/mapjson/mapjson.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'tools/mapjson/mapjson.cpp') diff --git a/tools/mapjson/mapjson.cpp b/tools/mapjson/mapjson.cpp index 753fac11b..cce690662 100644 --- a/tools/mapjson/mapjson.cpp +++ b/tools/mapjson/mapjson.cpp @@ -274,6 +274,7 @@ string generate_firered_map_events_text(Json map_data) { auto obj_event = map_data["object_events"].array_items()[i]; text << "\tobject_event " << i + 1 << ", " << obj_event["graphics_id"].string_value() << ", " + << obj_event["in_connection"].int_value() << ", " << obj_event["x"].int_value() << ", " << obj_event["y"].int_value() << ", " << obj_event["elevation"].int_value() << ", " -- cgit v1.2.3 From 3e806419156cd1b57f8c6c1b215f836b467c723a Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 18 Feb 2020 19:52:37 -0500 Subject: in_connection to bool --- tools/mapjson/mapjson.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/mapjson/mapjson.cpp') diff --git a/tools/mapjson/mapjson.cpp b/tools/mapjson/mapjson.cpp index cce690662..563ed6352 100644 --- a/tools/mapjson/mapjson.cpp +++ b/tools/mapjson/mapjson.cpp @@ -274,7 +274,7 @@ string generate_firered_map_events_text(Json map_data) { auto obj_event = map_data["object_events"].array_items()[i]; text << "\tobject_event " << i + 1 << ", " << obj_event["graphics_id"].string_value() << ", " - << obj_event["in_connection"].int_value() << ", " + << (obj_event["in_connection"].bool_value() ? 255 : 0) << ", " << obj_event["x"].int_value() << ", " << obj_event["y"].int_value() << ", " << obj_event["elevation"].int_value() << ", " -- cgit v1.2.3 From 6191739a4d01c4a83c4df721eb05b4f86c747381 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 2 Mar 2020 12:24:05 -0500 Subject: Label sign bg events --- tools/mapjson/mapjson.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'tools/mapjson/mapjson.cpp') diff --git a/tools/mapjson/mapjson.cpp b/tools/mapjson/mapjson.cpp index 563ed6352..ad3aa3769 100644 --- a/tools/mapjson/mapjson.cpp +++ b/tools/mapjson/mapjson.cpp @@ -337,7 +337,15 @@ string generate_firered_map_events_text(Json map_data) { bgs_label = map_data["name"].string_value() + "_MapBGEvents"; text << bgs_label << "::\n"; for (auto &bg_event : map_data["bg_events"].array_items()) { - if (bg_event["type"] == "hidden_item") { + if (bg_event["type"] == "sign") { + text << "\tbg_event " + << bg_event["x"].int_value() << ", " + << bg_event["y"].int_value() << ", " + << bg_event["elevation"].int_value() << ", " + << bg_event["player_facing_dir"].string_value() << ", 0," + << bg_event["script"].string_value() << "\n"; + } + else if (bg_event["type"] == "hidden_item") { text << "\tbg_hidden_item_event " << bg_event["x"].int_value() << ", " << bg_event["y"].int_value() << ", " @@ -347,17 +355,6 @@ string generate_firered_map_events_text(Json map_data) { << bg_event["quantity"].int_value() << ", " << bg_event["underfoot"].bool_value() << "\n"; } - else { - string type_string = bg_event["type"].string_value(); - type_string.erase(0, 14); - int type = std::stoi(type_string); - text << "\tbg_event " - << bg_event["x"].int_value() << ", " - << bg_event["y"].int_value() << ", " - << bg_event["elevation"].int_value() << ", " - << type << ", 0, " - << bg_event["script"].string_value() << "\n"; - } } text << "\n"; } else { -- cgit v1.2.3