better quick settings layout

This commit is contained in:
2025-07-22 10:34:22 +10:00
parent 853e4423f7
commit 760ffb8b80
5 changed files with 56 additions and 69 deletions

View File

@@ -271,9 +271,29 @@ func _on_delete_10_pressed():
## NDI Output Settings Methods
func _on_ndi_enabled_check_toggled(toggled_on: bool):
# Enable/disable NDI streaming
if Global.main.ndi_output:
print("NDI streaming ", "enabled" if toggled_on else "disabled")
# Enable/disable NDI streaming by adding/removing the NDI node
if toggled_on:
# Enable NDI - create the node if it doesn't exist
if not Global.main.ndi_output:
var ndi_node = NDIOutput.new()
ndi_node.set_name("NDIOutput") # Scene tree node name
var source_name = $NDIOutput/ndiSourceName.text
if source_name.is_empty():
source_name = "PNGTuber-Plus"
ndi_node.name = source_name # NDI source name
ndi_node.audio_bus = StringName("") # No audio by default
Global.main.add_child(ndi_node)
Global.main.ndi_output = ndi_node
print("NDI streaming enabled")
Global.pushUpdate("NDI streaming enabled")
update_ndi_status()
else:
# Disable NDI - remove the node
if Global.main.ndi_output:
Global.main.ndi_output.queue_free()
Global.main.ndi_output = null
print("NDI streaming disabled")
Global.pushUpdate("NDI streaming disabled")
update_ndi_status()
func _on_ndi_source_name_text_changed(new_text: String):
@@ -292,20 +312,23 @@ func _on_ndi_audio_check_toggled(toggled_on: bool):
print("NDI audio ", "enabled" if toggled_on else "disabled")
func _on_ndi_toggle_button_pressed():
# Toggle NDI streaming on/off - NDI is always on when the node exists
print("NDI toggle pressed - NDI is active when node exists")
update_ndi_status()
# Toggle NDI streaming on/off by toggling the checkbox
var current_state = $NDIOutput/ndiEnabledCheck.button_pressed
$NDIOutput/ndiEnabledCheck.button_pressed = !current_state
_on_ndi_enabled_check_toggled(!current_state)
func update_ndi_status():
# Update the status label and button text
if Global.main.ndi_output:
$NDIOutput/StatusLabel.text = "Status: Active (NDI Source: " + Global.main.ndi_output.name + ")"
$NDIOutput/toggleButton.text = "NDI Active"
$NDIOutput/ndiEnabledCheck.button_pressed = true
$NDIOutput/ndiSourceName.text = Global.main.ndi_output.name
else:
$NDIOutput/StatusLabel.text = "Status: Disabled"
$NDIOutput/ndiEnabledCheck.button_pressed = false
func setup_ndi_settings():
# Initialize NDI settings UI with current values
if Global.main.ndi_output:
$NDIOutput/ndiSourceName.text = Global.main.ndi_output.name
$NDIOutput/ndiAudioCheck.button_pressed = (Global.main.ndi_output.audio_bus != StringName(""))
update_ndi_status()

View File

@@ -14182,8 +14182,9 @@ HSlider/styles/slider = SubResource("StyleBoxFlat_t3qts")
script = ExtResource("1_ckdhy")
[node name="NinePatchRect" type="NinePatchRect" parent="."]
offset_left = -190.0
offset_right = 419.0
offset_bottom = 444.0
offset_bottom = 460.0
texture = ExtResource("1_ylauk")
region_rect = Rect2(0, 0, 48, 48)
patch_margin_left = 8
@@ -14289,7 +14290,7 @@ offset_bottom = 28.0
text = "confirm"
[node name="StreamDeck" type="Node2D" parent="."]
position = Vector2(16, 337)
position = Vector2(-173, 27)
[node name="Label" type="Label" parent="StreamDeck"]
offset_right = 138.0
@@ -14305,7 +14306,7 @@ offset_bottom = 25.0
metadata/_edit_use_anchors_ = true
[node name="experimentalMicLoudness" type="Node2D" parent="."]
position = Vector2(16, 369)
position = Vector2(-173, 59)
[node name="Label" type="Label" parent="experimentalMicLoudness"]
offset_right = 200.0
@@ -14320,7 +14321,7 @@ offset_bottom = 25.0
metadata/_edit_use_anchors_ = true
[node name="AntiAliasing" type="Node2D" parent="."]
position = Vector2(16, 401)
position = Vector2(-173, 91)
[node name="Label" type="Label" parent="AntiAliasing"]
offset_right = 138.0
@@ -14336,67 +14337,39 @@ offset_bottom = 25.0
metadata/_edit_use_anchors_ = true
[node name="NDIOutput" type="Node2D" parent="."]
position = Vector2(16, 433)
position = Vector2(-175, 149)
[node name="Label" type="Label" parent="NDIOutput"]
offset_top = 38.0
offset_right = 138.0
offset_bottom = 34.0
offset_bottom = 72.0
text = "NDI streaming"
metadata/_edit_use_anchors_ = true
[node name="ndiEnabledCheck" type="CheckBox" parent="NDIOutput"]
offset_left = 130.0
offset_top = 1.0
offset_top = 38.0
offset_right = 154.0
offset_bottom = 25.0
metadata/_edit_use_anchors_ = true
[node name="SourceNameLabel" type="Label" parent="NDIOutput"]
offset_top = 32.0
offset_right = 100.0
offset_bottom = 50.0
text = "source name:"
offset_bottom = 62.0
metadata/_edit_use_anchors_ = true
[node name="ndiSourceName" type="LineEdit" parent="NDIOutput"]
offset_left = 105.0
offset_top = 30.0
offset_right = 250.0
offset_bottom = 52.0
offset_top = 64.0
offset_right = 145.0
offset_bottom = 95.0
text = "PNGTuber-Plus"
metadata/_edit_use_anchors_ = true
[node name="AudioLabel" type="Label" parent="NDIOutput"]
offset_top = 60.0
offset_right = 100.0
offset_bottom = 78.0
text = "include audio:"
metadata/_edit_use_anchors_ = true
[node name="ndiAudioCheck" type="CheckBox" parent="NDIOutput"]
offset_left = 130.0
offset_top = 58.0
offset_right = 154.0
offset_bottom = 82.0
metadata/_edit_use_anchors_ = true
[node name="StatusLabel" type="Label" parent="NDIOutput"]
offset_top = 88.0
offset_right = 200.0
offset_bottom = 106.0
offset_left = 4.0
offset_top = 100.0
offset_right = 204.0
offset_bottom = 123.0
text = "Status: Not streaming"
metadata/_edit_use_anchors_ = true
[node name="toggleButton" type="Button" parent="NDIOutput"]
offset_left = 260.0
offset_top = 85.0
offset_right = 340.0
offset_bottom = 110.0
text = "Start NDI"
metadata/_edit_use_anchors_ = true
[node name="bounceOnCostume" type="Node2D" parent="."]
position = Vector2(17, 565)
position = Vector2(-172, 122)
[node name="Label" type="Label" parent="bounceOnCostume"]
offset_right = 138.0
@@ -14462,13 +14435,13 @@ value = 1000.0
scrollable = false
[node name="CostumeInputs" type="Node2D" parent="."]
position = Vector2(404, 305)
position = Vector2(49, 408)
[node name="ScrollContainer" type="ScrollContainer" parent="CostumeInputs"]
offset_left = -226.0
offset_top = -78.0
offset_right = 7.0
offset_bottom = 123.0
offset_top = -125.0
offset_right = 354.0
offset_bottom = 39.0
horizontal_scroll_mode = 0
[node name="VBoxContainer" type="VBoxContainer" parent="CostumeInputs/ScrollContainer"]
@@ -14905,15 +14878,8 @@ position = Vector2(-2, -2)
texture = ExtResource("9_lywmf")
centered = false
[node name="Label" type="Label" parent="CostumeInputs"]
offset_left = -179.0
offset_top = -109.0
offset_right = -41.0
offset_bottom = -75.0
text = "costume hotkeys"
[node name="BlinkSpeed" type="Node2D" parent="."]
position = Vector2(17, 253)
position = Vector2(227, 205)
[node name="Label" type="Label" parent="BlinkSpeed"]
offset_left = -10.0
@@ -14970,6 +14936,8 @@ metadata/_edit_use_anchors_ = true
[connection signal="toggled" from="StreamDeck/streamDeckCheck" to="." method="_on_stream_deck_check_toggled"]
[connection signal="toggled" from="experimentalMicLoudness/checkmark" to="." method="_on_experimental_mic_loudness_toggle"]
[connection signal="toggled" from="AntiAliasing/CheckBox" to="." method="_on_check_box_toggled"]
[connection signal="toggled" from="NDIOutput/ndiEnabledCheck" to="." method="_on_ndi_enabled_check_toggled"]
[connection signal="text_changed" from="NDIOutput/ndiSourceName" to="." method="_on_ndi_source_name_text_changed"]
[connection signal="toggled" from="bounceOnCostume/costumeCheck" to="." method="_on_costume_check_toggled"]
[connection signal="value_changed" from="BounceForce/bounceForce" to="." method="_on_bounce_force_value_changed"]
[connection signal="value_changed" from="BounceGravity/bounceGravity" to="." method="_on_bounce_gravity_value_changed"]
@@ -14995,7 +14963,3 @@ metadata/_edit_use_anchors_ = true
[connection signal="pressed" from="CostumeInputs/ScrollContainer/VBoxContainer/costumeButton10/delete10" to="." method="_on_delete_10_pressed"]
[connection signal="value_changed" from="BlinkSpeed/blinkSpeed" to="." method="_on_blink_speed_value_changed"]
[connection signal="value_changed" from="BlinkChance/blinkChance" to="." method="_on_blink_chance_value_changed"]
[connection signal="toggled" from="NDIOutput/ndiEnabledCheck" to="." method="_on_ndi_enabled_check_toggled"]
[connection signal="text_changed" from="NDIOutput/ndiSourceName" to="." method="_on_ndi_source_name_text_changed"]
[connection signal="toggled" from="NDIOutput/ndiAudioCheck" to="." method="_on_ndi_audio_check_toggled"]
[connection signal="pressed" from="NDIOutput/toggleButton" to="." method="_on_ndi_toggle_button_pressed"]