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

[XML Markers] Save Protobins from GDScript #154

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 2 additions & 0 deletions Gizmo/PointEdit.gd
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ func update_point():
if self.translation != self.last_translation:
if point_type == "path" || point_type == "area":
self.object_link.set_point_position(self.object_index, self.translation)
self.object_link.update_waypoint_trail()
self.object_2d_link.points[self.object_index] = Vector2(self.translation.x, self.translation.z)
if point_type == "icon":
self.object_link.translation = self.translation
self.object_link.update_waypoint_icon()
print("update")
self.last_translation = self.translation

Expand Down
6 changes: 6 additions & 0 deletions Icon.gd
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ const Waypoint = preload("res://waypoint.gd")
var texture_path
var waypoint: Waypoint.Icon

func update_waypoint_icon():
var position = self.waypoint.position()
position.set_x(translation[0])
position.set_y(translation[1])
position.set_z(-translation[2])

func set_icon_image(texture_path: String):
self.texture_path = texture_path

Expand Down
8 changes: 8 additions & 0 deletions Route.gd
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ var waypoint: Waypoint.Trail

var point_list := PoolVector3Array()

func update_waypoint_trail():
self.waypoint.clear_trail_data()
var trail_data = self.waypoint.new_trail_data()
for point in self.point_list:
trail_data.add_points_x(point[0])
trail_data.add_points_y(point[1])
trail_data.add_points_z(-point[2])

func create_mesh(point_list: PoolVector3Array):
self.point_list = point_list
refresh_mesh()
Expand Down
Loading