From b107b5d3d3debb8645eb2380c9b30c41b8d725d8 Mon Sep 17 00:00:00 2001 From: klingbolt Date: Tue, 10 Sep 2024 19:37:00 -0400 Subject: [PATCH 1/5] Changed render in game to is_hidden_ingame --- xml_converter/doc/rendering/render_ingame.md | 12 +++++++++--- .../proto_is_hidden_ingame/input/pack/markers.bin | 3 +++ .../output_proto/markers.bin | 3 +++ .../output_xml/xml_file.xml | 15 +++++++++++++++ .../proto_is_hidden_ingame/testcase.yaml | 5 +++++ .../xml_render_ingame/input/pack/xml_file.xml | 15 +++++++++++++++ .../xml_render_ingame/output_proto/markers.bin | 3 +++ .../xml_render_ingame/output_xml/xml_file.xml | 15 +++++++++++++++ .../test_cases/xml_render_ingame/testcase.yaml | 5 +++++ xml_converter/proto/waypoint.proto | 4 ++-- xml_converter/src/icon_gen.cpp | 12 ++++++------ xml_converter/src/trail_gen.cpp | 12 ++++++------ 12 files changed, 87 insertions(+), 17 deletions(-) create mode 100644 xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/input/pack/markers.bin create mode 100644 xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/output_proto/markers.bin create mode 100644 xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/output_xml/xml_file.xml create mode 100644 xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/testcase.yaml create mode 100644 xml_converter/integration_tests/test_cases/xml_render_ingame/input/pack/xml_file.xml create mode 100644 xml_converter/integration_tests/test_cases/xml_render_ingame/output_proto/markers.bin create mode 100644 xml_converter/integration_tests/test_cases/xml_render_ingame/output_xml/xml_file.xml create mode 100644 xml_converter/integration_tests/test_cases/xml_render_ingame/testcase.yaml diff --git a/xml_converter/doc/rendering/render_ingame.md b/xml_converter/doc/rendering/render_ingame.md index b84edfb2..3000df16 100644 --- a/xml_converter/doc/rendering/render_ingame.md +++ b/xml_converter/doc/rendering/render_ingame.md @@ -3,8 +3,14 @@ name: Render Ingame type: Boolean applies_to: [Icon, Trail] xml_fields: [IngameVisibility, BHIngameVisibility] -protobuf_field: tentative__render_ingame - +protobuf_field: is_hidden_ingame +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 in the 3D game space. @@ -12,5 +18,5 @@ Allows or Prevents this object from being rendered in the 3D game space. Notes ===== -We want to figure out a way to invert this value becuase a "false" value is the default value inside a protobuf and if we set the default as "true" then we have to write this field for every object. This inversion will need to be present in the code generator and that might take a bit to design and implement. +https://gw2pathing.com/docs/marker-dev/attributes/visibility diff --git a/xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/input/pack/markers.bin b/xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/input/pack/markers.bin new file mode 100644 index 00000000..02eeace6 --- /dev/null +++ b/xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/input/pack/markers.bin @@ -0,0 +1,3 @@ + + + My Category 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WCB(“^ \ No newline at end of file diff --git a/xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/output_proto/markers.bin b/xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/output_proto/markers.bin new file mode 100644 index 00000000..02eeace6 --- /dev/null +++ b/xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/output_proto/markers.bin @@ -0,0 +1,3 @@ + + + My Category 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WCB(“^ \ No newline at end of file diff --git a/xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/output_xml/xml_file.xml b/xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/output_xml/xml_file.xml new file mode 100644 index 00000000..364d1262 --- /dev/null +++ b/xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/output_xml/xml_file.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/testcase.yaml b/xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/testcase.yaml new file mode 100644 index 00000000..d87f4066 --- /dev/null +++ b/xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/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_ingame/input/pack/xml_file.xml b/xml_converter/integration_tests/test_cases/xml_render_ingame/input/pack/xml_file.xml new file mode 100644 index 00000000..917be8d6 --- /dev/null +++ b/xml_converter/integration_tests/test_cases/xml_render_ingame/input/pack/xml_file.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/xml_converter/integration_tests/test_cases/xml_render_ingame/output_proto/markers.bin b/xml_converter/integration_tests/test_cases/xml_render_ingame/output_proto/markers.bin new file mode 100644 index 00000000..02eeace6 --- /dev/null +++ b/xml_converter/integration_tests/test_cases/xml_render_ingame/output_proto/markers.bin @@ -0,0 +1,3 @@ + + + My Category 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WCB(“^ \ No newline at end of file diff --git a/xml_converter/integration_tests/test_cases/xml_render_ingame/output_xml/xml_file.xml b/xml_converter/integration_tests/test_cases/xml_render_ingame/output_xml/xml_file.xml new file mode 100644 index 00000000..c71302b0 --- /dev/null +++ b/xml_converter/integration_tests/test_cases/xml_render_ingame/output_xml/xml_file.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/xml_converter/integration_tests/test_cases/xml_render_ingame/testcase.yaml b/xml_converter/integration_tests/test_cases/xml_render_ingame/testcase.yaml new file mode 100644 index 00000000..9510c793 --- /dev/null +++ b/xml_converter/integration_tests/test_cases/xml_render_ingame/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 1a028d79..d5520acb 100644 --- a/xml_converter/proto/waypoint.proto +++ b/xml_converter/proto/waypoint.proto @@ -55,9 +55,9 @@ message Icon { SpecializationFilter specialization_filter = 31; SpeciesFilter species_filter = 32; CullChirality cull_chirality = 33; + bool is_hidden_ingame = 34; float tentative__scale = 2048; - bool tentative__render_ingame = 2049; bool tentative__render_on_map = 2050; bool tentative__render_on_minimap = 2051; string bhdraft__schedule = 2052; @@ -87,8 +87,8 @@ message Trail { SpeciesFilter species_filter = 28; int32 map_display_size = 29; CullChirality cull_chirality = 30; + bool is_hidden_ingame = 31; - bool tentative__render_ingame = 2049; bool tentative__render_on_map = 2050; bool tentative__render_on_minimap = 2051; string bhdraft__schedule = 2052; diff --git a/xml_converter/src/icon_gen.cpp b/xml_converter/src/icon_gen.cpp index 36c87c83..73443810 100644 --- a/xml_converter/src/icon_gen.cpp +++ b/xml_converter/src/icon_gen.cpp @@ -182,10 +182,10 @@ bool Icon::init_xml_attribute(rapidxml::xml_attribute<>* attribute, vectorprofession_filter), &(this->profession_filter_is_set)); } else if (attributename == "ingamevisibility") { - xml_attribute_to_bool(attribute, errors, state, &(this->render_ingame), &(this->render_ingame_is_set)); + inverted_xml_attribute_to_bool(attribute, errors, state, &(this->render_ingame), &(this->render_ingame_is_set)); } else if (attributename == "bhingamevisibility") { - xml_attribute_to_bool(attribute, errors, state, &(this->render_ingame), &(this->render_ingame_is_set)); + inverted_xml_attribute_to_bool(attribute, errors, state, &(this->render_ingame), &(this->render_ingame_is_set)); } else if (attributename == "mapvisibility") { xml_attribute_to_bool(attribute, errors, state, &(this->render_on_map), &(this->render_on_map_is_set)); @@ -364,7 +364,7 @@ vector Icon::as_xml(XMLWriterState* state) const { xml_node_contents.push_back(profession_filter_to_xml_attribute("Profession", state, &this->profession_filter)); } if (this->render_ingame_is_set) { - xml_node_contents.push_back(bool_to_xml_attribute("IngameVisibility", state, &this->render_ingame)); + xml_node_contents.push_back(bool_to_inverted_xml_attribute("IngameVisibility", state, &this->render_ingame)); } if (this->render_on_map_is_set) { xml_node_contents.push_back(bool_to_xml_attribute("MapVisibility", state, &this->render_on_map)); @@ -540,7 +540,7 @@ waypoint::Icon Icon::as_protobuf(ProtoWriterState* state) const { profession_filter_to_proto(this->profession_filter, state, setter); } if (this->render_ingame_is_set) { - std::function setter = [&proto_icon](bool val) { proto_icon.set_tentative__render_ingame(val); }; + std::function setter = [&proto_icon](bool val) { proto_icon.set_is_hidden_ingame(val); }; bool_to_proto(this->render_ingame, state, setter); } if (this->render_on_map_is_set) { @@ -695,8 +695,8 @@ void Icon::parse_protobuf(waypoint::Icon proto_icon, ProtoReaderState* state) { if (proto_icon.has_profession_filter()) { proto_to_profession_filter(proto_icon.profession_filter(), state, &(this->profession_filter), &(this->profession_filter_is_set)); } - if (proto_icon.tentative__render_ingame() != 0) { - proto_to_bool(proto_icon.tentative__render_ingame(), state, &(this->render_ingame), &(this->render_ingame_is_set)); + if (proto_icon.is_hidden_ingame() != 0) { + proto_to_bool(proto_icon.is_hidden_ingame(), state, &(this->render_ingame), &(this->render_ingame_is_set)); } if (proto_icon.tentative__render_on_map() != 0) { proto_to_bool(proto_icon.tentative__render_on_map(), state, &(this->render_on_map), &(this->render_on_map_is_set)); diff --git a/xml_converter/src/trail_gen.cpp b/xml_converter/src/trail_gen.cpp index a22ff256..274cb021 100644 --- a/xml_converter/src/trail_gen.cpp +++ b/xml_converter/src/trail_gen.cpp @@ -104,10 +104,10 @@ bool Trail::init_xml_attribute(rapidxml::xml_attribute<>* attribute, vectorprofession_filter), &(this->profession_filter_is_set)); } else if (attributename == "ingamevisibility") { - xml_attribute_to_bool(attribute, errors, state, &(this->render_ingame), &(this->render_ingame_is_set)); + inverted_xml_attribute_to_bool(attribute, errors, state, &(this->render_ingame), &(this->render_ingame_is_set)); } else if (attributename == "bhingamevisibility") { - xml_attribute_to_bool(attribute, errors, state, &(this->render_ingame), &(this->render_ingame_is_set)); + inverted_xml_attribute_to_bool(attribute, errors, state, &(this->render_ingame), &(this->render_ingame_is_set)); } else if (attributename == "mapvisibility") { xml_attribute_to_bool(attribute, errors, state, &(this->render_on_map), &(this->render_on_map_is_set)); @@ -214,7 +214,7 @@ vector Trail::as_xml(XMLWriterState* state) const { xml_node_contents.push_back(profession_filter_to_xml_attribute("Profession", state, &this->profession_filter)); } if (this->render_ingame_is_set) { - xml_node_contents.push_back(bool_to_xml_attribute("IngameVisibility", state, &this->render_ingame)); + xml_node_contents.push_back(bool_to_inverted_xml_attribute("IngameVisibility", state, &this->render_ingame)); } if (this->render_on_map_is_set) { xml_node_contents.push_back(bool_to_xml_attribute("MapVisibility", state, &this->render_on_map)); @@ -314,7 +314,7 @@ waypoint::Trail Trail::as_protobuf(ProtoWriterState* state) const { profession_filter_to_proto(this->profession_filter, state, setter); } if (this->render_ingame_is_set) { - std::function setter = [&proto_trail](bool val) { proto_trail.set_tentative__render_ingame(val); }; + std::function setter = [&proto_trail](bool val) { proto_trail.set_is_hidden_ingame(val); }; bool_to_proto(this->render_ingame, state, setter); } if (this->render_on_map_is_set) { @@ -405,8 +405,8 @@ void Trail::parse_protobuf(waypoint::Trail proto_trail, ProtoReaderState* state) if (proto_trail.has_profession_filter()) { proto_to_profession_filter(proto_trail.profession_filter(), state, &(this->profession_filter), &(this->profession_filter_is_set)); } - if (proto_trail.tentative__render_ingame() != 0) { - proto_to_bool(proto_trail.tentative__render_ingame(), state, &(this->render_ingame), &(this->render_ingame_is_set)); + if (proto_trail.is_hidden_ingame() != 0) { + proto_to_bool(proto_trail.is_hidden_ingame(), state, &(this->render_ingame), &(this->render_ingame_is_set)); } if (proto_trail.tentative__render_on_map() != 0) { proto_to_bool(proto_trail.tentative__render_on_map(), state, &(this->render_on_map), &(this->render_on_map_is_set)); From 0f328ccea5928015d5c1862e1dd316fa4e517e92 Mon Sep 17 00:00:00 2001 From: klingbolt Date: Tue, 10 Sep 2024 19:41:59 -0400 Subject: [PATCH 2/5] reduced size of proto tests --- .../proto_is_hidden_ingame/input/pack/markers.bin | 4 ++-- .../proto_is_hidden_ingame/output_proto/markers.bin | 4 ++-- .../proto_is_hidden_ingame/output_xml/xml_file.xml | 6 ------ 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/input/pack/markers.bin b/xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/input/pack/markers.bin index 02eeace6..2416297b 100644 --- a/xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/input/pack/markers.bin +++ b/xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/input/pack/markers.bin @@ -1,3 +1,3 @@ - - My Category 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WCB(“^ \ No newline at end of file +D + My Category 2B \)CfRC{WC 2B \)CfRC{WCB(“^ \ No newline at end of file diff --git a/xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/output_proto/markers.bin b/xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/output_proto/markers.bin index 02eeace6..2416297b 100644 --- a/xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/output_proto/markers.bin +++ b/xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/output_proto/markers.bin @@ -1,3 +1,3 @@ - - My Category 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WCB(“^ \ No newline at end of file +D + My Category 2B \)CfRC{WC 2B \)CfRC{WCB(“^ \ No newline at end of file diff --git a/xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/output_xml/xml_file.xml b/xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/output_xml/xml_file.xml index 364d1262..4ad18f6e 100644 --- a/xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/output_xml/xml_file.xml +++ b/xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/output_xml/xml_file.xml @@ -4,12 +4,6 @@ - - - - - - From 4c12c44d651669443f11af28ef9549a538f96d87 Mon Sep 17 00:00:00 2001 From: klingbolt Date: Tue, 10 Sep 2024 20:48:56 -0400 Subject: [PATCH 3/5] Changed render_on_map to _is_hidden_on_map --- xml_converter/doc/rendering/render_on_map.md | 9 ++++++++- .../proto_is_hidden_on_map/input/pack/markers.bin | 3 +++ .../output_proto/markers.bin | 3 +++ .../output_xml/xml_file.xml | 9 +++++++++ .../proto_is_hidden_on_map/testcase.yaml | 5 +++++ .../xml_render_on_map/input/pack/xml_file.xml | 15 +++++++++++++++ .../xml_render_on_map/output_proto/markers.bin | 3 +++ .../xml_render_on_map/output_xml/xml_file.xml | 15 +++++++++++++++ .../test_cases/xml_render_on_map/testcase.yaml | 5 +++++ xml_converter/proto/waypoint.proto | 4 ++-- xml_converter/src/icon_gen.cpp | 12 ++++++------ xml_converter/src/trail_gen.cpp | 12 ++++++------ 12 files changed, 80 insertions(+), 15 deletions(-) create mode 100644 xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/input/pack/markers.bin create mode 100644 xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/output_proto/markers.bin create mode 100644 xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/output_xml/xml_file.xml create mode 100644 xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/testcase.yaml create mode 100644 xml_converter/integration_tests/test_cases/xml_render_on_map/input/pack/xml_file.xml create mode 100644 xml_converter/integration_tests/test_cases/xml_render_on_map/output_proto/markers.bin create mode 100644 xml_converter/integration_tests/test_cases/xml_render_on_map/output_xml/xml_file.xml create mode 100644 xml_converter/integration_tests/test_cases/xml_render_on_map/testcase.yaml diff --git a/xml_converter/doc/rendering/render_on_map.md b/xml_converter/doc/rendering/render_on_map.md index a5981c7b..375fb135 100644 --- a/xml_converter/doc/rendering/render_on_map.md +++ b/xml_converter/doc/rendering/render_on_map.md @@ -3,7 +3,14 @@ name: Render on Map type: Boolean applies_to: [Icon, Trail] xml_fields: [MapVisibility, BHMapVisibility] -protobuf_field: tentative__render_on_map +protobuf_field: is_hidden_on_map +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 world map. diff --git a/xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/input/pack/markers.bin b/xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/input/pack/markers.bin new file mode 100644 index 00000000..06a072a0 --- /dev/null +++ b/xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/input/pack/markers.bin @@ -0,0 +1,3 @@ + +D + My Category 2B \)CfRC{WC 2B \)CfRC{WCB(“^ \ No newline at end of file diff --git a/xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/output_proto/markers.bin b/xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/output_proto/markers.bin new file mode 100644 index 00000000..06a072a0 --- /dev/null +++ b/xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/output_proto/markers.bin @@ -0,0 +1,3 @@ + +D + My Category 2B \)CfRC{WC 2B \)CfRC{WCB(“^ \ No newline at end of file diff --git a/xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/output_xml/xml_file.xml b/xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/output_xml/xml_file.xml new file mode 100644 index 00000000..c01df540 --- /dev/null +++ b/xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/output_xml/xml_file.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/testcase.yaml b/xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/testcase.yaml new file mode 100644 index 00000000..d87f4066 --- /dev/null +++ b/xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/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_map/input/pack/xml_file.xml b/xml_converter/integration_tests/test_cases/xml_render_on_map/input/pack/xml_file.xml new file mode 100644 index 00000000..f250afbd --- /dev/null +++ b/xml_converter/integration_tests/test_cases/xml_render_on_map/input/pack/xml_file.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/xml_converter/integration_tests/test_cases/xml_render_on_map/output_proto/markers.bin b/xml_converter/integration_tests/test_cases/xml_render_on_map/output_proto/markers.bin new file mode 100644 index 00000000..7f148a4f --- /dev/null +++ b/xml_converter/integration_tests/test_cases/xml_render_on_map/output_proto/markers.bin @@ -0,0 +1,3 @@ + + + My Category 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WC 2B \)CfRC{WCB(“^ \ No newline at end of file diff --git a/xml_converter/integration_tests/test_cases/xml_render_on_map/output_xml/xml_file.xml b/xml_converter/integration_tests/test_cases/xml_render_on_map/output_xml/xml_file.xml new file mode 100644 index 00000000..d9bc1940 --- /dev/null +++ b/xml_converter/integration_tests/test_cases/xml_render_on_map/output_xml/xml_file.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/xml_converter/integration_tests/test_cases/xml_render_on_map/testcase.yaml b/xml_converter/integration_tests/test_cases/xml_render_on_map/testcase.yaml new file mode 100644 index 00000000..9510c793 --- /dev/null +++ b/xml_converter/integration_tests/test_cases/xml_render_on_map/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 1a028d79..ddddd635 100644 --- a/xml_converter/proto/waypoint.proto +++ b/xml_converter/proto/waypoint.proto @@ -55,10 +55,10 @@ message Icon { SpecializationFilter specialization_filter = 31; SpeciesFilter species_filter = 32; CullChirality cull_chirality = 33; + bool is_hidden_on_map = 35; float tentative__scale = 2048; bool tentative__render_ingame = 2049; - bool tentative__render_on_map = 2050; bool tentative__render_on_minimap = 2051; string bhdraft__schedule = 2052; float bhdraft__schedule_duration = 2053; @@ -87,9 +87,9 @@ message Trail { SpeciesFilter species_filter = 28; int32 map_display_size = 29; CullChirality cull_chirality = 30; + bool is_hidden_on_map = 32; bool tentative__render_ingame = 2049; - bool tentative__render_on_map = 2050; 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 36c87c83..dbdb4f50 100644 --- a/xml_converter/src/icon_gen.cpp +++ b/xml_converter/src/icon_gen.cpp @@ -188,10 +188,10 @@ bool Icon::init_xml_attribute(rapidxml::xml_attribute<>* attribute, vectorrender_ingame), &(this->render_ingame_is_set)); } else if (attributename == "mapvisibility") { - xml_attribute_to_bool(attribute, errors, state, &(this->render_on_map), &(this->render_on_map_is_set)); + inverted_xml_attribute_to_bool(attribute, errors, state, &(this->render_on_map), &(this->render_on_map_is_set)); } else if (attributename == "bhmapvisibility") { - xml_attribute_to_bool(attribute, errors, state, &(this->render_on_map), &(this->render_on_map_is_set)); + inverted_xml_attribute_to_bool(attribute, errors, state, &(this->render_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)); @@ -367,7 +367,7 @@ vector Icon::as_xml(XMLWriterState* state) const { xml_node_contents.push_back(bool_to_xml_attribute("IngameVisibility", state, &this->render_ingame)); } if (this->render_on_map_is_set) { - xml_node_contents.push_back(bool_to_xml_attribute("MapVisibility", state, &this->render_on_map)); + 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)); @@ -544,7 +544,7 @@ waypoint::Icon Icon::as_protobuf(ProtoWriterState* state) const { bool_to_proto(this->render_ingame, state, setter); } if (this->render_on_map_is_set) { - std::function setter = [&proto_icon](bool val) { proto_icon.set_tentative__render_on_map(val); }; + std::function setter = [&proto_icon](bool val) { proto_icon.set_is_hidden_on_map(val); }; bool_to_proto(this->render_on_map, state, setter); } if (this->render_on_minimap_is_set) { @@ -698,8 +698,8 @@ void Icon::parse_protobuf(waypoint::Icon proto_icon, ProtoReaderState* state) { if (proto_icon.tentative__render_ingame() != 0) { proto_to_bool(proto_icon.tentative__render_ingame(), state, &(this->render_ingame), &(this->render_ingame_is_set)); } - if (proto_icon.tentative__render_on_map() != 0) { - proto_to_bool(proto_icon.tentative__render_on_map(), state, &(this->render_on_map), &(this->render_on_map_is_set)); + 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)); diff --git a/xml_converter/src/trail_gen.cpp b/xml_converter/src/trail_gen.cpp index a22ff256..1267fd60 100644 --- a/xml_converter/src/trail_gen.cpp +++ b/xml_converter/src/trail_gen.cpp @@ -110,10 +110,10 @@ bool Trail::init_xml_attribute(rapidxml::xml_attribute<>* attribute, vectorrender_ingame), &(this->render_ingame_is_set)); } else if (attributename == "mapvisibility") { - xml_attribute_to_bool(attribute, errors, state, &(this->render_on_map), &(this->render_on_map_is_set)); + inverted_xml_attribute_to_bool(attribute, errors, state, &(this->render_on_map), &(this->render_on_map_is_set)); } else if (attributename == "bhmapvisibility") { - xml_attribute_to_bool(attribute, errors, state, &(this->render_on_map), &(this->render_on_map_is_set)); + inverted_xml_attribute_to_bool(attribute, errors, state, &(this->render_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)); @@ -217,7 +217,7 @@ vector Trail::as_xml(XMLWriterState* state) const { xml_node_contents.push_back(bool_to_xml_attribute("IngameVisibility", state, &this->render_ingame)); } if (this->render_on_map_is_set) { - xml_node_contents.push_back(bool_to_xml_attribute("MapVisibility", state, &this->render_on_map)); + 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)); @@ -318,7 +318,7 @@ waypoint::Trail Trail::as_protobuf(ProtoWriterState* state) const { bool_to_proto(this->render_ingame, state, setter); } if (this->render_on_map_is_set) { - std::function setter = [&proto_trail](bool val) { proto_trail.set_tentative__render_on_map(val); }; + std::function setter = [&proto_trail](bool val) { proto_trail.set_is_hidden_on_map(val); }; bool_to_proto(this->render_on_map, state, setter); } if (this->render_on_minimap_is_set) { @@ -408,8 +408,8 @@ void Trail::parse_protobuf(waypoint::Trail proto_trail, ProtoReaderState* state) if (proto_trail.tentative__render_ingame() != 0) { proto_to_bool(proto_trail.tentative__render_ingame(), state, &(this->render_ingame), &(this->render_ingame_is_set)); } - if (proto_trail.tentative__render_on_map() != 0) { - proto_to_bool(proto_trail.tentative__render_on_map(), state, &(this->render_on_map), &(this->render_on_map_is_set)); + 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)); From 7e2596c369f7db0a3f7c58507770a05528f95f7c Mon Sep 17 00:00:00 2001 From: klingbolt Date: Wed, 11 Sep 2024 23:03:22 -0400 Subject: [PATCH 4/5] added tests for trail attributues --- .../input/pack/markers.bin | Bin 70 -> 77 bytes .../output_proto/markers.bin | Bin 70 -> 77 bytes .../output_xml/xml_file.xml | 2 ++ .../xml_render_ingame/input/pack/xml_file.xml | 8 ++++++++ .../xml_render_ingame/output_proto/markers.bin | Bin 206 -> 234 bytes .../xml_render_ingame/output_xml/xml_file.xml | 8 ++++++++ 6 files changed, 18 insertions(+) diff --git a/xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/input/pack/markers.bin b/xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/input/pack/markers.bin index 2416297b28e4d791f7d2c8cad7c2fb3eb0677933..6da03ce875a093b8825ffa346a90fb618aac9788 100644 GIT binary patch delta 26 icmZ?sW#aOl$Ydp`#QcMiQHjBcL*vC6wnLNSrU3v?>IZ)S delta 19 acmeZuW8!j|$YjOk#G&!x4BMf}ank@W4+by* diff --git a/xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/output_proto/markers.bin b/xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/output_proto/markers.bin index 2416297b28e4d791f7d2c8cad7c2fb3eb0677933..6da03ce875a093b8825ffa346a90fb618aac9788 100644 GIT binary patch delta 26 icmZ?sW#aOl$Ydp`#QcMiQHjBcL*vC6wnLNSrU3v?>IZ)S delta 19 acmeZuW8!j|$YjOk#G&!x4BMf}ank@W4+by* diff --git a/xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/output_xml/xml_file.xml b/xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/output_xml/xml_file.xml index 4ad18f6e..e647bc3e 100644 --- a/xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/output_xml/xml_file.xml +++ b/xml_converter/integration_tests/test_cases/proto_is_hidden_ingame/output_xml/xml_file.xml @@ -5,5 +5,7 @@ + + diff --git a/xml_converter/integration_tests/test_cases/xml_render_ingame/input/pack/xml_file.xml b/xml_converter/integration_tests/test_cases/xml_render_ingame/input/pack/xml_file.xml index 917be8d6..38e3d973 100644 --- a/xml_converter/integration_tests/test_cases/xml_render_ingame/input/pack/xml_file.xml +++ b/xml_converter/integration_tests/test_cases/xml_render_ingame/input/pack/xml_file.xml @@ -11,5 +11,13 @@ + + + + + + + + diff --git a/xml_converter/integration_tests/test_cases/xml_render_ingame/output_proto/markers.bin b/xml_converter/integration_tests/test_cases/xml_render_ingame/output_proto/markers.bin index 02eeace6709f9224e6975f3db1617a50ec2aa086..f7b462ac56d0e12c371ce25eb55a14820dd42ee8 100644 GIT binary patch delta 49 pcmX@d_==H<>-j{cLuyLQKNuMy1cMR-D$j{S-0pXLtIWA8ZXYU9hw|B4FFbI2xb5P diff --git a/xml_converter/integration_tests/test_cases/xml_render_ingame/output_xml/xml_file.xml b/xml_converter/integration_tests/test_cases/xml_render_ingame/output_xml/xml_file.xml index c71302b0..92b78696 100644 --- a/xml_converter/integration_tests/test_cases/xml_render_ingame/output_xml/xml_file.xml +++ b/xml_converter/integration_tests/test_cases/xml_render_ingame/output_xml/xml_file.xml @@ -11,5 +11,13 @@ + + + + + + + + From 2f823a72ecb61594e05033e064c5b3da3878c4ab Mon Sep 17 00:00:00 2001 From: klingbolt Date: Wed, 11 Sep 2024 23:28:35 -0400 Subject: [PATCH 5/5] added tests for trail attributues --- .../input/pack/markers.bin | Bin 70 -> 77 bytes .../output_proto/markers.bin | Bin 70 -> 77 bytes .../output_xml/xml_file.xml | 2 ++ .../xml_render_on_map/input/pack/xml_file.xml | 8 ++++++++ .../xml_render_on_map/output_proto/markers.bin | Bin 206 -> 234 bytes .../xml_render_on_map/output_xml/xml_file.xml | 8 ++++++++ 6 files changed, 18 insertions(+) diff --git a/xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/input/pack/markers.bin b/xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/input/pack/markers.bin index 06a072a0e7fda562e6817193284ebc9503b6640b..af452f483ee159d308a1637c605c49c7e3e31189 100644 GIT binary patch delta 26 hcmZ?sW#aOl$Ydp`#N5EdsKnsJq4DAj+o8#E(*Q{D2M7QF delta 19 acmeZuW8!j|$YjOk#G&!x4BMf}ank@W4+by* diff --git a/xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/output_proto/markers.bin b/xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/output_proto/markers.bin index 06a072a0e7fda562e6817193284ebc9503b6640b..af452f483ee159d308a1637c605c49c7e3e31189 100644 GIT binary patch delta 26 hcmZ?sW#aOl$Ydp`#N5EdsKnsJq4DAj+o8#E(*Q{D2M7QF delta 19 acmeZuW8!j|$YjOk#G&!x4BMf}ank@W4+by* diff --git a/xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/output_xml/xml_file.xml b/xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/output_xml/xml_file.xml index c01df540..d75bf7c1 100644 --- a/xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/output_xml/xml_file.xml +++ b/xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/output_xml/xml_file.xml @@ -5,5 +5,7 @@ + + diff --git a/xml_converter/integration_tests/test_cases/xml_render_on_map/input/pack/xml_file.xml b/xml_converter/integration_tests/test_cases/xml_render_on_map/input/pack/xml_file.xml index f250afbd..26e0fa9b 100644 --- a/xml_converter/integration_tests/test_cases/xml_render_on_map/input/pack/xml_file.xml +++ b/xml_converter/integration_tests/test_cases/xml_render_on_map/input/pack/xml_file.xml @@ -11,5 +11,13 @@ + + + + + + + + diff --git a/xml_converter/integration_tests/test_cases/xml_render_on_map/output_proto/markers.bin b/xml_converter/integration_tests/test_cases/xml_render_on_map/output_proto/markers.bin index 7f148a4fc5f61858b7abccef49ac0873eaa5fc03..dabc52a20587390ff46756a7afb933d056154242 100644 GIT binary patch delta 49 ocmX@d_==H<>-j{cLuyLQ4NQy>f-0pXLtIWA8ZXYU9hw|B4FFbI2xb5P diff --git a/xml_converter/integration_tests/test_cases/xml_render_on_map/output_xml/xml_file.xml b/xml_converter/integration_tests/test_cases/xml_render_on_map/output_xml/xml_file.xml index d9bc1940..a797e091 100644 --- a/xml_converter/integration_tests/test_cases/xml_render_on_map/output_xml/xml_file.xml +++ b/xml_converter/integration_tests/test_cases/xml_render_on_map/output_xml/xml_file.xml @@ -11,5 +11,13 @@ + + + + + + + +