Updated GeneralPanel
Added loading of Settings for General Settings to the system.
This commit is contained in:
parent
5cf4cd512c
commit
b85080be65
2 changed files with 112 additions and 16 deletions
|
|
@ -1,6 +1,36 @@
|
|||
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:
|
||||
pass
|
||||
%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
|
||||
|
|
|
|||
|
|
@ -2,8 +2,45 @@
|
|||
|
||||
[ext_resource type="Script" uid="uid://cksum4dhxw4t3" path="res://UI/Controls/general_panel.gd" id="1_oafot"]
|
||||
[ext_resource type="Texture2D" uid="uid://cnu6l3x820i82" path="res://UI/assets/bootstrap/eye-slash.png" id="1_rbtts"]
|
||||
[ext_resource type="Texture2D" uid="uid://6wa5oaqt2vmq" path="res://UI/assets/neon-wave-theme/neon-wave-theme.png" id="2_7naex"]
|
||||
[ext_resource type="Script" uid="uid://ch7qf8iy31pfy" path="res://lib/UI/line_edit_with_buttons.gd" id="2_oookw"]
|
||||
|
||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_7naex"]
|
||||
content_margin_left = 10.0
|
||||
content_margin_top = 8.0
|
||||
content_margin_right = 78.538
|
||||
texture = ExtResource("2_7naex")
|
||||
texture_margin_left = 3.08429
|
||||
texture_margin_top = 5.50548
|
||||
texture_margin_right = 2.18471
|
||||
texture_margin_bottom = 5.269
|
||||
region_rect = Rect2(93, 474, 41, 33)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_en626"]
|
||||
content_margin_left = 4.0
|
||||
content_margin_top = 4.0
|
||||
content_margin_right = 72.538
|
||||
content_margin_bottom = 4.0
|
||||
bg_color = Color(0.1, 0.1, 0.1, 0.3)
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0, 0, 0, 0.3)
|
||||
corner_radius_top_left = 3
|
||||
corner_radius_top_right = 3
|
||||
corner_radius_bottom_right = 3
|
||||
corner_radius_bottom_left = 3
|
||||
corner_detail = 5
|
||||
|
||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_v8ga3"]
|
||||
content_margin_left = 10.0
|
||||
content_margin_top = 8.0
|
||||
content_margin_right = 78.538
|
||||
texture = ExtResource("2_7naex")
|
||||
texture_margin_left = 3.08429
|
||||
texture_margin_top = 5.50548
|
||||
texture_margin_right = 2.18471
|
||||
texture_margin_bottom = 5.269
|
||||
region_rect = Rect2(141, 474, 41, 33)
|
||||
|
||||
[node name="General" type="PanelContainer" unique_id=1071328377]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
|
|
@ -81,12 +118,6 @@ unique_name_in_owner = true
|
|||
layout_mode = 2
|
||||
text = "None"
|
||||
|
||||
[node name="AutoTwitch" type="CheckBox" parent="MarginContainer/VBoxContainer" unique_id=120315074]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
text = "Auto-Connect on Startup"
|
||||
|
||||
[node name="Control" type="Control" parent="MarginContainer/VBoxContainer" unique_id=2050811969]
|
||||
custom_minimum_size = Vector2(0, 20)
|
||||
layout_mode = 2
|
||||
|
|
@ -132,6 +163,9 @@ text = "Password:"
|
|||
[node name="ObsPass" type="LineEdit" parent="MarginContainer/VBoxContainer/GridContainer" unique_id=170190217]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme_override_styles/normal = SubResource("StyleBoxTexture_7naex")
|
||||
theme_override_styles/read_only = SubResource("StyleBoxFlat_en626")
|
||||
theme_override_styles/focus = SubResource("StyleBoxTexture_v8ga3")
|
||||
secret = true
|
||||
script = ExtResource("2_oookw")
|
||||
right = ExtResource("1_rbtts")
|
||||
|
|
@ -140,15 +174,47 @@ metadata/_custom_type_script = "uid://ch7qf8iy31pfy"
|
|||
[node name="Control" type="Control" parent="MarginContainer/VBoxContainer/GridContainer" unique_id=1104560246]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/VBoxContainer/GridContainer" unique_id=90167302]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ObsAuto" type="CheckBox" parent="MarginContainer/VBoxContainer/GridContainer/VBoxContainer" unique_id=2046121184]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Auto Connect"
|
||||
|
||||
[node name="ObsRecon" type="CheckBox" parent="MarginContainer/VBoxContainer/GridContainer/VBoxContainer" unique_id=1392024112]
|
||||
[node name="ObsRecon" type="CheckBox" parent="MarginContainer/VBoxContainer/GridContainer" unique_id=1392024112]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Auto Reconnect"
|
||||
|
||||
[node name="Control2" type="Control" parent="MarginContainer/VBoxContainer" unique_id=1368253689]
|
||||
custom_minimum_size = Vector2(0, 20)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label3" type="Label" parent="MarginContainer/VBoxContainer" unique_id=971642918]
|
||||
layout_mode = 2
|
||||
text = "Startup"
|
||||
|
||||
[node name="HSeparator3" type="HSeparator" parent="MarginContainer/VBoxContainer" unique_id=1963662250]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="GridContainer3" type="GridContainer" parent="MarginContainer/VBoxContainer" unique_id=364750310]
|
||||
layout_mode = 2
|
||||
columns = 2
|
||||
|
||||
[node name="AutoTwitch" type="CheckBox" parent="MarginContainer/VBoxContainer/GridContainer3" unique_id=120315074]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(260, 0)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
text = "Auto-Connect Twitch"
|
||||
|
||||
[node name="ConnectTwitch" type="Button" parent="MarginContainer/VBoxContainer/GridContainer3" unique_id=1912102897]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(240, 0)
|
||||
layout_mode = 2
|
||||
text = "Connect Twitch"
|
||||
|
||||
[node name="AutoObs" type="CheckBox" parent="MarginContainer/VBoxContainer/GridContainer3" unique_id=2046121184]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(260, 0)
|
||||
layout_mode = 2
|
||||
text = "Auto Connect OBS"
|
||||
|
||||
[node name="ConnectObs" type="Button" parent="MarginContainer/VBoxContainer/GridContainer3" unique_id=1488421279]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(240, 0)
|
||||
layout_mode = 2
|
||||
text = "Connect OBS"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue