PowerMenu.gd 641 B

12345678910111213141516171819202122232425
  1. extends CanvasLayer
  2. var idbuffer = []
  3. func showmenu(powers = ['power1','power2','power3'], id = 0):
  4. idbuffer = id
  5. $CenterContainer.show()
  6. for i in $CenterContainer/VBoxContainer.get_child_count():
  7. $CenterContainer/VBoxContainer.get_child(i).text = powers[i]
  8. func _on_Button_button_down():
  9. senddatatoserver(0)
  10. pass # Replace with function body.
  11. func _on_Button2_button_down():
  12. senddatatoserver(1)
  13. pass # Replace with function body.
  14. func _on_Button3_button_down():
  15. senddatatoserver(2)
  16. pass # Replace with function body.
  17. func senddatatoserver(arg = ''):
  18. get_parent().players_choice_is(arg, idbuffer)
  19. $CenterContainer.hide()