Update drone placement logic, level loading functionality, and UI behavior. Set visibility of labels, manage mouse cursor changes, and handle game state for placing drones.
This commit is contained in:
parent
b6cdb68b4e
commit
f9865cf1fa
8 changed files with 31 additions and 13 deletions
|
|
@ -107,6 +107,7 @@ color = Color(0.703926, 0.656042, 0.441124, 1)
|
|||
polygon = PackedVector2Array(-28, -25, 25, -28, 26, 33, -32, 19)
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
visible = false
|
||||
offset_left = 16.0
|
||||
offset_top = 25.0
|
||||
offset_right = 56.0
|
||||
|
|
|
|||
|
|
@ -20,19 +20,22 @@ 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))
|
||||
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():
|
||||
Log.pr("Mouse exited the director drone!")
|
||||
label.visible = false
|
||||
Input.set_custom_mouse_cursor(null)
|
||||
if GameState.placing_drone == false:
|
||||
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()
|
||||
if GameState.placing_drone == false:
|
||||
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()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue