|
@@ -6,6 +6,10 @@ signal open_help(command)
|
|
|
|
|
|
|
|
|
|
|
|
|
func _ready() -> void:
|
|
func _ready() -> void:
|
|
|
|
|
+
|
|
|
|
|
+ $"Control/select_effect/Time Domain".show()
|
|
|
|
|
+ $"Control/select_effect/Time Domain/Distort".show()
|
|
|
|
|
+ $"Control/select_effect/Frequency Domain/Convert".show()
|
|
|
#parse json
|
|
#parse json
|
|
|
var file = FileAccess.open("res://scenes/main/process_help.json", FileAccess.READ)
|
|
var file = FileAccess.open("res://scenes/main/process_help.json", FileAccess.READ)
|
|
|
if file:
|
|
if file:
|
|
@@ -93,52 +97,76 @@ func fill_menu():
|
|
|
|
|
|
|
|
|
|
|
|
|
func _on_about_to_popup() -> void:
|
|
func _on_about_to_popup() -> void:
|
|
|
- fill_menu() #populate menu when needed
|
|
|
|
|
|
|
+ fill_search("")
|
|
|
|
|
+ $"Control/select_effect/Search/Search for a process in SoundThread/MarginContainer/VBoxContainer/SearchBar".clear()
|
|
|
|
|
+ if $Control/select_effect.current_tab == 3:
|
|
|
|
|
+ $"Control/select_effect/Search/Search for a process in SoundThread/MarginContainer/VBoxContainer/SearchBar".grab_focus()
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
-#func display_items(filter: String):
|
|
|
|
|
- ## Remove all existing items from the VBoxContainer
|
|
|
|
|
- ##for child in item_container.get_children():
|
|
|
|
|
- ##child.queue_free()
|
|
|
|
|
- #for key in node_data.keys():
|
|
|
|
|
- #var item = node_data[key]
|
|
|
|
|
- #var title = item.get("title", "")
|
|
|
|
|
- #
|
|
|
|
|
- ##filter out input and output nodes
|
|
|
|
|
- #if title == "Input File" or title == "Output File":
|
|
|
|
|
- #continue
|
|
|
|
|
- #
|
|
|
|
|
- #var category = item.get("category", "")
|
|
|
|
|
- #var subcategory = item.get("subcategory", "")
|
|
|
|
|
- #var short_desc = item.get("short_description", "")
|
|
|
|
|
- #
|
|
|
|
|
- ## If filter is not empty, skip non-matches populate all other buttons
|
|
|
|
|
- #if filter != "":
|
|
|
|
|
- #var filter_lc = filter.to_lower()
|
|
|
|
|
- #if not (filter_lc in title.to_lower() or filter_lc in short_desc.to_lower() or filter_lc in category.to_lower() or filter_lc in subcategory.to_lower()):
|
|
|
|
|
- #continue
|
|
|
|
|
- #
|
|
|
|
|
- #var btn = Button.new()
|
|
|
|
|
- #btn.size_flags_horizontal = Control.SIZE_EXPAND_FILL #make buttons wide
|
|
|
|
|
- #btn.alignment = 0 #left align text
|
|
|
|
|
- #btn.clip_text = true #clip off labels that are too long
|
|
|
|
|
- #btn.text_overrun_behavior = TextServer.OVERRUN_TRIM_ELLIPSIS #and replace with ...
|
|
|
|
|
- #if category.to_lower() == "pvoc": #format node names correctly, only show the category for PVOC
|
|
|
|
|
- #btn.text = "%s %s: %s - %s" % [category.to_upper(), subcategory.to_pascal_case(), title, short_desc]
|
|
|
|
|
- #else:
|
|
|
|
|
- #btn.text = "%s: %s - %s" % [subcategory.to_pascal_case(), title, short_desc]
|
|
|
|
|
- #btn.connect("pressed", Callable(self, "_on_item_selected").bind(key)) #pass key (process name) when button is pressed
|
|
|
|
|
- #item_container.add_child(btn)
|
|
|
|
|
- #
|
|
|
|
|
- ##resize menu within certain bounds #50
|
|
|
|
|
- #await get_tree().process_frame
|
|
|
|
|
- #if DisplayServer.screen_get_scale() > 1:
|
|
|
|
|
- #self.size.y = min((item_container.size.y * DisplayServer.screen_get_scale()) + search_bar.size.y + 50, 410 * DisplayServer.screen_get_scale()) #i think this will scale for retina screens but might be wrong
|
|
|
|
|
- #else:
|
|
|
|
|
- #self.size.y = min(item_container.size.y + search_bar.size.y + 12, 410)
|
|
|
|
|
|
|
+
|
|
|
|
|
+func fill_search(filter: String):
|
|
|
|
|
+ # Remove all existing items from the VBoxContainer
|
|
|
|
|
+ var container = $"Control/select_effect/Search/Search for a process in SoundThread/MarginContainer/VBoxContainer/ScrollContainer/ItemContainer"
|
|
|
|
|
+ for child in container.get_children():
|
|
|
|
|
+ child.queue_free()
|
|
|
|
|
+ for key in node_data.keys():
|
|
|
|
|
+ var item = node_data[key]
|
|
|
|
|
+ var title = item.get("title", "")
|
|
|
|
|
+
|
|
|
|
|
+ #filter out input and output nodes
|
|
|
|
|
+ if title == "Input File" or title == "Output File":
|
|
|
|
|
+ continue
|
|
|
|
|
+
|
|
|
|
|
+ var category = item.get("category", "")
|
|
|
|
|
+ var subcategory = item.get("subcategory", "")
|
|
|
|
|
+ var short_desc = item.get("short_description", "")
|
|
|
|
|
+
|
|
|
|
|
+ # If filter is not empty, skip non-matches populate all other buttons
|
|
|
|
|
+ if filter != "":
|
|
|
|
|
+ var filter_lc = filter.to_lower()
|
|
|
|
|
+ if not (filter_lc in title.to_lower() or filter_lc in short_desc.to_lower() or filter_lc in category.to_lower() or filter_lc in subcategory.to_lower()):
|
|
|
|
|
+ continue
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ var hbox = HBoxContainer.new()
|
|
|
|
|
+ var label = RichTextLabel.new()
|
|
|
|
|
+ var helpbtn = Button.new()
|
|
|
|
|
+ var makebtn = Button.new()
|
|
|
|
|
+ var margin = MarginContainer.new()
|
|
|
|
|
+
|
|
|
|
|
+ hbox.size.x = container.size.x
|
|
|
|
|
+ label.bbcode_enabled = true
|
|
|
|
|
+ label.text = "[b]%s[/b]\n%s" % [title, short_desc]
|
|
|
|
|
+ label.set_h_size_flags(Control.SIZE_EXPAND_FILL)
|
|
|
|
|
+ label.set_v_size_flags(Control.SIZE_EXPAND_FILL)
|
|
|
|
|
+ label.fit_content = true
|
|
|
|
|
+
|
|
|
|
|
+ helpbtn.text = "?"
|
|
|
|
|
+ helpbtn.tooltip_text = "Open help for " + title
|
|
|
|
|
+ helpbtn.custom_minimum_size = Vector2(40, 40)
|
|
|
|
|
+ helpbtn.set_h_size_flags(Control.SIZE_SHRINK_CENTER)
|
|
|
|
|
+ helpbtn.connect("pressed", Callable(self, "_open_help").bind(key, title)) #pass key (process name) when button is pressed
|
|
|
|
|
+
|
|
|
|
|
+ makebtn.text = "+"
|
|
|
|
|
+ makebtn.tooltip_text = "Add " + title + " to thread"
|
|
|
|
|
+ makebtn.custom_minimum_size = Vector2(40, 40)
|
|
|
|
|
+ makebtn.set_h_size_flags(Control.SIZE_SHRINK_CENTER)
|
|
|
|
|
+ makebtn.connect("pressed", Callable(self, "_make_node").bind(key)) #pass key (process name) when button is pressed
|
|
|
|
|
+
|
|
|
|
|
+ margin.add_theme_constant_override("margin_bottom", 3)
|
|
|
|
|
+
|
|
|
|
|
+ container.add_child(hbox)
|
|
|
|
|
+ hbox.add_child(label)
|
|
|
|
|
+ hbox.add_child(helpbtn)
|
|
|
|
|
+ hbox.add_child(makebtn)
|
|
|
|
|
+ container.add_child(margin)
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
func _on_search_bar_text_changed(new_text: String) -> void:
|
|
func _on_search_bar_text_changed(new_text: String) -> void:
|
|
|
- #display_items(new_text)
|
|
|
|
|
|
|
+ fill_search(new_text)
|
|
|
pass
|
|
pass
|
|
|
|
|
|
|
|
func _make_node(key: String):
|
|
func _make_node(key: String):
|
|
@@ -148,3 +176,8 @@ func _make_node(key: String):
|
|
|
func _open_help(key: String, title: String):
|
|
func _open_help(key: String, title: String):
|
|
|
open_help.emit(key, title) # send out signal to main patch
|
|
open_help.emit(key, title) # send out signal to main patch
|
|
|
self.hide()
|
|
self.hide()
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+func _on_select_effect_tab_changed(tab: int) -> void:
|
|
|
|
|
+ if tab == 3:
|
|
|
|
|
+ $"Control/select_effect/Search/Search for a process in SoundThread/MarginContainer/VBoxContainer/SearchBar".grab_focus()
|