Ajout de l'intégration twitch
This commit is contained in:
@@ -12,6 +12,8 @@ func _ready():
|
||||
setup_sound()
|
||||
setup_video()
|
||||
setup_controls()
|
||||
setup_twitch()
|
||||
update_twitch_pseudo()
|
||||
show()
|
||||
%SettingsWindow.hide()
|
||||
%SettingsWindow.closed.connect(
|
||||
@@ -19,10 +21,17 @@ func _ready():
|
||||
GameInfo.save_settings()
|
||||
)
|
||||
|
||||
TwitchConnection.pseudo_gathered_updated.connect(
|
||||
func (_p):update_twitch_pseudo()
|
||||
)
|
||||
|
||||
func open_settings():
|
||||
setup_languages()
|
||||
setup_sound()
|
||||
setup_video()
|
||||
setup_controls()
|
||||
setup_twitch()
|
||||
update_twitch_pseudo()
|
||||
show()
|
||||
%SettingsWindow.open_window()
|
||||
|
||||
@@ -51,6 +60,17 @@ func setup_controls():
|
||||
%FovSlider.value = settings.fov
|
||||
%SensibilitySlider.value = settings.mouse_sensivity
|
||||
|
||||
func setup_twitch():
|
||||
%TwitchActivationCheckBox.button_pressed = settings.activate_twitch_integration
|
||||
%TwitchChannelLineEdit.text = settings.twitch_channel
|
||||
|
||||
func update_twitch_pseudo():
|
||||
if GameInfo.settings_data.activate_twitch_integration:
|
||||
%TwitchPseudoCount.text = tr("PSEUDO_GATHERED_%d") % len(TwitchConnection.pseudo_gathered)
|
||||
else:
|
||||
%TwitchPseudoCount.text = "TWITCH_NOT_CONNECTED"
|
||||
|
||||
|
||||
func _on_language_option_button_item_selected(index: int):
|
||||
settings.language = SettingsData.AVAILABLE_LANGUAGES[index]
|
||||
|
||||
@@ -85,3 +105,10 @@ func _on_sensibility_slider_value_changed(value: float):
|
||||
|
||||
func _on_ui_size_slider_value_changed(value: float):
|
||||
settings.ui_size = %UiSizeSlider.value
|
||||
|
||||
func _on_twitch_activation_check_box_toggled(toggled_on: bool):
|
||||
settings.activate_twitch_integration = toggled_on
|
||||
|
||||
func _on_twitch_channel_line_edit_editing_toggled(toggled_on: bool):
|
||||
if not toggled_on:
|
||||
settings.twitch_channel = %TwitchChannelLineEdit.text
|
||||
|
||||
Reference in New Issue
Block a user