StreamOverlay/UI/Controls/general_panel.gd
Mario Steele b85080be65 Updated GeneralPanel
Added loading of Settings for General Settings to the system.
2026-02-28 02:40:24 -06:00

36 lines
1.1 KiB
GDScript

extends PanelContainer
class_name GeneralPanel
const EYE_SLASH = preload("uid://csrvryk82h6w8")
const EYE = preload("uid://baex3uuhl827k")
var test: Color = Color.BLUE
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
%ObsPass.right = EYE_SLASH
%ObsPass.secret = true
%ObsPass.right_button_pressed.connect(_handle_password_show)
_load_settings()
func _load_settings() -> void:
%ObsHost.text = Globals.settings.obs_host
%ObsPort.value = Globals.settings.obs_port
%ObsPass.text = Globals.settings.obs_pass
%AutoTwitch.button_pressed = Globals.settings.auto_connect_twitch
%AutoObs.button_pressed = Globals.settings.auto_connect_obs
func apply_settings() -> void:
Globals.settings.obs_host = %ObsHost.text
Globals.settings.obs_port = floori(%ObsPort.value)
Globals.settings.obs_pass = %ObsPass.text
Globals.settings.auto_connect_twitch = %AutoTwitch.button_pressed
Globals.settings.auto_connect_obs = %AutoObs.button_pressed
func _handle_password_show() -> void:
if %ObsPass.right == EYE_SLASH:
%ObsPass.right = EYE
%ObsPass.secret = false
else:
%ObsPass.right = EYE_SLASH
%ObsPass.secret = true