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

Updated gdscript code to reflect proto changes. #233

Merged
merged 10 commits into from
Dec 29, 2023
1 change: 1 addition & 0 deletions Icon.gd
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const Waypoint = preload("res://waypoint.gd")

var texture_path
var waypoint: Waypoint.Icon
var category: TreeItem
AsherGlick marked this conversation as resolved.
Show resolved Hide resolved

func set_icon_image(texture_path: String):
self.texture_path = texture_path
Expand Down
1 change: 1 addition & 0 deletions Route.gd
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const Waypoint = preload("res://waypoint.gd")
var texture_path
var color = Color(0.9, 0.1, 0.1)
var waypoint: Waypoint.Trail
var category: TreeItem

var point_list := PoolVector3Array()

Expand Down
6 changes: 4 additions & 2 deletions Spatial.gd
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ func _waypoint_categories_to_godot_nodes(item: TreeItem, category, full_category
category_item.set_metadata(0, "")
print("Category found with no name.")
return
category_item.set_text(0, category.get_display_name())
category_item.set_text(0, category.get_name())
category_item.set_metadata(0, full_category_name)
category_item.set_cell_mode(1, TreeItem.CELL_MODE_CHECK)
category_item.set_checked(1, Settings.local_category_data.get(full_category_name, {}).get("checked", false))
Expand Down Expand Up @@ -564,7 +564,7 @@ func populate_update_dict(category_item: TreeItem, category_visibility_data):
#Updates the visibilty of a node and all children.
func update_node_visibility(cateogry_data, nodes):
for node in nodes.get_children():
var node_name = node.waypoint.get_category().get_name()
var node_name = node.category.get_metadata(0)
if node_name in cateogry_data:
if cateogry_data[node_name]:
node.visible = true
Expand Down Expand Up @@ -616,6 +616,7 @@ func gen_new_path(points: Array, texture_path: String, waypoint_trail, category_
new_route.create_mesh(points_3d)
new_route.set_texture(texture)
new_route.waypoint = waypoint_trail
new_route.category = category_item
if category_item != null:
new_route.visible = is_category_visible(category_item)
else:
Expand Down Expand Up @@ -643,6 +644,7 @@ func gen_new_icon(position: Vector3, texture_path: String, waypoint_icon, catego
new_icon.translation = position
new_icon.set_icon_image(texture_path)
new_icon.waypoint = waypoint_icon
new_icon.category = category_item
if category_item != null:
new_icon.visible = is_category_visible(category_item)
else:
Expand Down
Loading