Skip to content

Commit 7dabf4c

Browse files
Input shortcuts, cue merging, and VF fixes
1 parent 5ac8e5c commit 7dabf4c

File tree

14 files changed

+88
-12
lines changed

14 files changed

+88
-12
lines changed

assets/icons/remove.svg.import

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
importer="texture"
44
type="CompressedTexture2D"
55
uid="uid://b2irkd31agi0x"
6-
path="res://.godot/imported/remove.svg-4d209cc049dad917abe1dad4ca8edd56.ctex"
6+
path="res://.godot/imported/Remove.svg-d6b561eec13de9ed9a6b262ecffa42bf.ctex"
77
metadata={
88
"vram_texture": false
99
}
1010

1111
[deps]
1212

13-
source_file="res://assets/icons/remove.svg"
14-
dest_files=["res://.godot/imported/remove.svg-4d209cc049dad917abe1dad4ca8edd56.ctex"]
13+
source_file="res://assets/icons/Remove.svg"
14+
dest_files=["res://.godot/imported/Remove.svg-d6b561eec13de9ed9a6b262ecffa42bf.ctex"]
1515

1616
[params]
1717

components/ComponentMethodPicker/ComponentMethodPicker.tscn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[ext_resource type="Theme" uid="uid://cyua45ur0ijqo" path="res://assets/Main.theme" id="1_fsimf"]
44
[ext_resource type="Texture2D" uid="uid://rqf8w11gk6ud" path="res://assets/icons/Edit.svg" id="2_31l28"]
5-
[ext_resource type="Script" path="res://components/ComponentMethodPicker/ComponentMethodPicker.gd" id="2_nh1rv"]
5+
[ext_resource type="Script" uid="uid://dxl21h3kaey1t" path="res://components/ComponentMethodPicker/ComponentMethodPicker.gd" id="2_nh1rv"]
66
[ext_resource type="Texture2D" uid="uid://bi4ttx5uklwl7" path="res://assets/icons/Check.svg" id="3_hdv2q"]
77
[ext_resource type="Texture2D" uid="uid://b3hmh5jlggqxa" path="res://assets/icons/cross.svg" id="4_h27m0"]
88
[ext_resource type="Texture2D" uid="uid://dfrrs2dnvlvsu" path="res://assets/icons/Delete.svg" id="5_54dlw"]

components/CueItem/CueItem.gd

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ var _current_tween: Tween = null
3333
"PreWait": $VBoxContainer/HBoxContainer/VBoxContainer2/HBoxContainer/PanelContainer4/HBoxContainer/PreWait,
3434
}
3535

36+
37+
func _ready() -> void:
38+
Programmer.store_mode_changed.connect(_on_store_mode_changed)
39+
3640
## Sets the cue represented by this CueItem
3741
func set_cue(cue: Cue, cue_list: CueList) -> void:
3842
if _cue_list: _cue_list.cue_changed.disconnect(_on_cue_number_changed)
@@ -110,6 +114,11 @@ func set_trigger_mode(trigger_mode: int) -> void:
110114
Cue.TRIGGER_MODE.WITH_LAST: $VBoxContainer/HBoxContainer/VBoxContainer2/HBoxContainer/PanelContainer/VBoxContainer/WithLast.show()
111115

112116

117+
## Called when store mode is changed
118+
func _on_store_mode_changed(store_mode: bool, class_hint: String) -> void:
119+
$StoreMode.visible = store_mode
120+
121+
113122
## Called when an input event is decected in the panel
114123
func _on_gui_input(event: InputEvent) -> void:
115124
if event is InputEventMouseButton:
@@ -121,3 +130,6 @@ func _on_gui_input(event: InputEvent) -> void:
121130

122131
else:
123132
clicked.emit()
133+
134+
if Programmer.get_store_mode():
135+
Programmer.resolve_store_mode(_cue)

components/CueItem/CueItem.tscn

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
[gd_scene load_steps=14 format=3 uid="uid://owx4rxrtg50d"]
1+
[gd_scene load_steps=15 format=3 uid="uid://cd6jlfv6bfubw"]
22

33
[ext_resource type="Theme" uid="uid://cyua45ur0ijqo" path="res://assets/Main.theme" id="1_t3b7b"]
44
[ext_resource type="Texture2D" uid="uid://cxtdx7cj44nk" path="res://assets/icons/Touch.svg" id="1_yeptw"]
55
[ext_resource type="Texture2D" uid="uid://gntqv7ddcqvv" path="res://assets/icons/Fade.svg" id="2_2p1lo"]
6-
[ext_resource type="Script" path="res://components/CueItem/CueItem.gd" id="2_aostn"]
6+
[ext_resource type="Script" uid="uid://dhbb4w3i6cv8f" path="res://components/CueItem/CueItem.gd" id="2_aostn"]
77
[ext_resource type="Texture2D" uid="uid://txqtfrlvm3r7" path="res://assets/icons/ReturnFlipped.svg" id="2_dbt18"]
88
[ext_resource type="Texture2D" uid="uid://doaysnonvo60k" path="res://assets/icons/PreWait.svg" id="3_ns1ii"]
99
[ext_resource type="Texture2D" uid="uid://03gtlskodjas" path="res://assets/icons/Cue.svg" id="3_u1n7c"]
@@ -26,6 +26,18 @@ corner_radius_top_right = 5
2626
corner_radius_bottom_right = 5
2727
corner_radius_bottom_left = 5
2828

29+
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_vgny8"]
30+
bg_color = Color(0.701961, 0.0156863, 1, 0.156863)
31+
border_width_left = 2
32+
border_width_top = 2
33+
border_width_right = 2
34+
border_width_bottom = 2
35+
border_color = Color(0.701961, 0.0156863, 1, 1)
36+
corner_radius_top_left = 3
37+
corner_radius_top_right = 3
38+
corner_radius_bottom_right = 3
39+
corner_radius_bottom_left = 3
40+
2941
[sub_resource type="LabelSettings" id="LabelSettings_odw3y"]
3042
font_color = Color(0.707967, 0.707967, 0.707967, 1)
3143

@@ -49,6 +61,12 @@ theme = ExtResource("1_t3b7b")
4961
theme_override_styles/panel = SubResource("StyleBoxFlat_lrd3y")
5062
script = ExtResource("2_aostn")
5163

64+
[node name="StoreMode" type="Panel" parent="."]
65+
visible = false
66+
layout_mode = 2
67+
mouse_filter = 1
68+
theme_override_styles/panel = SubResource("StyleBoxFlat_vgny8")
69+
5270
[node name="VBoxContainer" type="VBoxContainer" parent="."]
5371
layout_mode = 2
5472

components/TriggerButton/TriggerButton.gd

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ func make_dummy_of(master_trigger: TriggerButton) -> void:
150150

151151
## Adds an input event as a shortcut
152152
func add_shortcut(event: InputEvent) -> void:
153-
shortcut.events.append(event)
153+
shortcut.events = [event]
154154
shortcut_added.emit(event)
155155

156156

@@ -170,6 +170,13 @@ func _on_button_up() -> void:
170170
_button_up_trigger.call_method()
171171

172172

173+
## Called when the button is pressed
174+
func _on_pressed() -> void:
175+
_on_button_down()
176+
await get_tree().create_timer(0.01).timeout
177+
_on_button_up()
178+
179+
173180
## Called when this button is toggled in toggle mode, will call the corresponding _on_button_* method
174181
func _on_button_toggled(toggled_on: bool) -> void:
175182
if toggled_on:

components/TriggerButton/TriggerButton.tscn

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[gd_scene load_steps=6 format=3 uid="uid://c2c3t6jriymr6"]
22

3-
[ext_resource type="Script" path="res://components/TriggerButton/TriggerButton.gd" id="1_3rl6v"]
3+
[ext_resource type="Script" uid="uid://cdy72t0e4kh8p" path="res://components/TriggerButton/TriggerButton.gd" id="1_3rl6v"]
44
[ext_resource type="Theme" uid="uid://cyua45ur0ijqo" path="res://assets/Main.theme" id="1_v6l20"]
55

66
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_rpw8u"]
@@ -73,4 +73,5 @@ text_overrun_behavior = 3
7373

7474
[connection signal="button_down" from="." to="." method="_on_button_down"]
7575
[connection signal="button_up" from="." to="." method="_on_button_up"]
76+
[connection signal="pressed" from="." to="." method="_on_pressed"]
7677
[connection signal="resized" from="." to="." method="_on_resized"]

components/TriggerButtonSettings/TriggerButtonSettings.gd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,4 +141,7 @@ func _on_component_method_picker_method_confired(method_trigger: MethodTrigger)
141141
## Called when a shortcut is added
142142
func _on_add_shortcut_button_shortcut_changed(input_event: InputEvent) -> void:
143143
if trigger_button:
144+
input_event.device = -1
145+
#input_event.physical_keycode = 0
146+
#input_event.key_label = 0
144147
trigger_button.add_shortcut(input_event)

core/components/fixtures/DMXFixture.gd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ class_name DMXFixture extends Fixture
88
## Emitted when the channel is changed
99
signal channel_changed(channel: int)
1010

11+
## Emitted when the manifest is changed
12+
signal manifest_changed(manifest: FixtureManifest)
13+
1114

1215
## The DMX channel of this fixture
1316
var _channel: int = 0
@@ -92,6 +95,8 @@ func get_manifest() -> FixtureManifest:
9295
func _set_manifest(p_manifest: FixtureManifest, p_mode: String) -> void:
9396
_mode = p_mode
9497
_manifest = p_manifest
98+
99+
manifest_changed.emit(_manifest)
95100

96101

97102
## Gets all the override values

panels/Functions/Functions.gd

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ class_name UIFunctions extends UIPanel
1212
@export var _component_list: ComponentList
1313

1414

15+
16+
func _input(event: InputEvent) -> void:
17+
if event is InputEventKey and event.is_pressed():
18+
print(var_to_str(event))
19+
print("Shortcut:", var_to_str($VBoxContainer/HBoxContainer/VBoxContainer/PanelContainer/HBoxContainer/Create.shortcut.events[0]))
20+
21+
1522
## Called when the Create button is pressed
1623
func _on_create_pressed() -> void:
1724
Interface.show_create_component(CreateComponent.Mode.Component, "Function", true)

panels/Functions/Functions.tscn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[ext_resource type="StyleBox" uid="uid://daxhx5qr5qdeu" path="res://assets/styles/SolidPanel.tres" id="1_es5ky"]
44
[ext_resource type="Script" uid="uid://byqpqgm3d03aq" path="res://panels/Functions/Functions.gd" id="2_bfwkh"]
5-
[ext_resource type="PackedScene" uid="uid://dr0kfolsg46yu" path="res://components/PanelMenuBar.tscn" id="3_rou2v"]
5+
[ext_resource type="PackedScene" path="res://components/PanelMenuBar.tscn" id="3_rou2v"]
66
[ext_resource type="PackedScene" uid="uid://c4vlxpk3ywg42" path="res://components/ComponentList/ComponentList.tscn" id="4_bosbs"]
77
[ext_resource type="Texture2D" uid="uid://bbennjke0ioen" path="res://assets/icons/Add.svg" id="5_7afv4"]
88
[ext_resource type="PackedScene" uid="uid://dwtaoj1uy0dok" path="res://components/ComponentSettings/ComponentSettings.tscn" id="5_re3nl"]

panels/NewCuePlayback/NewCuePlayback.gd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ var _cues: Dictionary = {}
2525
var _previous_uuid: String = ""
2626

2727
var _signal_connections: Dictionary = {
28-
"cues_added": _reload_cues
28+
"cues_added": _reload_cues,
29+
"cues_removed": _reload_cues
2930
}
3031

3132
## Sets the cuelist to control

panels/NewCuePlayback/NewCuePlayback.tscn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[ext_resource type="Theme" uid="uid://cyua45ur0ijqo" path="res://assets/Main.theme" id="1_u3x3w"]
44
[ext_resource type="Script" uid="uid://b014dpwwf0a4j" path="res://panels/NewCuePlayback/NewCuePlayback.gd" id="2_4bo1g"]
55
[ext_resource type="StyleBox" uid="uid://daxhx5qr5qdeu" path="res://assets/styles/SolidPanel.tres" id="2_bilu6"]
6-
[ext_resource type="Script" uid="uid://bcsro4uc8aseb" path="res://panels/NewCuePlayback/Controls.gd" id="3_ijo7h"]
6+
[ext_resource type="Script" uid="uid://cpkbkcmifpr2n" path="res://panels/NewCuePlayback/Controls.gd" id="3_ijo7h"]
77
[ext_resource type="Texture2D" uid="uid://dnfqijjcnit7c" path="res://assets/icons/CueList.svg" id="3_qadkc"]
88
[ext_resource type="Texture2D" uid="uid://c1cl6qetwg8st" path="res://assets/icons/Arrow_back.svg" id="3_v1amt"]
99
[ext_resource type="StyleBox" uid="uid://csle20exwqtti" path="res://assets/styles/PanelMenuBar.tres" id="4_4ngmv"]

panels/VirtualFixtures/VirtualFixture/VirtualFixture.gd

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ var _fixture_signal_connections: Dictionary = {
3737
"all_override_removed": _on_override_value_erased,
3838
"parameter_changed": _on_parameter_changed,
3939
"parameter_erased": _on_parameter_eraced,
40+
"manifest_changed": _on_dmx_fixture_manifest_changed
4041
}
4142

4243

@@ -102,6 +103,10 @@ func render_color():
102103
else:
103104
base_color = Color.BLACK
104105

106+
if _fixture is DMXFixture and not _fixture.get_manifest():
107+
base_color = Color.BLACK
108+
109+
105110
set_color(base_color)
106111

107112

@@ -153,6 +158,11 @@ func _on_override_value_erased(parameter: String = "", zone: String = "") -> voi
153158
render_color()
154159

155160

161+
## Called when the manifest is changed on a DMXFixture
162+
func _on_dmx_fixture_manifest_changed(manifest: FixtureManifest):
163+
render_color()
164+
165+
156166
func _on_gui_input(event: InputEvent) -> void:
157167
if event is InputEventMouseMotion and event.button_mask == MOUSE_BUTTON_MASK_LEFT:
158168
move_requested.emit(event.relative)

panels/VirtualFixtures/VirtualFixtures.gd

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,10 @@ func _on_grid_align_pressed() -> void:
108108
func _save() -> Dictionary:
109109
if fixture_container.fixture_group:
110110
return {
111-
"fixture_group": fixture_container.fixture_group.uuid
111+
"fixture_group": fixture_container.fixture_group.uuid,
112+
"scroll_h": real_scroll.scroll_horizontal,
113+
"scroll_v": real_scroll.scroll_vertical,
114+
"zoom": fixture_container.scale.x
112115
}
113116
else:
114117
return {}
@@ -121,6 +124,15 @@ func _load(saved_data) -> void:
121124
if fixture_group is FixtureGroup:
122125
fixture_container.set_fixture_group(fixture_group)
123126
)
127+
128+
real_scroll.scroll_horizontal = type_convert(saved_data.get("scroll_h"), TYPE_INT)
129+
real_scroll.scroll_vertical = type_convert(saved_data.get("scroll_v"), TYPE_INT)
130+
131+
fixture_container.scale = Vector2(
132+
type_convert(saved_data.get("zoom"), TYPE_FLOAT),
133+
type_convert(saved_data.get("zoom"), TYPE_FLOAT)
134+
)
135+
124136

125137

126138
func _on_table_gui_input(event: InputEvent) -> void:

0 commit comments

Comments
 (0)