Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions readmeimages/logo.png.import
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,19 @@ dest_files=["res://.godot/imported/logo.png-32b1ce9a3d691ac1874e55f69fad46d0.cte
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
Expand Down
6 changes: 6 additions & 0 deletions readmeimages/main_screenshot.png.import
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,19 @@ dest_files=["res://.godot/imported/main_screenshot.png-377a4acb99bd8e337af226e23
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
Expand Down
2 changes: 2 additions & 0 deletions scenes/main/control.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,9 @@ popup/item_3/text = "4"
popup/item_3/id = 3

[connection signal="connection_request" from="GraphEdit" to="GraphEdit" method="_on_connection_request"]
[connection signal="connection_to_empty" from="GraphEdit" to="GraphEdit" method="_on_connection_to_empty"]
[connection signal="copy_nodes_request" from="GraphEdit" to="GraphEdit" method="_on_copy_nodes_request"]
[connection signal="cut_nodes_request" from="GraphEdit" to="GraphEdit" method="_on_cut_nodes_request"]
[connection signal="delete_nodes_request" from="GraphEdit" to="GraphEdit" method="_on_graph_edit_delete_nodes_request"]
[connection signal="disconnection_request" from="GraphEdit" to="GraphEdit" method="_on_graph_edit_disconnection_request"]
[connection signal="gui_input" from="GraphEdit" to="GraphEdit" method="_on_gui_input"]
Expand Down
6 changes: 3 additions & 3 deletions scenes/main/scripts/control.gd
Original file line number Diff line number Diff line change
Expand Up @@ -634,10 +634,10 @@ func _on_rich_text_label_meta_clicked(meta: Variant) -> void:


func _on_graph_edit_popup_request(at_position: Vector2) -> void:

effect_position = graph_edit.get_local_mouse_position()
effect_position = at_position

#give the search menu the ui scale
#give search menu ui scale
$SearchMenu.uiscale = uiscale

#get the mouse position in screen coordinates
Expand Down
72 changes: 72 additions & 0 deletions scenes/main/scripts/graph_edit.gd
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ var selected_cables:= [] #used to track which cables are selected for changing c
var theme_background #used to track if the theme has changed and if so change the cable selection colour
var theme_custom_background
var high_contrast_cables
var vertical_hotzone = 30


# Called when the node enters the scene tree for the first time.
Expand Down Expand Up @@ -398,11 +399,70 @@ func _on_graph_edit_node_selected(node: Node) -> void:
func _on_graph_edit_node_deselected(node: Node) -> void:
selected_nodes[node] = false

func _on_cut_nodes_request() -> void:
if selected_nodes.size() == 0:
return

control_script.undo_redo.create_action("Dissolve Nodes")

for node in selected_nodes:
if selected_nodes[node] and node is GraphNode and is_instance_valid(node):
if node.get_meta("command") == "outputfile":
continue

var node_connections = []
var incoming_connections = []
var outgoing_connections = []

for conn in get_connection_list():
if conn.to_node == node.name:
node_connections.append(conn)
incoming_connections.append(conn)
elif conn.from_node == node.name:
node_connections.append(conn)
outgoing_connections.append(conn)

control_script.undo_redo.add_do_method(delete_node.bind(node))
control_script.undo_redo.add_undo_method(restore_node.bind(node))
control_script.undo_redo.add_undo_reference(node)
control_script.undo_redo.add_undo_method(restore_connections.bind(node_connections.duplicate(true)))

for in_conn in incoming_connections:
for out_conn in outgoing_connections:
if _same_port_type(in_conn.from_node, in_conn.from_port, out_conn.to_node, out_conn.to_port):
control_script.undo_redo.add_do_method(connect_node.bind(in_conn.from_node, in_conn.from_port, out_conn.to_node, out_conn.to_port))
control_script.undo_redo.add_undo_method(disconnect_node.bind(in_conn.from_node, in_conn.from_port, out_conn.to_node, out_conn.to_port))

selected_nodes = {}
control_script.undo_redo.commit_action()
force_hide_tooltips()
control_script.changesmade = true

func _on_connection_to_empty(from_node: StringName, from_port: int, release_position: Vector2) -> void:
control_script.effect_position = release_position
control_script._on_graph_edit_popup_request(release_position)

var from_graph_node = get_node_or_null(NodePath(from_node))
if from_graph_node and is_instance_valid(from_graph_node):
var search_menu = get_tree().current_scene.get_node("SearchMenu")
if search_menu:
search_menu.connect_to_node = true
search_menu.node_to_connect_to = from_graph_node

func _unhandled_key_input(event: InputEvent) -> void:
if event is InputEventKey and event.pressed and not event.echo:
if event.keycode == KEY_BACKSPACE:
_on_graph_edit_delete_nodes_request(PackedStringArray(selected_nodes.keys().filter(func(k): return selected_nodes[k])))
pass
elif event.keycode == KEY_F1 or (event.ctrl_pressed and (event.keycode == KEY_H or event.keycode == KEY_SLASH)):
_open_help_for_selected_nodes()
get_viewport().set_input_as_handled()

func _open_help_for_selected_nodes() -> void:
for node in selected_nodes:
if selected_nodes[node] and node is GraphNode and is_instance_valid(node) and node.has_meta("command"):
open_help.call(node.get_meta("command"), node.title)
break

func _on_graph_edit_delete_nodes_request(nodes: Array[StringName]) -> void:
if nodes.size() == 0:
Expand Down Expand Up @@ -850,3 +910,15 @@ func node_position_changed(from: Vector2, to: Vector2, node: Node) -> void:

func move_node(node: Node, to: Vector2) -> void:
node.position_offset = to

func _is_in_input_hotzone(in_node: Object, in_port: int, mouse_position: Vector2) -> bool:
var port_size = Vector2(get_theme_constant("port_hotzone_inner_extent"), vertical_hotzone * 2)
var port_pos = in_node.get_position() + in_node.get_input_port_position(in_port) - port_size / 2
var rect = Rect2(port_pos, port_size)
return rect.has_point(mouse_position)

func _is_in_output_hotzone(in_node: Object, in_port: int, mouse_position: Vector2) -> bool:
var port_size = Vector2(get_theme_constant("port_hotzone_outer_extent"), vertical_hotzone * 2)
var port_pos = in_node.get_position() + in_node.get_output_port_position(in_port) - port_size / 2
var rect = Rect2(port_pos, port_size)
return rect.has_point(mouse_position)
8 changes: 5 additions & 3 deletions scenes/main/shortcuts.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
{
"Thread Management":{
"Thread Management": {
"Run Thread": "Ctrl + R",
"New Thread": "Ctrl + N",
"Save Thread": "Ctrl + S",
"Save Thread As": "Ctrl + Shift + S"
},
"Building a Thread":{
"Building a Thread": {
"Add Node (Open Search)": "Right click empty space or Ctrl + F",
"Browse Nodes (Open Explore)": "Ctrl + E",
"Replace Node": "Right click node",
"Add Node Connected to Node": "Shift + right click node",
"Insert Node into Connection": "Shift + drag node over cable",
"Reset Slider to Default": "Double click",
"Delete Node": "Backspace or Delete",
"Dissolve Node": "Ctrl + X",
"Open Help for Selected Node": "F1 or Ctrl + H or Ctrl + /",
"Undo": "Ctrl + Z",
"Redo": "Ctrl + Y",
"Copy": "Ctrl + C",
"Paste": "Ctrl + V"
},
"Navigating a Thread":{
"Navigating a Thread": {
"Zoom": "Mouse wheel",
"Move": "Middle click + drag or Ctrl + Mouse wheel"
}
Expand Down
1 change: 1 addition & 0 deletions theme/BravuraText_SoundThread.otf.import
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
modulate_color_glyphs=false
hinting=1
subpixel_positioning=4
keep_rounding_remainders=true
Expand Down
1 change: 1 addition & 0 deletions theme/WorkSans-Regular.otf.import
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
modulate_color_glyphs=false
hinting=1
subpixel_positioning=4
keep_rounding_remainders=true
Expand Down
6 changes: 6 additions & 0 deletions theme/images/grabber.png.import
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,19 @@ dest_files=["res://.godot/imported/grabber.png-c85c5aa527a4f6559d1d438ebb0ff8f3.
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
Expand Down
6 changes: 6 additions & 0 deletions theme/images/grabber_highlighted.png.import
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,19 @@ dest_files=["res://.godot/imported/grabber_highlighted.png-a172934d5727f553cec89
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
Expand Down
6 changes: 6 additions & 0 deletions theme/images/icon.png.import
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,19 @@ dest_files=["res://.godot/imported/icon.png-a6a16b81187e5576e4311affba7e0777.cte
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
Expand Down
6 changes: 6 additions & 0 deletions theme/images/logo.png.import
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,19 @@ dest_files=["res://.godot/imported/logo.png-39bc5fd0abe124db0a8a0760a7908627.cte
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
Expand Down
6 changes: 6 additions & 0 deletions theme/images/magnet.png.import
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,19 @@ dest_files=["res://.godot/imported/magnet.png-ef353af605ac0f4067145735494aa588.c
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
Expand Down
6 changes: 6 additions & 0 deletions theme/images/minimap.png.import
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,19 @@ dest_files=["res://.godot/imported/minimap.png-bdcc26dc76ae6c729dd657b27af8b5b6.
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
Expand Down
6 changes: 6 additions & 0 deletions theme/images/nodeport.png.import
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,19 @@ dest_files=["res://.godot/imported/nodeport.png-cd7a587522b725925aa05f07a7f2544b
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
Expand Down
6 changes: 6 additions & 0 deletions theme/images/open_explore.png.import
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,19 @@ dest_files=["res://.godot/imported/open_explore.png-853121c6f0e8091b3020ae9f7af7
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
Expand Down
6 changes: 6 additions & 0 deletions theme/images/organise.png.import
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,19 @@ dest_files=["res://.godot/imported/organise.png-a2703850e3be6d05bbef0b00c88b1d4c
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
Expand Down
Loading