Re-Enabled streamdeck plugin

This commit is contained in:
2025-07-19 18:23:35 +10:00
parent 1ad3dc37ec
commit 7f9b652918
6 changed files with 96 additions and 18 deletions

View File

@@ -1,9 +1,15 @@
extends Node2D
var awaitingCostumeInput = -1
## Settings Menu Controller
##
## Manages the settings UI and user preferences for the PNGTuber application.
## Handles various settings including background color, FPS, bounce physics,
## costume keys, and StreamDeck integration.
var awaitingCostumeInput = -1
var hasMouse = false
## Initialize all setting values to match current configuration
func setvalues():
$Background/ColorPickerButton.color = Global.backgroundColor
@@ -32,6 +38,8 @@ func setvalues():
$bounceOnCostume/costumeCheck.button_pressed = Global.main.bounceOnCostumeChange
$StreamDeck/streamDeckCheck.button_pressed = Saving.settings["useStreamDeck"]
var costumeLabels = [$CostumeInputs/ScrollContainer/VBoxContainer/costumeButton1/Label,$CostumeInputs/ScrollContainer/VBoxContainer/costumeButton2/Label,$CostumeInputs/ScrollContainer/VBoxContainer/costumeButton3/Label,$CostumeInputs/ScrollContainer/VBoxContainer/costumeButton4/Label,$CostumeInputs/ScrollContainer/VBoxContainer/costumeButton5/Label,$CostumeInputs/ScrollContainer/VBoxContainer/costumeButton6/Label,$CostumeInputs/ScrollContainer/VBoxContainer/costumeButton7/Label,$CostumeInputs/ScrollContainer/VBoxContainer/costumeButton8/Label,$CostumeInputs/ScrollContainer/VBoxContainer/costumeButton9/Label,$CostumeInputs/ScrollContainer/VBoxContainer/costumeButton10/Label,]
var tag = 1
for label in costumeLabels:
@@ -190,6 +198,14 @@ func _on_costume_check_toggled(button_pressed):
Global.main.bounceOnCostumeChange = button_pressed
Saving.settings["bounceOnCostumeChange"] = button_pressed
## Handle StreamDeck integration toggle
## @param button_pressed: bool - Whether StreamDeck should be enabled
func _on_stream_deck_check_toggled(button_pressed):
Saving.settings["useStreamDeck"] = button_pressed
if ElgatoStreamDeck:
ElgatoStreamDeck.refresh_connection()
Global.pushUpdate("StreamDeck integration " + ("enabled" if button_pressed else "disabled") + ".")
func _process(delta):
var g = to_local(get_global_mouse_position())

View File

@@ -14183,7 +14183,7 @@ script = ExtResource("1_ckdhy")
[node name="NinePatchRect" type="NinePatchRect" parent="."]
offset_right = 419.0
offset_bottom = 423.0
offset_bottom = 444.0
texture = ExtResource("1_ylauk")
region_rect = Rect2(0, 0, 48, 48)
patch_margin_left = 8
@@ -14288,9 +14288,23 @@ offset_right = 378.0
offset_bottom = 28.0
text = "confirm"
[node name="AntiAliasing" type="Node2D" parent="."]
[node name="StreamDeck" type="Node2D" parent="."]
position = Vector2(16, 373)
[node name="Label" type="Label" parent="StreamDeck"]
offset_right = 138.0
offset_bottom = 34.0
text = "use streamdeck"
[node name="streamDeckCheck" type="CheckBox" parent="StreamDeck"]
offset_left = 130.0
offset_top = 1.0
offset_right = 154.0
offset_bottom = 25.0
[node name="AntiAliasing" type="Node2D" parent="."]
position = Vector2(16, 405)
[node name="Label" type="Label" parent="AntiAliasing"]
offset_right = 138.0
offset_bottom = 34.0
@@ -14373,7 +14387,7 @@ position = Vector2(404, 305)
offset_left = -226.0
offset_top = -78.0
offset_right = 7.0
offset_bottom = 103.0
offset_bottom = 123.0
horizontal_scroll_mode = 0
[node name="VBoxContainer" type="VBoxContainer" parent="CostumeInputs/ScrollContainer"]
@@ -14868,6 +14882,7 @@ scrollable = false
[connection signal="picker_created" from="Background/ColorPickerButton" to="." method="_on_color_picker_button_picker_created"]
[connection signal="value_changed" from="MaxFPS/fpsDrag" to="." method="_on_fps_drag_value_changed"]
[connection signal="pressed" from="MaxFPS/confirm" to="." method="_on_confirm_pressed"]
[connection signal="toggled" from="StreamDeck/streamDeckCheck" to="." method="_on_stream_deck_check_toggled"]
[connection signal="toggled" from="AntiAliasing/CheckBox" to="." method="_on_check_box_toggled"]
[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"]