1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +00:00

Make cel_changed a Global signal instead

Otherwise we would have to connect the signal for every opened project. If a feature/extension requires it, we could add a reference to the project as a parameter for the cel_changed signal, but since that can get retrieved with Global.current_project, it's probably not needed.
This commit is contained in:
Emmanouil Papadeas 2023-01-03 00:52:23 +02:00
parent 824860a2b5
commit ee8d321902
2 changed files with 3 additions and 3 deletions

View file

@ -1,6 +1,7 @@
extends Node
signal project_changed
signal cel_changed
enum LayerTypes { PIXEL, GROUP }
enum GridTypes { CARTESIAN, ISOMETRIC, ALL }
@ -491,6 +492,7 @@ func _project_changed(value: int) -> void:
connect("project_changed", current_project, "change_project")
emit_signal("project_changed")
disconnect("project_changed", current_project, "change_project")
emit_signal("cel_changed")
func _renderer_changed(value: int) -> void:

View file

@ -3,8 +3,6 @@ class_name Project
extends Reference
# A class for project properties.
signal cel_changed
var name := "" setget _name_changed
var size: Vector2 setget _size_changed
var undo_redo := UndoRedo.new()
@ -518,7 +516,7 @@ func change_cel(new_frame: int, new_layer := -1) -> void:
Global.layer_opacity_slider.value = cel_opacity * 100
Global.canvas.update()
Global.transparent_checker.update_rect()
emit_signal("cel_changed")
Global.emit_signal("cel_changed")
func toggle_frame_buttons() -> void: