A Godot Engine app to help streamers organize Majority Judgment polls in their streams.
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.

51 lines
1.3 KiB

  1. extends Control
  2. # Welcome!
  3. #
  4. # You are in the MAIN MENU.
  5. # There's not much going around in here…
  6. #
  7. # The goal of this application is to provide Majority Judgment utilities.
  8. # Most of the modular/reusable code about MJ is in an addon.
  9. # Check `addons/majority_judgment/`. (it will move to its own repo someday)
  10. onready var ResumeButton : Button = find_node("ResumePollButton")
  11. onready var NewPollButton : Button = find_node("NewPollButton")
  12. func _ready():
  13. NewPollButton.grab_focus()
  14. ResumeButton.visible = App.has_ongoing_poll()
  15. var window_size = Vector2(
  16. # Hmmm. Perhaps rename the Config properties like ProjectSettings'?
  17. Config.get_parameter(
  18. "video.window.width",
  19. ProjectSettings.get_setting("display/window/size/width")
  20. ),
  21. Config.get_parameter(
  22. "video.window.height",
  23. ProjectSettings.get_setting("display/window/size/height")
  24. )
  25. )
  26. OS.window_size = window_size
  27. func _on_ResumePollButton_pressed():
  28. App.load_ongoing_poll()
  29. func _on_NewPollButton_pressed():
  30. # var changed = get_tree().change_scene("res://tests/SmsReadingTest.tscn")
  31. var changed = get_tree().change_scene("res://gui/forms/NewPollForm.tscn")
  32. if OK != changed:
  33. printerr("Failed to open the new poll form scene.")
  34. func _on_ExitButton_pressed():
  35. get_tree().quit()
  36. func _on_SettingsButton_pressed():
  37. App.go_to_settings()