Also fixed the gradient editor popup thing.

This commit is contained in:
Relintai 2022-03-08 12:20:49 +01:00
parent 48f5fbfcbb
commit 7157df772c
2 changed files with 4 additions and 2 deletions

View File

@ -199,7 +199,7 @@ func _gui_input(ev) -> void:
var popup_size = popup.rect_size var popup_size = popup.rect_size
popup.popup(Rect2(ev.global_position, Vector2(0, 0))) popup.popup(Rect2(ev.global_position, Vector2(0, 0)))
popup.set_global_position(ev.global_position-Vector2(popup_size.x / 2, popup_size.y)) popup.set_global_position(ev.global_position-Vector2(popup_size.x / 2, popup_size.y))
popup.init(value) popup.init(value, graph_node, _undo_redo)
popup.connect("updated", self, "set_value") popup.connect("updated", self, "set_value")
popup.connect("popup_hide", popup, "queue_free") popup.connect("popup_hide", popup, "queue_free")

View File

@ -3,7 +3,9 @@ extends Popup
signal updated(value) signal updated(value)
func init(value) -> void: func init(value, graph_node, undo_redo) -> void:
$Panel/Control.set_undo_redo(undo_redo)
$Panel/Control.graph_node = graph_node
$Panel/Control.set_value(value) $Panel/Control.set_value(value)
func _on_Control_updated(value) -> void: func _on_Control_updated(value) -> void: