38 lines
1 KiB
GDScript
38 lines
1 KiB
GDScript
class_name DirectorDrone extends Drone
|
|
|
|
@onready var edit_cursor = preload("res://resources/cursors/message_dots_round.png")
|
|
@onready var label = get_node("Label")
|
|
|
|
@export var visit_order : int = 0 :
|
|
get:
|
|
return visit_order
|
|
set(value):
|
|
visit_order = value
|
|
update_label_value()
|
|
|
|
func _ready():
|
|
pass
|
|
|
|
func _process(_delta):
|
|
pass
|
|
|
|
func update_label_value():
|
|
$Label.text = str(visit_order)
|
|
|
|
func _on_click_detection_mouse_entered():
|
|
Log.pr("Mouse entered the director drone!")
|
|
label.visible = true
|
|
Input.set_custom_mouse_cursor(edit_cursor, Input.CURSOR_ARROW, Vector2(32, 32))
|
|
|
|
func _on_click_detection_mouse_exited():
|
|
Log.pr("Mouse exited the director drone!")
|
|
label.visible = false
|
|
Input.set_custom_mouse_cursor(null)
|
|
|
|
|
|
func _on_click_detection_input_event(_viewport:Node, event:InputEvent, _shape_idx:int):
|
|
if (event is InputEventMouseButton && event.button_index == MOUSE_BUTTON_RIGHT && event.pressed):
|
|
Input.set_custom_mouse_cursor(null)
|
|
queue_free()
|
|
get_parent().get_parent().update_director_drone_list()
|
|
|