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

Don't call project_changed() whenever a reference image gets imported

This commit is contained in:
Emmanouil Papadeas 2023-12-07 16:09:00 +02:00
parent e4f7995b08
commit 495c3b8ebe
5 changed files with 10 additions and 7 deletions

View file

@ -465,8 +465,6 @@ var cel_button_scene: PackedScene = load("res://src/UI/Timeline/CelButton.tscn")
## The palettes panel. It has the [param PalettePanel.gd] script attached.
@onready var palette_panel: PalettePanel = control.find_child("Palettes")
## The reference images panel. It has the [param ReferencesPanel.gd] script attached.
@onready var references_panel: ReferencesPanel = control.find_child("Reference Images")
## The perspectice editor. It has the [param PerspectiveEditor.gd] script attached.
@onready var perspective_editor := control.find_child("Perspective Editor")

View file

@ -2,6 +2,7 @@
extends Node
signal project_saved
signal reference_image_imported
var current_save_paths: PackedStringArray = []
## Stores a filename of a backup file in user:// until user saves manually
@ -725,7 +726,7 @@ func import_reference_image_from_path(path: String) -> void:
ri.project = project
ri.deserialize({"image_path": path})
Global.canvas.add_child(ri)
project.change_project()
reference_image_imported.emit()
## Useful for Web
@ -735,7 +736,7 @@ func import_reference_image_from_image(image: Image) -> void:
ri.project = project
ri.create_from_image(image)
Global.canvas.add_child(ri)
project.change_project()
reference_image_imported.emit()
func set_new_imported_tab(project: Project, path: String) -> void:

View file

@ -205,7 +205,6 @@ func change_project() -> void:
Global.transparent_checker.update_rect()
Global.animation_timeline.fps_spinbox.value = fps
Global.references_panel.project_changed()
Global.perspective_editor.update_points()
Global.cursor_position_label.text = "[%s×%s]" % [size.x, size.y]

View file

@ -46,7 +46,7 @@ func _on_Remove_pressed():
queue_free()
element.queue_free()
Global.current_project.reference_images.remove_at(index)
Global.current_project.change_project()
OpenSave.reference_image_imported.emit()
func _on_Scale_value_changed(value: float):

View file

@ -6,7 +6,12 @@ var reference_image_button_tscn := preload("res://src/UI/ReferenceImages/Referen
@onready var list = $"Scroll/List"
func project_changed():
func _ready() -> void:
Global.project_changed.connect(_update_reference_images)
OpenSave.reference_image_imported.connect(_update_reference_images)
func _update_reference_images():
for c in list.get_children():
c.queue_free()
# Just do this here because I'm not sure where it's done.