From 28f8cc33550ea4ea0c2a652fddc4658247dc55e1 Mon Sep 17 00:00:00 2001 From: domi41 Date: Fri, 4 Sep 2020 17:19:35 +0200 Subject: [PATCH] feat: add the AndroidSmsProvider --- .../MajorityJudgmentAndroidSmsProvider.gd | 45 +++++ android/plugins/README.md | 6 + core/App.gd | 28 ++- gui/MainMenu.gd | 3 +- gui/MainMenu.tscn | 34 ++-- gui/forms/NewPollForm.tscn | 96 +++++----- gui/forms/SettingsForm.gd | 30 ++- gui/forms/SettingsForm.tscn | 174 ++++++++++-------- project.godot | 15 +- 9 files changed, 283 insertions(+), 148 deletions(-) create mode 100644 addons/majority_judgment/providers/MajorityJudgmentAndroidSmsProvider.gd create mode 100644 android/plugins/README.md diff --git a/addons/majority_judgment/providers/MajorityJudgmentAndroidSmsProvider.gd b/addons/majority_judgment/providers/MajorityJudgmentAndroidSmsProvider.gd new file mode 100644 index 0000000..1133f69 --- /dev/null +++ b/addons/majority_judgment/providers/MajorityJudgmentAndroidSmsProvider.gd @@ -0,0 +1,45 @@ +extends MajorityJudgmentChatCommandJudgmentsProvider +class_name MajorityJudgmentAndroidSmsProvider + + +var AndroidSmsReceiver + + +func start_providing(): + if Engine.has_singleton("AndroidSmsReceiver"): + AndroidSmsReceiver = Engine.get_singleton("AndroidSmsReceiver") + AndroidSmsReceiver.start_receiving() + var connected = AndroidSmsReceiver.connect( + "sms_received", + self, "__on_sms_received" + ) + assert(connected == OK, "AndroidSmsReceiver must be connectable.") + else: + printerr( + "[MajorityJudgmentAndroidSmsProvider] " + + "AndroidSmsReceiver Singleton is not available." + ) + + +func stop_providing(): + if AndroidSmsReceiver: + AndroidSmsReceiver.stop_receiving() + AndroidSmsReceiver.disconnect("sms_received", self, "__on_sms_received") + + +func __on_sms_received(sms:Dictionary): +# # I. Log it to file +# var log_filepath = "user://sms_%s.log" % [ +# self.unique_session_identifier, +# ] +# var log_file = File.new() +# if log_file.file_exists(log_filepath): +# log_file.open(log_filepath, File.READ_WRITE) +# log_file.seek_end() +# OS.get_executable_path() +# else: +# log_file.open(log_filepath, File.WRITE_READ) +# log_file.store_csv_line([user_name, text], ":") +# log_file.close() + # II. Process it + process_chat_command(sms['author'], sms['message']) diff --git a/android/plugins/README.md b/android/plugins/README.md new file mode 100644 index 0000000..dfef652 --- /dev/null +++ b/android/plugins/README.md @@ -0,0 +1,6 @@ + +## AndroidSmsReader + +Reads SMSes from Android devices, when available. + +TODO: link to repo diff --git a/core/App.gd b/core/App.gd index 2347a3e..998fc87 100644 --- a/core/App.gd +++ b/core/App.gd @@ -1,9 +1,17 @@ extends Node -# Unused (see Config.gd) +# Unused (see Config.gd) # var config:ConfigResource var config_path := "user://settings.tres" +########################## + +# Add your provider here, as well as in the SettingsForm scene. +var registered_providers = [ + 'MajorityJudgmentDemoProvider', + 'MajorityJudgmentTwitchChatProvider', + 'MajorityJudgmentAndroidSmsProvider', +] func _ready(): @@ -46,10 +54,6 @@ func start_poll(poll): func get_providers() -> Array: - var registered_providers = [ - 'MajorityJudgmentTwitchChatProvider', - 'MajorityJudgmentDemoProvider', - ] var providers = Array() for registered_provider in registered_providers: var enabled = Config.get_parameter( @@ -66,5 +70,19 @@ func get_providers() -> Array: return providers +func can_have_sms_provider() -> bool: + return Engine.has_singleton("AndroidSmsReceiver") + + +#func get_android_sms_reader(): +# if can_have_sms_provider(): +# return Engine.get_singleton("AndroidSmsReader") +# return null + + +func get_now() -> int: + return OS.get_unix_time() + + func timer(duration:int) -> SceneTreeTimer: return get_tree().create_timer(duration) diff --git a/gui/MainMenu.gd b/gui/MainMenu.gd index 80e79b8..b529d86 100644 --- a/gui/MainMenu.gd +++ b/gui/MainMenu.gd @@ -1,7 +1,7 @@ extends Control -onready var NewPollButton = find_node("NewPollButton") +onready var NewPollButton : Button = find_node("NewPollButton") func _ready(): @@ -14,6 +14,7 @@ func _ready(): 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") if OK != changed: printerr("Failed to open the new poll form scene.") diff --git a/gui/MainMenu.tscn b/gui/MainMenu.tscn index 3aae5fc..d4f617a 100644 --- a/gui/MainMenu.tscn +++ b/gui/MainMenu.tscn @@ -1,11 +1,13 @@ -[gd_scene load_steps=3 format=2] +[gd_scene load_steps=4 format=2] [ext_resource path="res://gui/MainMenu.gd" type="Script" id=1] [ext_resource path="res://gui/widgets/Background.tscn" type="PackedScene" id=2] +[ext_resource path="res://gui/themes/AndroidAppTheme.tres" type="Theme" id=3] [node name="MainMenu" type="Control"] anchor_right = 1.0 anchor_bottom = 1.0 +theme = ExtResource( 3 ) script = ExtResource( 1 ) __meta__ = { "_edit_use_anchors_": false @@ -22,32 +24,32 @@ __meta__ = { } [node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"] -margin_left = 266.0 -margin_top = 207.0 -margin_right = 334.0 -margin_bottom = 293.0 +margin_left = 224.0 +margin_top = 305.0 +margin_right = 376.0 +margin_bottom = 495.0 [node name="NewPollButton" type="Button" parent="CenterContainer/VBoxContainer"] -margin_right = 68.0 -margin_bottom = 20.0 +margin_right = 152.0 +margin_bottom = 46.0 text = "New Poll" [node name="SettingsButton" type="Button" parent="CenterContainer/VBoxContainer"] -margin_top = 24.0 -margin_right = 68.0 -margin_bottom = 44.0 +margin_top = 50.0 +margin_right = 152.0 +margin_bottom = 96.0 text = "Settings" [node name="ExitButton" type="Button" parent="CenterContainer/VBoxContainer"] -margin_top = 48.0 -margin_right = 68.0 -margin_bottom = 68.0 +margin_top = 100.0 +margin_right = 152.0 +margin_bottom = 146.0 text = "Exit" [node name="VersionLabel" type="Label" parent="CenterContainer/VBoxContainer"] -margin_top = 72.0 -margin_right = 68.0 -margin_bottom = 86.0 +margin_top = 150.0 +margin_right = 152.0 +margin_bottom = 190.0 text = "v0.1" align = 1 [connection signal="pressed" from="CenterContainer/VBoxContainer/NewPollButton" to="." method="_on_NewPollButton_pressed"] diff --git a/gui/forms/NewPollForm.tscn b/gui/forms/NewPollForm.tscn index 17a8900..e09c3f7 100644 --- a/gui/forms/NewPollForm.tscn +++ b/gui/forms/NewPollForm.tscn @@ -1,13 +1,15 @@ -[gd_scene load_steps=5 format=2] +[gd_scene load_steps=6 format=2] [ext_resource path="res://gui/widgets/Background.tscn" type="PackedScene" id=1] [ext_resource path="res://gui/forms/NewPollForm.gd" type="Script" id=2] [ext_resource path="res://gui/forms/CandidatesTree.gd" type="Script" id=3] [ext_resource path="res://gui/popups/NoProviderPopup.tscn" type="PackedScene" id=4] +[ext_resource path="res://gui/themes/AndroidAppTheme.tres" type="Theme" id=5] [node name="NewPollForm" type="Control"] anchor_right = 1.0 anchor_bottom = 1.0 +theme = ExtResource( 5 ) script = ExtResource( 2 ) __meta__ = { "_edit_use_anchors_": false @@ -25,45 +27,45 @@ __meta__ = { } [node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"] -margin_left = 185.0 -margin_top = 129.0 -margin_right = 415.0 -margin_bottom = 369.0 +margin_left = 74.0 +margin_top = 136.0 +margin_right = 526.0 +margin_bottom = 662.0 __meta__ = { "_edit_use_anchors_": false } [node name="TitleHBoxContainer" type="HBoxContainer" parent="CenterContainer/VBoxContainer"] -margin_right = 230.0 -margin_bottom = 24.0 +margin_right = 452.0 +margin_bottom = 60.0 [node name="Label" type="Label" parent="CenterContainer/VBoxContainer/TitleHBoxContainer"] -margin_top = 5.0 -margin_right = 28.0 -margin_bottom = 19.0 +margin_top = 10.0 +margin_right = 72.0 +margin_bottom = 50.0 text = "Title" __meta__ = { "_edit_use_anchors_": false } [node name="TitleLineEdit" type="LineEdit" parent="CenterContainer/VBoxContainer/TitleHBoxContainer"] -margin_left = 32.0 -margin_right = 230.0 -margin_bottom = 24.0 +margin_left = 80.0 +margin_right = 452.0 +margin_bottom = 60.0 size_flags_horizontal = 3 max_length = 256 placeholder_text = "Who should we raid?" [node name="CandidatesContainer" type="MarginContainer" parent="CenterContainer/VBoxContainer"] -margin_top = 28.0 -margin_right = 230.0 -margin_bottom = 148.0 -rect_min_size = Vector2( 230, 120 ) +margin_top = 68.0 +margin_right = 452.0 +margin_bottom = 318.0 +rect_min_size = Vector2( 230, 250 ) size_flags_vertical = 3 [node name="CandidatesTree" type="Tree" parent="CenterContainer/VBoxContainer/CandidatesContainer"] -margin_right = 230.0 -margin_bottom = 120.0 +margin_right = 452.0 +margin_bottom = 250.0 size_flags_horizontal = 3 size_flags_vertical = 3 hide_folding = true @@ -71,43 +73,43 @@ hide_root = true script = ExtResource( 3 ) [node name="GradingHBoxContainer" type="HBoxContainer" parent="CenterContainer/VBoxContainer"] -margin_top = 152.0 -margin_right = 230.0 -margin_bottom = 172.0 +margin_top = 326.0 +margin_right = 452.0 +margin_bottom = 378.0 [node name="Label" type="Label" parent="CenterContainer/VBoxContainer/GradingHBoxContainer"] self_modulate = Color( 1, 1, 1, 0.25098 ) -margin_top = 3.0 -margin_right = 49.0 -margin_bottom = 17.0 +margin_top = 6.0 +margin_right = 128.0 +margin_bottom = 46.0 text = "Grading" [node name="GradingMenuButton" type="MenuButton" parent="CenterContainer/VBoxContainer/GradingHBoxContainer"] -margin_left = 53.0 -margin_right = 230.0 -margin_bottom = 20.0 +margin_left = 136.0 +margin_right = 452.0 +margin_bottom = 52.0 size_flags_horizontal = 3 disabled = true -text = "Quality (6 grades)" +text = "(6 grades)" flat = false clip_text = true items = [ "Quality (2 grades)", null, 2, true, false, 0, 0, null, "", false, "Quality (3 grades)", null, 2, false, false, 0, 0, null, "", false, "Quality (4 grades)", null, 2, false, false, 2, 0, null, "", false ] [node name="DelegationCheckButton" type="CheckButton" parent="CenterContainer/VBoxContainer"] -margin_top = 176.0 -margin_right = 230.0 -margin_bottom = 216.0 +margin_top = 386.0 +margin_right = 452.0 +margin_bottom = 466.0 disabled = true text = "Allow Delegations" [node name="ButtonsHBoxContainer" type="HBoxContainer" parent="CenterContainer/VBoxContainer"] -margin_top = 220.0 -margin_right = 230.0 -margin_bottom = 240.0 +margin_top = 474.0 +margin_right = 452.0 +margin_bottom = 526.0 [node name="CancelButton" type="Button" parent="CenterContainer/VBoxContainer/ButtonsHBoxContainer"] -margin_right = 109.0 -margin_bottom = 20.0 +margin_right = 214.0 +margin_bottom = 52.0 size_flags_horizontal = 3 text = "CANCEL" __meta__ = { @@ -115,21 +117,21 @@ __meta__ = { } [node name="VSeparator" type="VSeparator" parent="CenterContainer/VBoxContainer/ButtonsHBoxContainer"] -margin_left = 113.0 -margin_right = 117.0 -margin_bottom = 20.0 +margin_left = 222.0 +margin_right = 230.0 +margin_bottom = 52.0 [node name="LaunchButton" type="Button" parent="CenterContainer/VBoxContainer/ButtonsHBoxContainer"] -margin_left = 121.0 -margin_right = 230.0 -margin_bottom = 20.0 +margin_left = 238.0 +margin_right = 452.0 +margin_bottom = 52.0 size_flags_horizontal = 3 text = "CREATE" [node name="NoProviderPopup" parent="CenterContainer" instance=ExtResource( 4 )] -margin_left = 168.0 -margin_top = 144.0 -margin_right = 431.0 -margin_bottom = 355.0 +margin_left = -28.0 +margin_top = 122.0 +margin_right = 628.0 +margin_bottom = 676.0 [connection signal="pressed" from="CenterContainer/VBoxContainer/ButtonsHBoxContainer/CancelButton" to="." method="_on_CancelButton_pressed"] [connection signal="pressed" from="CenterContainer/VBoxContainer/ButtonsHBoxContainer/LaunchButton" to="." method="_on_LaunchButton_pressed"] diff --git a/gui/forms/SettingsForm.gd b/gui/forms/SettingsForm.gd index fa39a7c..18d1f21 100644 --- a/gui/forms/SettingsForm.gd +++ b/gui/forms/SettingsForm.gd @@ -1,22 +1,28 @@ extends Control -onready var TwitchCheckButton = find_node("TwitchCheckButton", true) onready var DemoProviderCheckButton = find_node("DemoProviderCheckButton", true) +onready var TwitchCheckButton = find_node("TwitchCheckButton", true) +onready var SmsCheckButton = find_node("SmsCheckButton", true) onready var WindowSizeWidthLineEdit = find_node("WindowSizeWidthLineEdit", true) onready var WindowSizeHeightLineEdit = find_node("WindowSizeHeightLineEdit", true) var initializing = true func _ready(): + DemoProviderCheckButton.pressed = Config.get_parameter( + "provider_MajorityJudgmentDemoProvider_enabled", + false + ) TwitchCheckButton.pressed = Config.get_parameter( "provider_MajorityJudgmentTwitchChatProvider_enabled", false ) - DemoProviderCheckButton.pressed = Config.get_parameter( - "provider_MajorityJudgmentDemoProvider_enabled", + SmsCheckButton.pressed = Config.get_parameter( + "provider_MajorityJudgmentAndroidSmsProvider_enabled", false ) + SmsCheckButton.disabled = not App.can_have_sms_provider() update_window_size_inputs() initializing = false @@ -40,6 +46,13 @@ func _on_TwitchConfigureButton_pressed(): App.go_to_twitch_settings() +func _on_DemoProviderCheckButton_toggled(button_pressed): + Config.set_parameter( + "provider_MajorityJudgmentDemoProvider_enabled", + button_pressed + ) + + func _on_TwitchCheckButton_toggled(button_pressed): Config.set_parameter( "provider_MajorityJudgmentTwitchChatProvider_enabled", @@ -49,11 +62,17 @@ func _on_TwitchCheckButton_toggled(button_pressed): find_node('NoTwitchSettingsPopup', true).show_if_should() -func _on_DemoProviderCheckButton_toggled(button_pressed): +func _on_SmsCheckButton_toggled(button_pressed): Config.set_parameter( - "provider_MajorityJudgmentDemoProvider_enabled", + "provider_MajorityJudgmentAndroidSmsProvider_enabled", button_pressed ) + if App.can_have_sms_provider(): + if button_pressed and not initializing: + var asr = App.get_android_sms_reader() + assert(asr, "AndroidSmsReader must be available.") + if not asr.can_read(): + SmsCheckButton.pressed = false func _on_WindowSizeWidthLineEdit_focus_exited(): @@ -89,3 +108,4 @@ func _on_WindowSizeDetectionButton_pressed(): ws.y ) update_window_size_inputs() + diff --git a/gui/forms/SettingsForm.tscn b/gui/forms/SettingsForm.tscn index b67c682..4686c70 100644 --- a/gui/forms/SettingsForm.tscn +++ b/gui/forms/SettingsForm.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=4 format=2] +[gd_scene load_steps=5 format=2] [ext_resource path="res://gui/widgets/Background.tscn" type="PackedScene" id=1] [ext_resource path="res://gui/forms/SettingsForm.gd" type="Script" id=2] [ext_resource path="res://gui/popups/NoTwitchSettingsPopup.tscn" type="PackedScene" id=3] +[ext_resource path="res://gui/themes/AndroidAppTheme.tres" type="Theme" id=4] [node name="SettingsForm" type="Control"] anchor_right = 1.0 @@ -24,23 +25,25 @@ __meta__ = { } [node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"] -margin_left = 125.0 -margin_top = 123.0 -margin_right = 475.0 -margin_bottom = 377.0 +margin_left = 5.0 +margin_top = 149.0 +margin_right = 595.0 +margin_bottom = 649.0 +rect_min_size = Vector2( 590, 500 ) [node name="TabContainer" type="TabContainer" parent="CenterContainer/VBoxContainer"] -margin_right = 350.0 -margin_bottom = 230.0 -rect_min_size = Vector2( 350, 230 ) +margin_right = 590.0 +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 = 4.0 -margin_top = 32.0 -margin_right = -4.0 -margin_bottom = -4.0 +margin_left = 8.0 +margin_top = 60.0 +margin_right = -8.0 +margin_bottom = -8.0 [node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer/VBoxContainer/TabContainer/Providers"] anchor_right = 1.0 @@ -50,57 +53,79 @@ __meta__ = { } [node name="NoProvidersHelpLabel" type="RichTextLabel" parent="CenterContainer/VBoxContainer/TabContainer/Providers/VBoxContainer"] -margin_right = 342.0 -margin_bottom = 50.0 -rect_min_size = Vector2( 0, 50 ) +margin_right = 585.0 +margin_bottom = 100.0 +rect_min_size = Vector2( 0, 100 ) bbcode_enabled = true -bbcode_text = "Your community votes by sending commands such as \"B2\" in the chat. You must enable at least one provider or your polls will have no participants." -text = "Your community votes by sending commands such as \"B2\" in the chat. You must enable at least one provider or your polls will have no participants." +bbcode_text = "Your community votes by sending commands such as \"A4 B2\" in the chat. You must enable [b]at least one provider[/b] or your polls will have no participants." +text = "Your community votes by sending commands such as \"A4 B2\" in the chat. You must enable at least one provider or your polls will have no participants." [node name="DemoContainer" type="HBoxContainer" parent="CenterContainer/VBoxContainer/TabContainer/Providers/VBoxContainer"] -margin_top = 54.0 -margin_right = 342.0 -margin_bottom = 94.0 +margin_top = 108.0 +margin_right = 585.0 +margin_bottom = 188.0 __meta__ = { "_edit_use_anchors_": false } [node name="DemoProviderCheckButton" type="CheckButton" parent="CenterContainer/VBoxContainer/TabContainer/Providers/VBoxContainer/DemoContainer"] -margin_right = 176.0 -margin_bottom = 40.0 +margin_right = 324.0 +margin_bottom = 80.0 text = "Demo Provider" -[node name="Label" type="Label" parent="CenterContainer/VBoxContainer/TabContainer/Providers/VBoxContainer/DemoContainer"] -margin_left = 180.0 -margin_top = 4.0 -margin_right = 330.0 -margin_bottom = 35.0 +[node name="DemoHelpLabel" type="Label" parent="CenterContainer/VBoxContainer/TabContainer/Providers/VBoxContainer/DemoContainer"] +margin_left = 332.0 +margin_top = 12.0 +margin_right = 585.0 +margin_bottom = 68.0 text = "Enable this to simulate votes for a quick demo." [node name="TwitchContainer" type="HBoxContainer" parent="CenterContainer/VBoxContainer/TabContainer/Providers/VBoxContainer"] -margin_top = 98.0 -margin_right = 342.0 -margin_bottom = 138.0 +margin_top = 196.0 +margin_right = 585.0 +margin_bottom = 276.0 __meta__ = { "_edit_use_anchors_": false } [node name="TwitchCheckButton" type="CheckButton" parent="CenterContainer/VBoxContainer/TabContainer/Providers/VBoxContainer/TwitchContainer"] -margin_right = 229.0 -margin_bottom = 40.0 +margin_right = 415.0 +margin_bottom = 80.0 text = "Twitch Chat Commands" [node name="TwitchConfigureButton" type="Button" parent="CenterContainer/VBoxContainer/TabContainer/Providers/VBoxContainer/TwitchContainer"] -margin_left = 233.0 -margin_right = 305.0 -margin_bottom = 40.0 +margin_left = 423.0 +margin_right = 553.0 +margin_bottom = 80.0 text = "Configure" +[node name="SmsContainer" type="HBoxContainer" parent="CenterContainer/VBoxContainer/TabContainer/Providers/VBoxContainer"] +margin_top = 284.0 +margin_right = 585.0 +margin_bottom = 364.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="SmsCheckButton" type="CheckButton" parent="CenterContainer/VBoxContainer/TabContainer/Providers/VBoxContainer/SmsContainer"] +margin_right = 337.0 +margin_bottom = 80.0 +disabled = true +text = "SMS Commands" + +[node name="SmsHelpLabel" type="Label" parent="CenterContainer/VBoxContainer/TabContainer/Providers/VBoxContainer/SmsContainer"] +margin_left = 345.0 +margin_top = 27.0 +margin_right = 516.0 +margin_bottom = 52.0 +text = "Android 7+ only" + [node name="OtherContainer" type="HBoxContainer" parent="CenterContainer/VBoxContainer/TabContainer/Providers/VBoxContainer"] -margin_top = 142.0 +visible = false +margin_top = 186.0 margin_right = 342.0 -margin_bottom = 182.0 +margin_bottom = 226.0 __meta__ = { "_edit_use_anchors_": false } @@ -112,13 +137,12 @@ 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 = 4.0 -margin_top = 32.0 -margin_right = -4.0 -margin_bottom = -4.0 +margin_left = 8.0 +margin_top = 61.0 +margin_right = -8.0 +margin_bottom = -8.0 [node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer/VBoxContainer/TabContainer/General"] anchor_right = 1.0 @@ -128,52 +152,54 @@ __meta__ = { } [node name="HelpLabel" type="RichTextLabel" parent="CenterContainer/VBoxContainer/TabContainer/General/VBoxContainer"] -margin_right = 342.0 -margin_bottom = 166.0 +margin_right = 574.0 +margin_bottom = 318.0 size_flags_horizontal = 3 size_flags_vertical = 3 -text = "TODO: General settings like background color (right now you need to run the source and change the clear color in the project settings)" +text = "General settings. +Open an issue in our tracker to request more." __meta__ = { "_edit_use_anchors_": false } [node name="WindowSizeContainer" type="HBoxContainer" parent="CenterContainer/VBoxContainer/TabContainer/General/VBoxContainer"] -margin_top = 170.0 -margin_right = 342.0 -margin_bottom = 194.0 +margin_top = 326.0 +margin_right = 574.0 +margin_bottom = 371.0 [node name="WindowSizeLabel" type="Label" parent="CenterContainer/VBoxContainer/TabContainer/General/VBoxContainer/WindowSizeContainer"] -margin_top = 5.0 -margin_right = 122.0 -margin_bottom = 19.0 -text = "Initial Window Size" +margin_top = 10.0 +margin_right = 87.0 +margin_bottom = 35.0 +text = "Window" [node name="WindowSizeWidthLineEdit" type="LineEdit" parent="CenterContainer/VBoxContainer/TabContainer/General/VBoxContainer/WindowSizeContainer"] -margin_left = 126.0 -margin_right = 184.0 -margin_bottom = 24.0 +margin_left = 95.0 +margin_right = 259.0 +margin_bottom = 45.0 +grow_horizontal = 0 align = 1 [node name="XLabel" type="Label" parent="CenterContainer/VBoxContainer/TabContainer/General/VBoxContainer/WindowSizeContainer"] -margin_left = 188.0 -margin_top = 5.0 -margin_right = 195.0 -margin_bottom = 19.0 +margin_left = 267.0 +margin_top = 10.0 +margin_right = 279.0 +margin_bottom = 35.0 text = "x" __meta__ = { "_edit_use_anchors_": false } [node name="WindowSizeHeightLineEdit" type="LineEdit" parent="CenterContainer/VBoxContainer/TabContainer/General/VBoxContainer/WindowSizeContainer"] -margin_left = 199.0 -margin_right = 257.0 -margin_bottom = 24.0 +margin_left = 287.0 +margin_right = 451.0 +margin_bottom = 45.0 align = 1 [node name="WindowSizeDetectionButton" type="Button" parent="CenterContainer/VBoxContainer/TabContainer/General/VBoxContainer/WindowSizeContainer"] -margin_left = 261.0 -margin_right = 316.0 -margin_bottom = 24.0 +margin_left = 459.0 +margin_right = 552.0 +margin_bottom = 45.0 hint_tooltip = "Set to the dimensions of this window." text = "Detect" @@ -185,20 +211,21 @@ margin_bottom = 240.0 rect_min_size = Vector2( 350, 200 ) [node name="HBoxContainer" type="HBoxContainer" parent="CenterContainer/VBoxContainer"] -margin_top = 234.0 -margin_right = 350.0 -margin_bottom = 254.0 +margin_top = 448.0 +margin_right = 590.0 +margin_bottom = 500.0 [node name="VSeparator" type="VSeparator" parent="CenterContainer/VBoxContainer/HBoxContainer"] self_modulate = Color( 1, 1, 1, 0 ) -margin_right = 296.0 -margin_bottom = 20.0 +margin_right = 478.0 +margin_bottom = 52.0 size_flags_horizontal = 3 [node name="DoneButton" type="Button" parent="CenterContainer/VBoxContainer/HBoxContainer"] -margin_left = 300.0 -margin_right = 350.0 -margin_bottom = 20.0 +margin_left = 486.0 +margin_right = 590.0 +margin_bottom = 52.0 +theme = ExtResource( 4 ) text = "DONE" [node name="NoTwitchSettingsPopup" parent="." instance=ExtResource( 3 )] @@ -206,6 +233,7 @@ visible = false [connection signal="toggled" from="CenterContainer/VBoxContainer/TabContainer/Providers/VBoxContainer/DemoContainer/DemoProviderCheckButton" to="." method="_on_DemoProviderCheckButton_toggled"] [connection signal="toggled" from="CenterContainer/VBoxContainer/TabContainer/Providers/VBoxContainer/TwitchContainer/TwitchCheckButton" to="." method="_on_TwitchCheckButton_toggled"] [connection signal="pressed" from="CenterContainer/VBoxContainer/TabContainer/Providers/VBoxContainer/TwitchContainer/TwitchConfigureButton" to="." method="_on_TwitchConfigureButton_pressed"] +[connection signal="toggled" from="CenterContainer/VBoxContainer/TabContainer/Providers/VBoxContainer/SmsContainer/SmsCheckButton" to="." method="_on_SmsCheckButton_toggled"] [connection signal="focus_exited" from="CenterContainer/VBoxContainer/TabContainer/General/VBoxContainer/WindowSizeContainer/WindowSizeWidthLineEdit" to="." method="_on_WindowSizeWidthLineEdit_focus_exited"] [connection signal="focus_exited" from="CenterContainer/VBoxContainer/TabContainer/General/VBoxContainer/WindowSizeContainer/WindowSizeHeightLineEdit" to="." method="_on_WindowSizeHeightLineEdit_focus_exited"] [connection signal="pressed" from="CenterContainer/VBoxContainer/TabContainer/General/VBoxContainer/WindowSizeContainer/WindowSizeDetectionButton" to="." method="_on_WindowSizeDetectionButton_pressed"] diff --git a/project.godot b/project.godot index 74e9d34..4f1d473 100644 --- a/project.godot +++ b/project.godot @@ -84,6 +84,11 @@ _global_script_classes=[ { "language": "GDScript", "path": "res://addons/majority_judgment/MajorityJudgmentAbstractTallier.gd" }, { +"base": "MajorityJudgmentChatCommandJudgmentsProvider", +"class": "MajorityJudgmentAndroidSmsProvider", +"language": "GDScript", +"path": "res://addons/majority_judgment/providers/MajorityJudgmentAndroidSmsProvider.gd" +}, { "base": "Resource", "class": "MajorityJudgmentCandidate", "language": "GDScript", @@ -210,6 +215,7 @@ _global_script_class_icons={ "IrcClientSecure": "", "MajorityJudgmentAbstractJudgmentsProvider": "", "MajorityJudgmentAbstractTallier": "", +"MajorityJudgmentAndroidSmsProvider": "", "MajorityJudgmentCandidate": "", "MajorityJudgmentCandidateMeritProfile": "", "MajorityJudgmentCandidateTally": "", @@ -261,12 +267,19 @@ Config="*res://core/Config.gd" [display] window/size/width=600 -window/size/height=500 +window/size/height=800 +window/handheld/orientation="portrait" +window/stretch/mode="2d" +window/stretch/aspect="keep" [editor_plugins] enabled=PoolStringArray( "WAT", "majority_judgment" ) +[gui] + +theme/use_hidpi=true + [input] run_tests={