input_prompts_center.gd 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. class_name InputPromptsCenter
  2. extends CenterContainer
  3. ## Manage the display of several inputs prompts
  4. @onready var WalkPrompts: Control = $InputPromptsCollection/WalkPrompts
  5. @onready var VehiclePrompts: Control = $InputPromptsCollection/VehiclePrompts
  6. @onready var JeepPrompts: Control = $InputPromptsCollection/VehiclePrompts/JeepPrompts
  7. @onready var PlanePrompts: Control = $InputPromptsCollection/VehiclePrompts/PlanePrompts
  8. func _on_title_screen_start_game() -> void:
  9. _enable(WalkPrompts)
  10. _disable_vehicle_prompts()
  11. func _on_victory_menu_visibility_changed() -> void:
  12. queue_free()
  13. func _enable(prompts: Control) -> void:
  14. prompts.set_visible(true)
  15. prompts.set_process_mode(Node.PROCESS_MODE_PAUSABLE)
  16. func _disable(prompts: Control) -> void:
  17. prompts.set_visible(false)
  18. prompts.set_process_mode(Node.PROCESS_MODE_DISABLED)
  19. func _enable_vehicle_prompts_of(vehicle: SeatedVehicle) -> void:
  20. _enable(VehiclePrompts)
  21. if vehicle is Jeep:
  22. _enable(JeepPrompts)
  23. if vehicle is Biplan or vehicle is TinyPlane:
  24. _enable(PlanePrompts)
  25. func _disable_vehicle_prompts() -> void:
  26. _disable(JeepPrompts)
  27. _disable(PlanePrompts)
  28. _disable(VehiclePrompts)
  29. func _on_main_walker_got_in(vehicle: SeatedVehicle) -> void:
  30. _disable(WalkPrompts)
  31. _enable_vehicle_prompts_of(vehicle)
  32. func _on_main_walker_got_out() -> void:
  33. _enable(WalkPrompts)
  34. _disable_vehicle_prompts()