Skip to content

Commit

Permalink
Minor fixes and improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
RodZill4 committed Nov 10, 2023
1 parent 1d995ea commit ed93773
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions material_maker/nodes/base.gd
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ func _on_gui_input(event) -> void:
elif doubleclicked:
doubleclicked = false
if generator is MMGenGraph:
get_parent().call_deferred("update_view", generator)
get_parent().update_view.call_deferred(generator)
elif generator is MMGenSDF:
edit_generator()
elif event is InputEventMouseMotion:
Expand Down Expand Up @@ -334,7 +334,7 @@ func _on_menu_id_pressed(id : int) -> void:
add_child(dialog)
var result = await dialog.ask()
if result == "ok":
get_parent().call_deferred("propagate_node_changes", generator)
get_parent().propagate_node_changes.call_deferred(generator)
MENU_SHARE_NODE:
# Prepare warning dialog
var status : Array = []
Expand Down
2 changes: 1 addition & 1 deletion material_maker/nodes/generic/generic.gd
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ func do_load_generator(file_name : String) -> void:
var parent_generator = generator.get_parent()
parent_generator.replace_generator(generator, new_generator)
generator = new_generator
call_deferred("update_node")
update_node.call_deferred()

func save_generator() -> void:
var dialog = preload("res://material_maker/windows/file_dialog/file_dialog.tscn").instantiate()
Expand Down
2 changes: 1 addition & 1 deletion material_maker/nodes/ios/ios.gd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ func set_generator(g) -> void:

func on_parameter_changed(p, _v) -> void:
if p == "__update_all__":
call_deferred("update_node")
update_node.call_deferred()

func update_up_down_buttons() -> void:
for c in get_children():
Expand Down
2 changes: 1 addition & 1 deletion material_maker/nodes/remote/remote.gd
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func update_node() -> void:
# Delete the contents and wait until it's done
for c in grid.get_children():
grid.remove_child(c)
c.call_deferred("free")
c.free.call_deferred()
title = generator.get_type_name()
controls = {}
var parameter_count : int = generator.get_parameter_defs().size()
Expand Down
2 changes: 1 addition & 1 deletion material_maker/nodes/reroute/reroute.gd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ func _ready() -> void:
super._ready()
close_button.visible = false
set_theme_type("Reroute")
call_deferred("on_connections_changed")
on_connections_changed.call_deferred()

func set_generator(g : MMGenBase) -> void:
super.set_generator(g)
Expand Down
5 changes: 3 additions & 2 deletions material_maker/panels/graph_edit/graph_edit.gd
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ func do_zoom(factor : float):
var old_zoom : float = zoom
zoom *= factor
var global_mouse_position = offset_from_global_position(get_global_transform() * get_local_mouse_position())
call_deferred("set_scroll_ofs", scroll_offset+((zoom/old_zoom)-1.0)*old_zoom*global_mouse_position)
await get_tree().process_frame
scroll_offset += (zoom/old_zoom-1.0)*old_zoom*global_mouse_position

var port_click_node : GraphNode
var port_click_port_index : int = -1
Expand All @@ -100,7 +101,7 @@ func get_nodes_under_mouse() -> Array:
func process_port_click(pressed : bool):
for c in get_nodes_under_mouse():
var rect : Rect2 = c.get_global_rect()
var pos = get_global_mouse_position()-rect.position
var pos : Vector2 = get_global_mouse_position()-rect.position
var transform_scale : Vector2 = Vector2(1, 1) # c.get_global_transform().get_scale()
rect = Rect2(rect.position, rect.size*transform_scale)
var output_count : int = c.get_output_port_count()
Expand Down

0 comments on commit ed93773

Please sign in to comment.