Skip to content

Commit

Permalink
Merge pull request #352 from klingbolt/invert_render_on_minimap
Browse files Browse the repository at this point in the history
Changed render_on_minimap to is_hidden_on_minimap
  • Loading branch information
AsherGlick authored Sep 19, 2024
2 parents 1c95171 + c485339 commit 77f2d6f
Show file tree
Hide file tree
Showing 12 changed files with 89 additions and 15 deletions.
9 changes: 8 additions & 1 deletion xml_converter/doc/rendering/render_on_minimap.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
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" MinimapVisibility="false"/>
<POI Type="mycategory" MapID="50" XPos="169.809998" YPos="210.649994" ZPos="215.830002"/>
<Trail Type="mycategory" MinimapVisibility="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 MinimapVisibility="false" Type="mycategory" XPos="169.81" YPos="210.65" ZPos="215.83" MapID="50" />
<POI MinimapVisibility="0" Type="mycategory" XPos="169.81" YPos="210.65" ZPos="215.83" MapID="50" />
<POI MinimapVisibility="true" Type="mycategory" XPos="169.81" YPos="210.65" ZPos="215.83" MapID="50" />
<POI MinimapVisibility="1" Type="mycategory" XPos="169.81" YPos="210.65" ZPos="215.83" MapID="50" />
<POI BHMinimapVisibility="false" Type="mycategory" XPos="169.81" YPos="210.65" ZPos="215.83" MapID="50" />
<POI BHMinimapVisibility="0" Type="mycategory" XPos="169.81" YPos="210.65" ZPos="215.83" MapID="50" />
<POI BHMinimapVisibility="true" Type="mycategory" XPos="169.81" YPos="210.65" ZPos="215.83" MapID="50" />
<POI BHMinimapVisibility="1" Type="mycategory" XPos="169.81" YPos="210.65" ZPos="215.83" MapID="50" />
<Trail MinimapVisibility="false" Type="mycategory" />
<Trail MinimapVisibility="0" Type="mycategory" />
<Trail MinimapVisibility="true" Type="mycategory" />
<Trail MinimapVisibility="1" Type="mycategory" />
<Trail BHMinimapVisibility="false" Type="mycategory" />
<Trail BHMinimapVisibility="0" Type="mycategory" />
<Trail BHMinimapVisibility="true" Type="mycategory" />
<Trail BHMinimapVisibility="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" MinimapVisibility="false"/>
<POI Type="mycategory" MapID="50" XPos="169.809998" YPos="210.649994" ZPos="215.830002" MinimapVisibility="false"/>
<POI Type="mycategory" MapID="50" XPos="169.809998" YPos="210.649994" ZPos="215.830002" MinimapVisibility="true"/>
<POI Type="mycategory" MapID="50" XPos="169.809998" YPos="210.649994" ZPos="215.830002" MinimapVisibility="true"/>
<POI Type="mycategory" MapID="50" XPos="169.809998" YPos="210.649994" ZPos="215.830002" MinimapVisibility="false"/>
<POI Type="mycategory" MapID="50" XPos="169.809998" YPos="210.649994" ZPos="215.830002" MinimapVisibility="false"/>
<POI Type="mycategory" MapID="50" XPos="169.809998" YPos="210.649994" ZPos="215.830002" MinimapVisibility="true"/>
<POI Type="mycategory" MapID="50" XPos="169.809998" YPos="210.649994" ZPos="215.830002" MinimapVisibility="true"/>
<Trail Type="mycategory" MinimapVisibility="false"/>
<Trail Type="mycategory" MinimapVisibility="false"/>
<Trail Type="mycategory" MinimapVisibility="true"/>
<Trail Type="mycategory" MinimapVisibility="true"/>
<Trail Type="mycategory" MinimapVisibility="false"/>
<Trail Type="mycategory" MinimapVisibility="false"/>
<Trail Type="mycategory" MinimapVisibility="true"/>
<Trail Type="mycategory" MinimapVisibility="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 @@ -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;
}
Expand Down Expand Up @@ -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;
}
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 @@ -194,10 +194,10 @@ bool Icon::init_xml_attribute(rapidxml::xml_attribute<>* attribute, vector<XMLEr
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));
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));
Expand Down Expand Up @@ -370,7 +370,7 @@ vector<string> 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));
Expand Down Expand Up @@ -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<void(bool)> setter = [&proto_icon](bool val) { proto_icon.set_tentative__render_on_minimap(val); };
std::function<void(bool)> 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) {
Expand Down Expand Up @@ -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));
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 @@ -116,10 +116,10 @@ bool Trail::init_xml_attribute(rapidxml::xml_attribute<>* attribute, vector<XMLE
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));
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));
Expand Down Expand Up @@ -220,7 +220,7 @@ vector<string> 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));
Expand Down Expand Up @@ -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<void(bool)> setter = [&proto_trail](bool val) { proto_trail.set_tentative__render_on_minimap(val); };
std::function<void(bool)> 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) {
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 77f2d6f

Please sign in to comment.