Skip to content

Commit

Permalink
Merge branch 'xml_converter' into invert_render_on_minimap
Browse files Browse the repository at this point in the history
  • Loading branch information
klingbolt authored Sep 19, 2024
2 parents ec2f2e9 + 1c95171 commit c485339
Show file tree
Hide file tree
Showing 21 changed files with 179 additions and 32 deletions.
12 changes: 9 additions & 3 deletions xml_converter/doc/rendering/render_ingame.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,20 @@ 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.

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

9 changes: 8 additions & 1 deletion xml_converter/doc/rendering/render_on_map.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<OverlayData>
<MarkerCategory DisplayName="My Category" ID="KOjMBsKTXpY=" Name="mycategory">
</MarkerCategory>

<POIs>
<POI Type="mycategory" MapID="50" XPos="169.809998" YPos="210.649994" ZPos="215.830002" IngameVisibility="false"/>
<POI Type="mycategory" MapID="50" XPos="169.809998" YPos="210.649994" ZPos="215.830002"/>
<Trail Type="mycategory" IngameVisibility="false"/>
<Trail Type="mycategory"/>
</POIs>
</OverlayData>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
input_paths:
"pack": "proto"
expected_stdout: |
expected_stderr: |
expected_returncode: 0
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<OverlayData>
<MarkerCategory DisplayName="My Category" ID="KOjMBsKTXpY=" Name="mycategory">
</MarkerCategory>

<POIs>
<POI Type="mycategory" MapID="50" XPos="169.809998" YPos="210.649994" ZPos="215.830002" MapVisibility="false"/>
<POI Type="mycategory" MapID="50" XPos="169.809998" YPos="210.649994" ZPos="215.830002"/>
<Trail Type="mycategory" MapVisibility="false"/>
<Trail Type="mycategory"/>
</POIs>
</OverlayData>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
input_paths:
"pack": "proto"
expected_stdout: |
expected_stderr: |
expected_returncode: 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<OverlayData>
<MarkerCategory DisplayName="My Category" Name="mycategory">
</MarkerCategory>

<POIs>
<POI IngameVisibility="false" Type="mycategory" XPos="169.81" YPos="210.65" ZPos="215.83" MapID="50" />
<POI IngameVisibility="0" Type="mycategory" XPos="169.81" YPos="210.65" ZPos="215.83" MapID="50" />
<POI IngameVisibility="true" Type="mycategory" XPos="169.81" YPos="210.65" ZPos="215.83" MapID="50" />
<POI IngameVisibility="1" Type="mycategory" XPos="169.81" YPos="210.65" ZPos="215.83" MapID="50" />
<POI BHIngameVisibility="false" Type="mycategory" XPos="169.81" YPos="210.65" ZPos="215.83" MapID="50" />
<POI BHIngameVisibility="0" Type="mycategory" XPos="169.81" YPos="210.65" ZPos="215.83" MapID="50" />
<POI BHIngameVisibility="true" Type="mycategory" XPos="169.81" YPos="210.65" ZPos="215.83" MapID="50" />
<POI BHIngameVisibility="1" Type="mycategory" XPos="169.81" YPos="210.65" ZPos="215.83" MapID="50" />
<Trail IngameVisibility="false" Type="mycategory" />
<Trail IngameVisibility="0" Type="mycategory" />
<Trail IngameVisibility="true" Type="mycategory" />
<Trail IngameVisibility="1" Type="mycategory" />
<Trail BHIngameVisibility="false" Type="mycategory" />
<Trail BHIngameVisibility="0" Type="mycategory" />
<Trail BHIngameVisibility="true" Type="mycategory" />
<Trail BHIngameVisibility="1" Type="mycategory" />
</POIs>
</OverlayData>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<OverlayData>
<MarkerCategory DisplayName="My Category" ID="KOjMBsKTXpY=" Name="mycategory">
</MarkerCategory>

<POIs>
<POI Type="mycategory" MapID="50" XPos="169.809998" YPos="210.649994" ZPos="215.830002" IngameVisibility="false"/>
<POI Type="mycategory" MapID="50" XPos="169.809998" YPos="210.649994" ZPos="215.830002" IngameVisibility="false"/>
<POI Type="mycategory" MapID="50" XPos="169.809998" YPos="210.649994" ZPos="215.830002" IngameVisibility="true"/>
<POI Type="mycategory" MapID="50" XPos="169.809998" YPos="210.649994" ZPos="215.830002" IngameVisibility="true"/>
<POI Type="mycategory" MapID="50" XPos="169.809998" YPos="210.649994" ZPos="215.830002" IngameVisibility="false"/>
<POI Type="mycategory" MapID="50" XPos="169.809998" YPos="210.649994" ZPos="215.830002" IngameVisibility="false"/>
<POI Type="mycategory" MapID="50" XPos="169.809998" YPos="210.649994" ZPos="215.830002" IngameVisibility="true"/>
<POI Type="mycategory" MapID="50" XPos="169.809998" YPos="210.649994" ZPos="215.830002" IngameVisibility="true"/>
<Trail Type="mycategory" IngameVisibility="false"/>
<Trail Type="mycategory" IngameVisibility="false"/>
<Trail Type="mycategory" IngameVisibility="true"/>
<Trail Type="mycategory" IngameVisibility="true"/>
<Trail Type="mycategory" IngameVisibility="false"/>
<Trail Type="mycategory" IngameVisibility="false"/>
<Trail Type="mycategory" IngameVisibility="true"/>
<Trail Type="mycategory" IngameVisibility="true"/>
</POIs>
</OverlayData>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
input_paths:
"pack": "xml"
expected_stdout: |
expected_stderr: |
expected_returncode: 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<OverlayData>
<MarkerCategory DisplayName="My Category" Name="mycategory">
</MarkerCategory>

<POIs>
<POI MapVisibility="false" Type="mycategory" XPos="169.81" YPos="210.65" ZPos="215.83" MapID="50" />
<POI MapVisibility="0" Type="mycategory" XPos="169.81" YPos="210.65" ZPos="215.83" MapID="50" />
<POI MapVisibility="true" Type="mycategory" XPos="169.81" YPos="210.65" ZPos="215.83" MapID="50" />
<POI MapVisibility="1" Type="mycategory" XPos="169.81" YPos="210.65" ZPos="215.83" MapID="50" />
<POI BHMapVisibility="false" Type="mycategory" XPos="169.81" YPos="210.65" ZPos="215.83" MapID="50" />
<POI BHMapVisibility="0" Type="mycategory" XPos="169.81" YPos="210.65" ZPos="215.83" MapID="50" />
<POI BHMapVisibility="true" Type="mycategory" XPos="169.81" YPos="210.65" ZPos="215.83" MapID="50" />
<POI BHMapVisibility="1" Type="mycategory" XPos="169.81" YPos="210.65" ZPos="215.83" MapID="50" />
<Trail MapVisibility="false" Type="mycategory" />
<Trail MapVisibility="0" Type="mycategory" />
<Trail MapVisibility="true" Type="mycategory" />
<Trail MapVisibility="1" Type="mycategory" />
<Trail BHMapVisibility="false" Type="mycategory" />
<Trail BHMapVisibility="0" Type="mycategory" />
<Trail BHMapVisibility="true" Type="mycategory" />
<Trail BHMapVisibility="1" Type="mycategory" />
</POIs>
</OverlayData>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<OverlayData>
<MarkerCategory DisplayName="My Category" ID="KOjMBsKTXpY=" Name="mycategory">
</MarkerCategory>

<POIs>
<POI Type="mycategory" MapID="50" XPos="169.809998" YPos="210.649994" ZPos="215.830002" MapVisibility="false"/>
<POI Type="mycategory" MapID="50" XPos="169.809998" YPos="210.649994" ZPos="215.830002" MapVisibility="false"/>
<POI Type="mycategory" MapID="50" XPos="169.809998" YPos="210.649994" ZPos="215.830002" MapVisibility="true"/>
<POI Type="mycategory" MapID="50" XPos="169.809998" YPos="210.649994" ZPos="215.830002" MapVisibility="true"/>
<POI Type="mycategory" MapID="50" XPos="169.809998" YPos="210.649994" ZPos="215.830002" MapVisibility="false"/>
<POI Type="mycategory" MapID="50" XPos="169.809998" YPos="210.649994" ZPos="215.830002" MapVisibility="false"/>
<POI Type="mycategory" MapID="50" XPos="169.809998" YPos="210.649994" ZPos="215.830002" MapVisibility="true"/>
<POI Type="mycategory" MapID="50" XPos="169.809998" YPos="210.649994" ZPos="215.830002" MapVisibility="true"/>
<Trail Type="mycategory" MapVisibility="false"/>
<Trail Type="mycategory" MapVisibility="false"/>
<Trail Type="mycategory" MapVisibility="true"/>
<Trail Type="mycategory" MapVisibility="true"/>
<Trail Type="mycategory" MapVisibility="false"/>
<Trail Type="mycategory" MapVisibility="false"/>
<Trail Type="mycategory" MapVisibility="true"/>
<Trail Type="mycategory" MapVisibility="true"/>
</POIs>
</OverlayData>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
input_paths:
"pack": "xml"
expected_stdout: |
expected_stderr: |
expected_returncode: 0
8 changes: 4 additions & 4 deletions xml_converter/proto/waypoint.proto
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ message Icon {
SpecializationFilter specialization_filter = 31;
SpeciesFilter species_filter = 32;
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_ingame = 2049;
bool tentative__render_on_map = 2050;
string bhdraft__schedule = 2052;
float bhdraft__schedule_duration = 2053;
}
Expand Down Expand Up @@ -87,10 +87,10 @@ message Trail {
SpeciesFilter species_filter = 28;
int32 map_display_size = 29;
CullChirality cull_chirality = 30;
bool is_hidden_ingame = 31;
bool is_hidden_on_map = 32;
bool is_hidden_on_minimap = 33;

bool tentative__render_ingame = 2049;
bool tentative__render_on_map = 2050;
string bhdraft__schedule = 2052;
float bhdraft__schedule_duration = 2053;
}
Expand Down
24 changes: 12 additions & 12 deletions xml_converter/src/icon_gen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,16 @@ bool Icon::init_xml_attribute(rapidxml::xml_attribute<>* attribute, vector<XMLEr
xml_attribute_to_profession_filter(attribute, errors, state, &(this->profession_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));
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") {
inverted_xml_attribute_to_bool(attribute, errors, state, &(this->render_on_minimap), &(this->render_on_minimap_is_set));
Expand Down Expand Up @@ -364,10 +364,10 @@ vector<string> 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));
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_inverted_xml_attribute("MinimapVisibility", state, &this->render_on_minimap));
Expand Down Expand Up @@ -540,11 +540,11 @@ 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<void(bool)> setter = [&proto_icon](bool val) { proto_icon.set_tentative__render_ingame(val); };
std::function<void(bool)> 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) {
std::function<void(bool)> setter = [&proto_icon](bool val) { proto_icon.set_tentative__render_on_map(val); };
std::function<void(bool)> 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) {
Expand Down Expand Up @@ -695,11 +695,11 @@ 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));
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.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));
Expand Down
24 changes: 12 additions & 12 deletions xml_converter/src/trail_gen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,16 @@ bool Trail::init_xml_attribute(rapidxml::xml_attribute<>* attribute, vector<XMLE
xml_attribute_to_profession_filter(attribute, errors, state, &(this->profession_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));
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") {
inverted_xml_attribute_to_bool(attribute, errors, state, &(this->render_on_minimap), &(this->render_on_minimap_is_set));
Expand Down Expand Up @@ -214,10 +214,10 @@ vector<string> 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));
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_inverted_xml_attribute("MinimapVisibility", state, &this->render_on_minimap));
Expand Down Expand Up @@ -314,11 +314,11 @@ 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<void(bool)> setter = [&proto_trail](bool val) { proto_trail.set_tentative__render_ingame(val); };
std::function<void(bool)> 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) {
std::function<void(bool)> setter = [&proto_trail](bool val) { proto_trail.set_tentative__render_on_map(val); };
std::function<void(bool)> 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) {
Expand Down Expand Up @@ -405,11 +405,11 @@ 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));
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.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));
Expand Down

0 comments on commit c485339

Please sign in to comment.