Skip to content

Commit af48ace

Browse files
author
Liam Sherwin
committed
Added CueSheet UIPanel
1 parent f12affa commit af48ace

File tree

14 files changed

+820
-49
lines changed

14 files changed

+820
-49
lines changed

components/CueItem/CueItem.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ func _on_active_cue_changed(cue: Cue) -> void:
151151

152152
elif _is_enabled:
153153
var fade_time: float = 0
154-
fade_time = _cue_list.get_global_fade_speed() if _cue_list.get_global_fade_state() else _cue.get_fade_time()
154+
fade_time = _cue_list.get_global_fade_speed() if _cue_list.get_global_fade_state() else cue.get_fade_time()
155155

156156
set_status_bar(false, fade_time)
157157
$Selected.hide()

components/IntensityButton/IntensityButton.gd

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,23 @@ class_name IntensityButton extends Button
1515
## The function to control
1616
var function: Function = null : set = set_function
1717

18-
1918
## The last value used
2019
var _last_value: float = 0
2120

2221

2322
## Disable the process at startup
24-
func _ready() -> void: set_process(false)
23+
func _ready() -> void:
24+
set_process(false)
2525

2626

2727
## Sets the function
2828
func set_function(p_function: Function) -> void:
29-
if is_instance_valid(function): function.intensity_changed.disconnect(_on_function_intensity_changed)
29+
if is_instance_valid(function):
30+
function.intensity_changed.disconnect(_on_function_intensity_changed)
31+
3032
function = p_function
33+
disabled = not is_instance_valid(function)
34+
3135
if is_instance_valid(function):
3236
function.intensity_changed.connect(_on_function_intensity_changed)
3337
$ProgressBar.value = function.get_intensity()

core/components/containers/Cue.gd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ func set_tracking_mode(p_tracking_mode: TrackingMode) -> Promise:
9393
func get_qid() -> String:
9494
return _qid
9595

96+
9697
## Returns the fade time in seconds
9798
func get_fade_time() -> float:
9899
return _fade_time

core/components/containers/DataContainer.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func _store_item(p_item: ContainerItem, no_signal: bool = false) -> bool:
128128
_items.append(p_item)
129129
_fixture.get_or_add(p_item.get_fixture(), {}).get_or_add(p_item.get_zone(), {})[p_item.get_parameter()] = p_item
130130

131-
ComponentDB.register_component(p_item)
131+
#ComponentDB.register_component(p_item)
132132
p_item.delete_requested.connect(_erase_item.bind(p_item))
133133

134134
if not no_signal:

core/components/functions/CueList.gd

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func _component_ready() -> void:
8181
register_callback("on_loop_mode_changed", _set_loop_mode)
8282
register_callback("on_cues_added", _add_cues)
8383
register_callback("on_cues_removed", _remove_cues)
84-
register_callback("cue_order_changed", _set_cue_position)
84+
register_callback("on_cue_order_changed", _set_cue_position)
8585

8686
register_control_method("go_previous", go_previous)
8787
register_control_method("go_next", go_next)
@@ -153,6 +153,11 @@ func get_loop_mode() -> LoopMode:
153153
return _loop_mode
154154

155155

156+
## Gets the position of a cue
157+
func get_cue_position(p_cue: Cue) -> int:
158+
return _cues.find(p_cue)
159+
160+
156161
## Gets whether triggered cues can loop back to the start
157162
func get_allow_triggered_looping() -> bool:
158163
return _allow_triggered_looping
@@ -178,6 +183,11 @@ func get_global_pre_wait_speed() -> float:
178183
return _global_pre_wait
179184

180185

186+
## Gets the active cue, or null
187+
func get_active_cue() -> Cue:
188+
return _active_cue
189+
190+
181191
## Server: Seeks to the next cue in the list
182192
func go_next() -> Promise:
183193
return rpc("go_next", [])
@@ -247,15 +257,15 @@ func _remove_cues(p_cues: Array) -> void:
247257

248258

249259
## Internal: Sets the position of a cue in the list
250-
func _set_cue_position(cue: Cue, position: int) -> void:
251-
if cue not in _cues:
260+
func _set_cue_position(p_cue: Cue, p_position: int) -> void:
261+
if p_cue not in _cues or p_position > len(_cues):
252262
return
253263

254-
var old_index: int = _cues.find(cue)
255-
_cues.insert(position, cue)
264+
var old_index: int = _cues.find(p_cue)
256265
_cues.remove_at(old_index)
266+
_cues.insert(p_position, p_cue)
257267

258-
cue_order_changed.emit(cue, position)
268+
cue_order_changed.emit(p_cue, p_position)
259269

260270

261271
## Internal: Sets whether triggered cues can loop back to the start
@@ -339,8 +349,13 @@ func _load_request(serialized_data: Dictionary) -> void:
339349
_global_pre_wait = type_convert(serialized_data.get("global_pre_wait", _global_pre_wait), TYPE_FLOAT)
340350
_allow_triggered_looping = type_convert(serialized_data.get("allow_triggered_looping", _allow_triggered_looping), TYPE_BOOL)
341351
_loop_mode = type_convert(serialized_data.get("loop_mode", _loop_mode), TYPE_INT)
342-
352+
343353
_add_cues(Utils.deseralise_component_array(type_convert(serialized_data.get("cues", []), TYPE_ARRAY)))
354+
355+
var active_cue: EngineComponent = ComponentDB.get_component(type_convert(serialized_data.get("active_cue_uuid", ""), TYPE_STRING))
356+
357+
if _cues.has(active_cue):
358+
_active_cue = active_cue
344359

345360

346361
## Called when this CueList is to be deleted

core/types/RefMap.gd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ var _left: Dictionary = {}
1212
var _right: Dictionary = {}
1313

1414

15+
## Init
16+
func _init(left_type: Variant = null, right_type: Variant = null) -> void:
17+
pass
18+
19+
1520
## Maps 2 items, returning false if the map failed
1621
func map(left: Variant, right: Variant) -> void:
1722
_left[left] = right

panels/CuePlayback/CuePlayback.gd

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ var _signal_connections: Dictionary = {
2929
"cues_added": _reload_cues,
3030
"cues_removed": _reload_cues,
3131
"active_cue_changed": _scroll_to_cue,
32+
"cue_order_changed": _move_cue_to,
3233
"delete_request": set_cue_list.bind(null)
3334
}
3435

@@ -69,6 +70,12 @@ func _scroll_to_cue(p_cue: Cue) -> void:
6970
_cue_container.get_parent_control().scroll_vertical = cue_item.position.y - cue_item.size.y
7071

7172

73+
## Moves a given cue to a given position
74+
func _move_cue_to(p_cue: Cue, p_position: int) -> void:
75+
var cue_item: CueItem = _cues[p_cue.uuid]
76+
_cue_container.move_child(cue_item, p_position)
77+
78+
7279
## Called when the Go Previous button is pressed
7380
func _on_previous_pressed() -> void:
7481
_cue_list.go_previous()

0 commit comments

Comments
 (0)