diff --git a/xml_converter/doc/rendering/render_on_minimap.md b/xml_converter/doc/rendering/render_on_minimap.md index 674c1ce4..989d89cb 100644 --- a/xml_converter/doc/rendering/render_on_minimap.md +++ b/xml_converter/doc/rendering/render_on_minimap.md @@ -3,7 +3,14 @@ name: Render on Minimap type: Boolean applies_to: [Icon, Trail] xml_fields: [MinimapVisibility, BHMinimapVisibility] -protobuf_field: tentative__render_on_minimap +protobuf_field: is_hidden_on_minimap +custom_functions: + read.xml: + function: inverted_xml_attribute_to_bool + side_effects: [] + write.xml: + function: bool_to_inverted_xml_attribute + side_effects: [] --- Allows or Prevents this object from being rendered on the minimap aka compass. diff --git a/xml_converter/integration_tests/test_cases/proto_is_hidden_on_minimap/input/pack/markers.bin b/xml_converter/integration_tests/test_cases/proto_is_hidden_on_minimap/input/pack/markers.bin new file mode 100644 index 00000000..c2170ee2 Binary files /dev/null and b/xml_converter/integration_tests/test_cases/proto_is_hidden_on_minimap/input/pack/markers.bin differ diff --git a/xml_converter/integration_tests/test_cases/proto_is_hidden_on_minimap/output_proto/markers.bin b/xml_converter/integration_tests/test_cases/proto_is_hidden_on_minimap/output_proto/markers.bin new file mode 100644 index 00000000..c2170ee2 Binary files /dev/null and b/xml_converter/integration_tests/test_cases/proto_is_hidden_on_minimap/output_proto/markers.bin differ diff --git a/xml_converter/integration_tests/test_cases/proto_is_hidden_on_minimap/output_xml/xml_file.xml b/xml_converter/integration_tests/test_cases/proto_is_hidden_on_minimap/output_xml/xml_file.xml new file mode 100644 index 00000000..79285a4d --- /dev/null +++ b/xml_converter/integration_tests/test_cases/proto_is_hidden_on_minimap/output_xml/xml_file.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/xml_converter/integration_tests/test_cases/proto_is_hidden_on_minimap/testcase.yaml b/xml_converter/integration_tests/test_cases/proto_is_hidden_on_minimap/testcase.yaml new file mode 100644 index 00000000..d87f4066 --- /dev/null +++ b/xml_converter/integration_tests/test_cases/proto_is_hidden_on_minimap/testcase.yaml @@ -0,0 +1,5 @@ +input_paths: + "pack": "proto" +expected_stdout: | +expected_stderr: | +expected_returncode: 0 diff --git a/xml_converter/integration_tests/test_cases/xml_render_on_minimap/input/pack/xml_file.xml b/xml_converter/integration_tests/test_cases/xml_render_on_minimap/input/pack/xml_file.xml new file mode 100644 index 00000000..091c4bf7 --- /dev/null +++ b/xml_converter/integration_tests/test_cases/xml_render_on_minimap/input/pack/xml_file.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xml_converter/integration_tests/test_cases/xml_render_on_minimap/output_proto/markers.bin b/xml_converter/integration_tests/test_cases/xml_render_on_minimap/output_proto/markers.bin new file mode 100644 index 00000000..d121f97b Binary files /dev/null and b/xml_converter/integration_tests/test_cases/xml_render_on_minimap/output_proto/markers.bin differ diff --git a/xml_converter/integration_tests/test_cases/xml_render_on_minimap/output_xml/xml_file.xml b/xml_converter/integration_tests/test_cases/xml_render_on_minimap/output_xml/xml_file.xml new file mode 100644 index 00000000..0109447b --- /dev/null +++ b/xml_converter/integration_tests/test_cases/xml_render_on_minimap/output_xml/xml_file.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xml_converter/integration_tests/test_cases/xml_render_on_minimap/testcase.yaml b/xml_converter/integration_tests/test_cases/xml_render_on_minimap/testcase.yaml new file mode 100644 index 00000000..9510c793 --- /dev/null +++ b/xml_converter/integration_tests/test_cases/xml_render_on_minimap/testcase.yaml @@ -0,0 +1,5 @@ +input_paths: + "pack": "xml" +expected_stdout: | +expected_stderr: | +expected_returncode: 0 diff --git a/xml_converter/proto/waypoint.proto b/xml_converter/proto/waypoint.proto index 756db767..fec043c6 100644 --- a/xml_converter/proto/waypoint.proto +++ b/xml_converter/proto/waypoint.proto @@ -57,9 +57,9 @@ message Icon { CullChirality cull_chirality = 33; bool is_hidden_ingame = 34; bool is_hidden_on_map = 35; + bool is_hidden_on_minimap = 36; float tentative__scale = 2048; - bool tentative__render_on_minimap = 2051; string bhdraft__schedule = 2052; float bhdraft__schedule_duration = 2053; } @@ -89,8 +89,8 @@ message Trail { CullChirality cull_chirality = 30; bool is_hidden_ingame = 31; bool is_hidden_on_map = 32; + bool is_hidden_on_minimap = 33; - bool tentative__render_on_minimap = 2051; string bhdraft__schedule = 2052; float bhdraft__schedule_duration = 2053; } diff --git a/xml_converter/src/icon_gen.cpp b/xml_converter/src/icon_gen.cpp index d5ea2e04..a74ab840 100644 --- a/xml_converter/src/icon_gen.cpp +++ b/xml_converter/src/icon_gen.cpp @@ -194,10 +194,10 @@ bool Icon::init_xml_attribute(rapidxml::xml_attribute<>* attribute, vectorrender_on_map), &(this->render_on_map_is_set)); } else if (attributename == "minimapvisibility") { - xml_attribute_to_bool(attribute, errors, state, &(this->render_on_minimap), &(this->render_on_minimap_is_set)); + inverted_xml_attribute_to_bool(attribute, errors, state, &(this->render_on_minimap), &(this->render_on_minimap_is_set)); } else if (attributename == "bhminimapvisibility") { - xml_attribute_to_bool(attribute, errors, state, &(this->render_on_minimap), &(this->render_on_minimap_is_set)); + inverted_xml_attribute_to_bool(attribute, errors, state, &(this->render_on_minimap), &(this->render_on_minimap_is_set)); } else if (attributename == "behavior") { xml_attribute_to_reset_behavior(attribute, errors, state, &(this->reset_behavior), &(this->reset_behavior_is_set)); @@ -370,7 +370,7 @@ vector Icon::as_xml(XMLWriterState* state) const { xml_node_contents.push_back(bool_to_inverted_xml_attribute("MapVisibility", state, &this->render_on_map)); } if (this->render_on_minimap_is_set) { - xml_node_contents.push_back(bool_to_xml_attribute("MinimapVisibility", state, &this->render_on_minimap)); + xml_node_contents.push_back(bool_to_inverted_xml_attribute("MinimapVisibility", state, &this->render_on_minimap)); } if (this->reset_behavior_is_set) { xml_node_contents.push_back(reset_behavior_to_xml_attribute("Behavior", state, &this->reset_behavior)); @@ -548,7 +548,7 @@ waypoint::Icon Icon::as_protobuf(ProtoWriterState* state) const { bool_to_proto(this->render_on_map, state, setter); } if (this->render_on_minimap_is_set) { - std::function setter = [&proto_icon](bool val) { proto_icon.set_tentative__render_on_minimap(val); }; + std::function setter = [&proto_icon](bool val) { proto_icon.set_is_hidden_on_minimap(val); }; bool_to_proto(this->render_on_minimap, state, setter); } if (this->reset_behavior_is_set) { @@ -701,8 +701,8 @@ void Icon::parse_protobuf(waypoint::Icon proto_icon, ProtoReaderState* state) { if (proto_icon.is_hidden_on_map() != 0) { proto_to_bool(proto_icon.is_hidden_on_map(), state, &(this->render_on_map), &(this->render_on_map_is_set)); } - if (proto_icon.tentative__render_on_minimap() != 0) { - proto_to_bool(proto_icon.tentative__render_on_minimap(), state, &(this->render_on_minimap), &(this->render_on_minimap_is_set)); + if (proto_icon.is_hidden_on_minimap() != 0) { + proto_to_bool(proto_icon.is_hidden_on_minimap(), state, &(this->render_on_minimap), &(this->render_on_minimap_is_set)); } if (proto_icon.trigger().reset_behavior() != 0) { proto_to_reset_behavior(proto_icon.trigger().reset_behavior(), state, &(this->reset_behavior), &(this->reset_behavior_is_set)); diff --git a/xml_converter/src/trail_gen.cpp b/xml_converter/src/trail_gen.cpp index 67fc2568..a8e45ad7 100644 --- a/xml_converter/src/trail_gen.cpp +++ b/xml_converter/src/trail_gen.cpp @@ -116,10 +116,10 @@ bool Trail::init_xml_attribute(rapidxml::xml_attribute<>* attribute, vectorrender_on_map), &(this->render_on_map_is_set)); } else if (attributename == "minimapvisibility") { - xml_attribute_to_bool(attribute, errors, state, &(this->render_on_minimap), &(this->render_on_minimap_is_set)); + inverted_xml_attribute_to_bool(attribute, errors, state, &(this->render_on_minimap), &(this->render_on_minimap_is_set)); } else if (attributename == "bhminimapvisibility") { - xml_attribute_to_bool(attribute, errors, state, &(this->render_on_minimap), &(this->render_on_minimap_is_set)); + inverted_xml_attribute_to_bool(attribute, errors, state, &(this->render_on_minimap), &(this->render_on_minimap_is_set)); } else if (attributename == "schedule") { xml_attribute_to_string(attribute, errors, state, &(this->schedule), &(this->schedule_is_set)); @@ -220,7 +220,7 @@ vector Trail::as_xml(XMLWriterState* state) const { xml_node_contents.push_back(bool_to_inverted_xml_attribute("MapVisibility", state, &this->render_on_map)); } if (this->render_on_minimap_is_set) { - xml_node_contents.push_back(bool_to_xml_attribute("MinimapVisibility", state, &this->render_on_minimap)); + xml_node_contents.push_back(bool_to_inverted_xml_attribute("MinimapVisibility", state, &this->render_on_minimap)); } if (this->schedule_is_set) { xml_node_contents.push_back(string_to_xml_attribute("Schedule", state, &this->schedule)); @@ -322,7 +322,7 @@ waypoint::Trail Trail::as_protobuf(ProtoWriterState* state) const { bool_to_proto(this->render_on_map, state, setter); } if (this->render_on_minimap_is_set) { - std::function setter = [&proto_trail](bool val) { proto_trail.set_tentative__render_on_minimap(val); }; + std::function setter = [&proto_trail](bool val) { proto_trail.set_is_hidden_on_minimap(val); }; bool_to_proto(this->render_on_minimap, state, setter); } if (this->schedule_is_set) { @@ -411,8 +411,8 @@ void Trail::parse_protobuf(waypoint::Trail proto_trail, ProtoReaderState* state) if (proto_trail.is_hidden_on_map() != 0) { proto_to_bool(proto_trail.is_hidden_on_map(), state, &(this->render_on_map), &(this->render_on_map_is_set)); } - if (proto_trail.tentative__render_on_minimap() != 0) { - proto_to_bool(proto_trail.tentative__render_on_minimap(), state, &(this->render_on_minimap), &(this->render_on_minimap_is_set)); + if (proto_trail.is_hidden_on_minimap() != 0) { + proto_to_bool(proto_trail.is_hidden_on_minimap(), state, &(this->render_on_minimap), &(this->render_on_minimap_is_set)); } if (proto_trail.bhdraft__schedule() != "") { proto_to_string(proto_trail.bhdraft__schedule(), state, &(this->schedule), &(this->schedule_is_set));