Browse Source

feat: add a Resume button to the main menu

It's not usable yet, but it's here…
Waiting…
…
In the shadows…
…
…
Silently.
master
Dominique Merle 2 years ago
parent
commit
ed39d4ce05
  1. 1
      addons/majority_judgment/nodes/MajorityJudgmentLinearResultsControl.tscn
  2. 2
      core/App.gd
  3. 6
      gui/MainMenu.gd
  4. 24
      gui/MainMenu.tscn
  5. 2
      gui/forms/SettingsForm.tscn

1
addons/majority_judgment/nodes/MajorityJudgmentLinearResultsControl.tscn

@ -44,5 +44,4 @@ __meta__ = {
}
[node name="ClosePollConfirmationDialog" parent="." instance=ExtResource( 3 )]
visible = false
[connection signal="pressed" from="ClosePollButton" to="." method="_on_ClosePollButton_pressed"]

2
core/App.gd

@ -27,7 +27,7 @@ var ongoing_poll:MajorityJudgmentPoll
func _ready():
load_config()
load_ongoing_poll()
# load_ongoing_poll()
func go_to_main_menu():

6
gui/MainMenu.gd

@ -11,11 +11,13 @@ extends Control
# Check `addons/majority_judgment/`. (it will move to its own repo someday)
onready var ResumeButton : Button = find_node("ResumePollButton")
onready var NewPollButton : Button = find_node("NewPollButton")
func _ready():
NewPollButton.grab_focus()
ResumeButton.visible = App.has_ongoing_poll()
var window_size = Vector2(
# Hmmm. Perhaps rename the Config properties like ProjectSettings'?
Config.get_parameter(
@ -30,6 +32,10 @@ func _ready():
OS.window_size = window_size
func _on_ResumePollButton_pressed():
App.load_ongoing_poll()
func _on_NewPollButton_pressed():
# var changed = get_tree().change_scene("res://tests/SmsReadingTest.tscn")
var changed = get_tree().change_scene("res://gui/forms/NewPollForm.tscn")

24
gui/MainMenu.tscn

@ -29,29 +29,39 @@ margin_top = 290.0
margin_right = 382.0
margin_bottom = 510.0
[node name="NewPollButton" type="Button" parent="CenterContainer/VBoxContainer"]
[node name="ResumePollButton" type="Button" parent="CenterContainer/VBoxContainer"]
margin_right = 164.0
margin_bottom = 52.0
text = "New Poll"
text = "Resume"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="SettingsButton" type="Button" parent="CenterContainer/VBoxContainer"]
[node name="NewPollButton" type="Button" parent="CenterContainer/VBoxContainer"]
margin_top = 60.0
margin_right = 164.0
margin_bottom = 112.0
text = "Settings"
text = "New Poll"
[node name="ExitButton" type="Button" parent="CenterContainer/VBoxContainer"]
[node name="SettingsButton" type="Button" parent="CenterContainer/VBoxContainer"]
margin_top = 120.0
margin_right = 164.0
margin_bottom = 172.0
text = "Settings"
[node name="ExitButton" type="Button" parent="CenterContainer/VBoxContainer"]
margin_top = 180.0
margin_right = 164.0
margin_bottom = 232.0
text = "Exit"
[node name="VersionLabel" type="Label" parent="CenterContainer/VBoxContainer"]
margin_top = 180.0
margin_top = 240.0
margin_right = 164.0
margin_bottom = 220.0
margin_bottom = 280.0
text = "v0.1"
align = 1
[connection signal="pressed" from="CenterContainer/VBoxContainer/ResumePollButton" to="." method="_on_ResumePollButton_pressed"]
[connection signal="pressed" from="CenterContainer/VBoxContainer/NewPollButton" to="." method="_on_NewPollButton_pressed"]
[connection signal="pressed" from="CenterContainer/VBoxContainer/SettingsButton" to="." method="_on_SettingsButton_pressed"]
[connection signal="pressed" from="CenterContainer/VBoxContainer/ExitButton" to="." method="_on_ExitButton_pressed"]

2
gui/forms/SettingsForm.tscn

@ -37,7 +37,6 @@ margin_bottom = 440.0
size_flags_vertical = 3
[node name="Providers" type="Control" parent="CenterContainer/VBoxContainer/TabContainer"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 8.0
@ -137,6 +136,7 @@ disabled = true
text = "Some other Chat Commands"
[node name="General" type="Control" parent="CenterContainer/VBoxContainer/TabContainer"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 8.0

Loading…
Cancel
Save