Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed render_on_map to is_hidden_on_map #351

Merged
merged 3 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Full Diff
--- xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/input/pack/markers.bin.textproto._old	2024-09-11 00:52:54.908517059 +0000
+++ xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/input/pack/markers.bin.textproto._new	2024-09-11 00:52:54.916517035 +0000
@@ -0,0 +1,21 @@
+category {
+  name: "My Category"
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+    35: 1
+  }
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+  }
+  id: "(\350\314\006\302\223^\226"
+}

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this field is used on trails and icons, but only icons are tested here. Lets add a test for trails as well.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Full Diff
--- xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/input/pack/markers.bin.textproto._old	2024-09-12 03:29:00.603396789 +0000
+++ xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/input/pack/markers.bin.textproto._new	2024-09-12 03:29:00.611396852 +0000
@@ -0,0 +1,26 @@
+category {
+  name: "My Category"
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+    35: 1
+  }
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+  }
+  trail {
+    32: 1
+  }
+  trail {
+  }
+  id: "(\350\314\006\302\223^\226"
+}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Full Diff
--- xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/input/pack/markers.bin.textproto._old	2024-09-19 03:30:48.570819324 +0000
+++ xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/input/pack/markers.bin.textproto._new	2024-09-19 03:30:48.578819394 +0000
@@ -0,0 +1,26 @@
+category {
+  name: "My Category"
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+    35: 1
+  }
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+  }
+  trail {
+    32: 1
+  }
+  trail {
+  }
+  id: "(\350\314\006\302\223^\226"
+}

Binary file not shown.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Full Diff
--- xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/output_proto/markers.bin.textproto._old	2024-09-11 00:52:54.936516970 +0000
+++ xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/output_proto/markers.bin.textproto._new	2024-09-11 00:52:54.944516945 +0000
@@ -0,0 +1,21 @@
+category {
+  name: "My Category"
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+    35: 1
+  }
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+  }
+  id: "(\350\314\006\302\223^\226"
+}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Full Diff
--- xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/output_proto/markers.bin.textproto._old	2024-09-12 03:29:00.631397009 +0000
+++ xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/output_proto/markers.bin.textproto._new	2024-09-12 03:29:00.639397073 +0000
@@ -0,0 +1,26 @@
+category {
+  name: "My Category"
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+    35: 1
+  }
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+  }
+  trail {
+    32: 1
+  }
+  trail {
+  }
+  id: "(\350\314\006\302\223^\226"
+}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Full Diff
--- xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/output_proto/markers.bin.textproto._old	2024-09-19 03:30:48.586819464 +0000
+++ xml_converter/integration_tests/test_cases/proto_is_hidden_on_map/output_proto/markers.bin.textproto._new	2024-09-19 03:30:48.594819534 +0000
@@ -0,0 +1,26 @@
+category {
+  name: "My Category"
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+    35: 1
+  }
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+  }
+  trail {
+    32: 1
+  }
+  trail {
+  }
+  id: "(\350\314\006\302\223^\226"
+}

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 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>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Full Diff
--- xml_converter/integration_tests/test_cases/xml_render_on_map/output_proto/markers.bin.textproto._old	2024-09-11 00:52:54.952516919 +0000
+++ xml_converter/integration_tests/test_cases/xml_render_on_map/output_proto/markers.bin.textproto._new	2024-09-11 00:52:54.960516893 +0000
@@ -0,0 +1,72 @@
+category {
+  name: "My Category"
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+    35: 1
+  }
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+    35: 1
+  }
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+  }
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+  }
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+    35: 1
+  }
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+    35: 1
+  }
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+  }
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+  }
+  id: "(\350\314\006\302\223^\226"
+}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Full Diff
--- xml_converter/integration_tests/test_cases/xml_render_on_map/output_proto/markers.bin.textproto._old	2024-09-12 03:29:00.647397136 +0000
+++ xml_converter/integration_tests/test_cases/xml_render_on_map/output_proto/markers.bin.textproto._new	2024-09-12 03:29:00.655397199 +0000
@@ -0,0 +1,92 @@
+category {
+  name: "My Category"
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+    35: 1
+  }
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+    35: 1
+  }
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+  }
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+  }
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+    35: 1
+  }
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+    35: 1
+  }
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+  }
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+  }
+  trail {
+    32: 1
+  }
+  trail {
+    32: 1
+  }
+  trail {
+  }
+  trail {
+  }
+  trail {
+    32: 1
+  }
+  trail {
+    32: 1
+  }
+  trail {
+  }
+  trail {
+  }
+  id: "(\350\314\006\302\223^\226"
+}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Full Diff
--- xml_converter/integration_tests/test_cases/xml_render_on_map/output_proto/markers.bin.textproto._old	2024-09-19 03:30:48.601819595 +0000
+++ xml_converter/integration_tests/test_cases/xml_render_on_map/output_proto/markers.bin.textproto._new	2024-09-19 03:30:48.608819656 +0000
@@ -0,0 +1,92 @@
+category {
+  name: "My Category"
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+    35: 1
+  }
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+    35: 1
+  }
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+  }
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+  }
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+    35: 1
+  }
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+    35: 1
+  }
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+  }
+  icon {
+    map_id: 50
+    position {
+      x: 169.81
+      y: 210.65
+      z: 215.83
+    }
+  }
+  trail {
+    32: 1
+  }
+  trail {
+    32: 1
+  }
+  trail {
+  }
+  trail {
+  }
+  trail {
+    32: 1
+  }
+  trail {
+    32: 1
+  }
+  trail {
+  }
+  trail {
+  }
+  id: "(\350\314\006\302\223^\226"
+}

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
4 changes: 2 additions & 2 deletions xml_converter/proto/waypoint.proto
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ message Icon {
SpeciesFilter species_filter = 32;
CullChirality cull_chirality = 33;
bool is_hidden_ingame = 34;
bool is_hidden_on_map = 35;

float tentative__scale = 2048;
bool tentative__render_on_map = 2050;
bool tentative__render_on_minimap = 2051;
string bhdraft__schedule = 2052;
float bhdraft__schedule_duration = 2053;
Expand Down Expand Up @@ -88,8 +88,8 @@ message Trail {
int32 map_display_size = 29;
CullChirality cull_chirality = 30;
bool is_hidden_ingame = 31;
bool is_hidden_on_map = 32;

bool tentative__render_on_map = 2050;
bool tentative__render_on_minimap = 2051;
string bhdraft__schedule = 2052;
float bhdraft__schedule_duration = 2053;
Expand Down
12 changes: 6 additions & 6 deletions xml_converter/src/icon_gen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,10 @@ bool Icon::init_xml_attribute(rapidxml::xml_attribute<>* attribute, vector<XMLEr
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") {
xml_attribute_to_bool(attribute, errors, state, &(this->render_on_minimap), &(this->render_on_minimap_is_set));
Expand Down Expand Up @@ -367,7 +367,7 @@ vector<string> Icon::as_xml(XMLWriterState* state) const {
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_xml_attribute("MinimapVisibility", state, &this->render_on_minimap));
Expand Down Expand Up @@ -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<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 @@ -698,8 +698,8 @@ void Icon::parse_protobuf(waypoint::Icon proto_icon, ProtoReaderState* state) {
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.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));
Expand Down
12 changes: 6 additions & 6 deletions xml_converter/src/trail_gen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ bool Trail::init_xml_attribute(rapidxml::xml_attribute<>* attribute, vector<XMLE
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") {
xml_attribute_to_bool(attribute, errors, state, &(this->render_on_minimap), &(this->render_on_minimap_is_set));
Expand Down Expand Up @@ -217,7 +217,7 @@ vector<string> Trail::as_xml(XMLWriterState* state) const {
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_xml_attribute("MinimapVisibility", state, &this->render_on_minimap));
Expand Down Expand Up @@ -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<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 @@ -408,8 +408,8 @@ void Trail::parse_protobuf(waypoint::Trail proto_trail, ProtoReaderState* state)
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.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));
Expand Down
Loading