Public repository for MUR pre alpha
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
956 B

  1. extends Control
  2. onready var player_settings = find_node("player_settings")
  3. func _ready():
  4. find_node("bots").set_pressed(config.get_value("game","bots", true))
  5. find_node("bot_difficulty").set_value(config.get_value("game","bot_difficulty", gamestate.DEFAULT_BOT_DIFFICULTY))
  6. find_node("bot_difficulty").set_editable(find_node("bots").is_pressed())
  7. find_node("bot_difficulty").set_tooltip(tr("BOT_DIFFICULTY"))
  8. func _draw():
  9. find_node("start").grab_focus()
  10. func _on_start_pressed():
  11. var name = player_settings.get_name_node().text
  12. var color = player_settings.get_color_node().color
  13. var bots = find_node("bots").is_pressed()
  14. var bot_difficulty = find_node("bot_difficulty").get_value()
  15. queue_free()
  16. server.local_game(name,color,bots,bot_difficulty)
  17. func _on_back_pressed():
  18. queue_free()
  19. get_tree().get_root().get_node("main_menu").show()
  20. func _on_bots_toggled(button_pressed):
  21. find_node("bot_difficulty").set_editable(button_pressed)