Refactor: Added explicit typing and void return types
- Introduced explicit typing to variables and functions across multiple scripts for better code clarity. - Specified 'void' as the return type for functions that do not return a value. - Removed redundant code in some scripts.
This commit is contained in:
parent
a62cd6018e
commit
2a9e78b52e
37 changed files with 216 additions and 248 deletions
|
|
@ -1,7 +1,7 @@
|
|||
class_name DirectorDrone extends Drone
|
||||
|
||||
@onready var edit_cursor = preload("res://resources/cursors/message_dots_round.png")
|
||||
@onready var label = get_node("Label")
|
||||
@onready var edit_cursor : Resource = preload("res://resources/cursors/message_dots_round.png")
|
||||
@onready var label : Label = get_node("Label")
|
||||
|
||||
@export var visit_order : int = 0 :
|
||||
get:
|
||||
|
|
@ -10,22 +10,16 @@ class_name DirectorDrone extends Drone
|
|||
visit_order = value
|
||||
update_label_value()
|
||||
|
||||
func _ready():
|
||||
pass
|
||||
|
||||
func _process(_delta):
|
||||
pass
|
||||
|
||||
func update_label_value():
|
||||
func update_label_value() -> void:
|
||||
$Label.text = str(visit_order)
|
||||
|
||||
func _on_click_detection_mouse_entered():
|
||||
func _on_click_detection_mouse_entered() -> void:
|
||||
if GameState.placing_drone == false:
|
||||
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():
|
||||
func _on_click_detection_mouse_exited() -> void:
|
||||
if GameState.placing_drone == false:
|
||||
Log.pr("Mouse exited the director drone!")
|
||||
label.visible = false
|
||||
|
|
@ -33,7 +27,7 @@ func _on_click_detection_mouse_exited():
|
|||
GameState.reset_cursor()
|
||||
|
||||
|
||||
func _on_click_detection_input_event(_viewport:Node, event:InputEvent, _shape_idx:int):
|
||||
func _on_click_detection_input_event(_viewport:Node, event:InputEvent, _shape_idx:int) -> void:
|
||||
if GameState.placing_drone == false:
|
||||
if (event is InputEventMouseButton && event.button_index == MOUSE_BUTTON_RIGHT && event.pressed):
|
||||
#Input.set_custom_mouse_cursor(null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue