mirror of
https://codeberg.org/StreamGraph/StreamGraph.git
synced 2024-11-13 19:49:55 +01:00
save selected scene in obs scene list node renderer
This commit is contained in:
parent
1326b3bfad
commit
85b2181622
3 changed files with 13 additions and 2 deletions
|
@ -2,6 +2,7 @@ extends DeckNode
|
|||
|
||||
var noobs: NoOBSWS
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
name = "Scene Selector"
|
||||
node_type = "obs_scene_list"
|
||||
|
|
|
@ -27,6 +27,8 @@ var index: int
|
|||
## The value of this port.
|
||||
var value: Variant: set = set_value
|
||||
|
||||
signal value_updated(new_value: Variant)
|
||||
|
||||
|
||||
func _init(
|
||||
p_type: DeckType.Types,
|
||||
|
@ -50,6 +52,8 @@ func _init(
|
|||
func set_value(v: Variant) -> void:
|
||||
if v is Callable:
|
||||
value = v.call()
|
||||
value_updated.emit(value)
|
||||
return
|
||||
|
||||
value = v
|
||||
value_updated.emit(value)
|
||||
|
|
|
@ -92,8 +92,14 @@ func update_port(port: Port) -> void:
|
|||
line_edit.text_changed.connect(port.set_value)
|
||||
"singlechoice":
|
||||
var box := OptionButton.new()
|
||||
for item in descriptor_split.slice(1):
|
||||
box.add_item(item)
|
||||
if descriptor_split.slice(1).is_empty():
|
||||
if port.value:
|
||||
box.add_item(port.value)
|
||||
else:
|
||||
box.add_item(port.label)
|
||||
else:
|
||||
for item in descriptor_split.slice(1):
|
||||
box.add_item(item)
|
||||
add_child(box)
|
||||
port.value_callback = func(): return box.get_item_text(box.get_selected_id())
|
||||
if port.type == DeckType.Types.STRING:
|
||||
|
|
Loading…
Reference in a new issue