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.
 
 

91 lines
2.1 KiB

extends Control
onready var TwitchCheckButton = find_node("TwitchCheckButton", true)
onready var DemoProviderCheckButton = find_node("DemoProviderCheckButton", true)
onready var WindowSizeWidthLineEdit = find_node("WindowSizeWidthLineEdit", true)
onready var WindowSizeHeightLineEdit = find_node("WindowSizeHeightLineEdit", true)
var initializing = true
func _ready():
TwitchCheckButton.pressed = Config.get_parameter(
"provider_MajorityJudgmentTwitchChatProvider_enabled",
false
)
DemoProviderCheckButton.pressed = Config.get_parameter(
"provider_MajorityJudgmentDemoProvider_enabled",
false
)
update_window_size_inputs()
initializing = false
func update_window_size_inputs():
WindowSizeWidthLineEdit.text = str(Config.get_parameter(
"video.window.width",
OS.window_size.x
))
WindowSizeHeightLineEdit.text = str(Config.get_parameter(
"video.window.height",
OS.window_size.y
))
func _on_DoneButton_pressed():
App.go_to_main_menu()
func _on_TwitchConfigureButton_pressed():
App.go_to_twitch_settings()
func _on_TwitchCheckButton_toggled(button_pressed):
Config.set_parameter(
"provider_MajorityJudgmentTwitchChatProvider_enabled",
button_pressed
)
if button_pressed and not initializing:
find_node('NoTwitchSettingsPopup', true).show_if_should()
func _on_DemoProviderCheckButton_toggled(button_pressed):
Config.set_parameter(
"provider_MajorityJudgmentDemoProvider_enabled",
button_pressed
)
func _on_WindowSizeWidthLineEdit_focus_exited():
var width = int(WindowSizeWidthLineEdit.text)
if width < 1:
return
Config.set_parameter(
"video.window.width",
width
)
OS.window_size = Vector2(width, OS.window_size.y)
func _on_WindowSizeHeightLineEdit_focus_exited():
var height = int(WindowSizeHeightLineEdit.text)
if height < 1:
return
Config.set_parameter(
"video.window.height",
height
)
OS.window_size = Vector2(OS.window_size.x, height)
func _on_WindowSizeDetectionButton_pressed():
var ws = OS.window_size
Config.set_parameter(
"video.window.width",
ws.x
)
Config.set_parameter(
"video.window.height",
ws.y
)
update_window_size_inputs()