1
0
mirror of https://github.com/Relintai/broken_seals.git synced 2025-03-08 15:46:59 +01:00

Don't connect to the MMnode's changed event in mm_graph_node as it's not needed. Also set ignore changes when a texture is changed.

This commit is contained in:
Relintai 2022-01-21 18:59:55 +01:00
parent edd698504b
commit 2ada5fa3b1

View File

@ -542,7 +542,7 @@ func set_node(material : MMMateial, node : MMNode) -> void:
offset = _node.get_graph_position() offset = _node.get_graph_position()
_node.connect("changed", self, "on_node_changed") #_node.connect("changed", self, "on_node_changed")
func propagate_node_change() -> void: func propagate_node_change() -> void:
pass pass
@ -551,14 +551,13 @@ func on_offset_changed():
if _node: if _node:
_node.set_graph_position(offset) _node.set_graph_position(offset)
func on_node_changed(): #func on_node_changed():
#get all properties again # if _ignore_change_event:
#_node.recalculate_image(_material) # return
#
if _ignore_change_event: # _ignore_change_event = true
return # propagate_node_change()
# _ignore_change_event = false
propagate_node_change()
func on_int_spinbox_value_changed(val : float, slot_idx) -> void: func on_int_spinbox_value_changed(val : float, slot_idx) -> void:
#_node.call(properties[slot_idx][4], int(val)) #_node.call(properties[slot_idx][4], int(val))
@ -647,6 +646,8 @@ func on_slot_enum_item_selected(val : int, slot_idx : int) -> void:
ignore_changes(false) ignore_changes(false)
func on_universal_texture_changed(slot_idx : int) -> void: func on_universal_texture_changed(slot_idx : int) -> void:
ignore_changes(true)
var img : Image = properties[slot_idx][6].get_active_image() var img : Image = properties[slot_idx][6].get_active_image()
var tex : ImageTexture = properties[slot_idx][5].texture var tex : ImageTexture = properties[slot_idx][5].texture
@ -656,7 +657,11 @@ func on_universal_texture_changed(slot_idx : int) -> void:
else: else:
properties[slot_idx][5].texture = ImageTexture.new() properties[slot_idx][5].texture = ImageTexture.new()
ignore_changes(false)
func on_universal_texture_changed_image_picker(slot_idx : int) -> void: func on_universal_texture_changed_image_picker(slot_idx : int) -> void:
ignore_changes(true)
var img : Image = properties[slot_idx][6].get_active_image() var img : Image = properties[slot_idx][6].get_active_image()
var tex : ImageTexture = properties[slot_idx][5].texture_normal var tex : ImageTexture = properties[slot_idx][5].texture_normal
@ -666,6 +671,8 @@ func on_universal_texture_changed_image_picker(slot_idx : int) -> void:
else: else:
properties[slot_idx][5].texture_normal = ImageTexture.new() properties[slot_idx][5].texture_normal = ImageTexture.new()
ignore_changes(false)
func on_slot_line_edit_text_entered(text : String, slot_idx : int) -> void: func on_slot_line_edit_text_entered(text : String, slot_idx : int) -> void:
#_node.call(properties[slot_idx][4], text) #_node.call(properties[slot_idx][4], text)