Tag selection buttons now populate the form entry menu with available tags.

This commit is contained in:
Jamie Greunbaum
2024-05-23 17:00:41 -04:00
parent 64f6193701
commit ab74bda6f0
4 changed files with 50 additions and 48 deletions
+14 -8
View File
@@ -270,7 +270,7 @@ func __calculate_movement() -> void:
func __calculate_button_presses() -> void:
if Input.is_action_just_pressed(&"bugbot_place_marker") and __raycast_collision:
__place_marker(__raycast_collision["position"], __raycast_collision["normal"])
__select_at_location(__raycast_collision["position"], __raycast_collision["normal"])
if Input.is_action_just_released(&"bugbot_exit_placement"):
__exit_placement_timer.stop()
@@ -295,21 +295,27 @@ func __raycast_to_world():
else:
__laser_beam.visible = false
func __select_at_location(_position:Vector3, _normal:Vector3):
var collider : Area3D = __raycast_collision["collider"] as Area3D
if collider and collider.is_in_group("BugMarkerInfo"):
__pop_up_marker_info(_position, _normal)
else:
__place_marker(_position, _normal)
func __place_marker(_position:Vector3, _normal:Vector3):
if __raycast_collision:
var collider : Area3D = __raycast_collision["collider"] as Area3D
if collider and collider.is_in_group("BugMarkerInfo"):
print("Pop up bug marker info here.")
return
process_mode = Node.PROCESS_MODE_PAUSABLE
var marker : BugMarker = (load(bug_marker) as PackedScene).instantiate() as BugMarker
get_tree().get_root().add_child(marker)
marker.global_position = _position
marker.set_rotation_to_normal(_normal)
marker.marker_status = BugMarker.BugStatus.UNRESOLVED
__bugbot_server._prepare_form(__bug_report_form_data_prepared)
func __pop_up_marker_info(_position:Vector3, _normal:Vector3):
print("Pop up bug marker info here.")
func __bug_report_form_data_prepared(tag_lists:Array):
var bug_report_form : Control = preload("res://addons/Bugbot/UI/bug_report_form.tscn").instantiate()
add_child(bug_report_form)