Skip to content

Commit

Permalink
Rename project_changed to project_data_changed signal, add a new …
Browse files Browse the repository at this point in the history
…method for this signal in ExtensionsAPI
  • Loading branch information
OverloadedOrama committed Feb 22, 2024
1 parent a06d6a2 commit d3db8f5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
27 changes: 16 additions & 11 deletions src/Autoload/ExtensionsApi.gd
Original file line number Diff line number Diff line change
Expand Up @@ -742,68 +742,73 @@ class SignalsAPI:
ExtensionsApi.remove_action("SignalsAPI", signal_class.get_name())

# APP RELATED SIGNALS
## connects/disconnects a signal to [param callable], that emits
## Connects/disconnects a signal to [param callable], that emits
## when pixelorama is just opened.
func signal_pixelorama_opened(callable: Callable, is_disconnecting := false) -> void:
_connect_disconnect(Global.pixelorama_opened, callable, is_disconnecting)

## connects/disconnects a signal to [param callable], that emits
## Connects/disconnects a signal to [param callable], that emits
## when pixelorama is about to close.
func signal_pixelorama_about_to_close(callable: Callable, is_disconnecting := false) -> void:
_connect_disconnect(Global.pixelorama_about_to_close, callable, is_disconnecting)

# PROJECT RELATED SIGNALS
## connects/disconnects a signal to [param callable], that emits
## Connects/disconnects a signal to [param callable], that emits
## whenever a new project is created.[br]
## [b]Binds: [/b]It has one bind of type [code]Project[/code] which is the newly created project
func signal_project_created(callable: Callable, is_disconnecting := false) -> void:
_connect_disconnect(Global.project_created, callable, is_disconnecting)

## connects/disconnects a signal to [param callable], that emits
## Connects/disconnects a signal to [param callable], that emits
## after a project is saved.
func signal_project_saved(callable: Callable, is_disconnecting := false) -> void:
_connect_disconnect(OpenSave.project_saved, callable, is_disconnecting)

## connects/disconnects a signal to [param callable], that emits
## Connects/disconnects a signal to [param callable], that emits
## whenever you switch to some other project.
func signal_project_switched(callable: Callable, is_disconnecting := false) -> void:
_connect_disconnect(Global.project_switched, callable, is_disconnecting)

## connects/disconnects a signal to [param callable], that emits
## Connects/disconnects a signal to [param callable], that emits
## whenever you select a different cel.
func signal_cel_switched(callable: Callable, is_disconnecting := false) -> void:
_connect_disconnect(Global.cel_switched, callable, is_disconnecting)

## Connects/disconnects a signal to [param callable], that emits
## whenever the project data are being modified.
func signal_project_data_changed(callable: Callable, is_disconnecting := false) -> void:
_connect_disconnect(Global.project_data_changed, callable, is_disconnecting)

# TOOL RELATED SIGNALS
## connects/disconnects a signal to [param callable], that emits
## Connects/disconnects a signal to [param callable], that emits
## whenever a tool changes color.[br]
## [b]Binds: [/b] It has two bind of type [Color] (indicating new color)
## and [int] (Indicating button that tool is assigned to, see [enum @GlobalScope.MouseButton])
func signal_tool_color_changed(callable: Callable, is_disconnecting := false) -> void:
_connect_disconnect(Tools.color_changed, callable, is_disconnecting)

# TIMELINE RELATED SIGNALS
## connects/disconnects a signal to [param callable], that emits
## Connects/disconnects a signal to [param callable], that emits
## whenever timeline animation starts.[br]
## [b]Binds: [/b] It has one bind of type [bool] which indicated if animation is in
## forward direction ([code]true[/code]) or backward direction ([code]false[/code])
func signal_timeline_animation_started(callable: Callable, is_disconnecting := false) -> void:
_connect_disconnect(Global.animation_timeline.animation_started, callable, is_disconnecting)

## connects/disconnects a signal to [param callable], that emits
## Connects/disconnects a signal to [param callable], that emits
## whenever timeline animation stops.
func signal_timeline_animation_finished(callable: Callable, is_disconnecting := false) -> void:
_connect_disconnect(
Global.animation_timeline.animation_finished, callable, is_disconnecting
)

# UPDATER SIGNALS
## connects/disconnects a signal to [param callable], that emits
## Connects/disconnects a signal to [param callable], that emits
## whenever texture of the currently focused cel changes.
func signal_current_cel_texture_changed(callable: Callable, is_disconnecting := false) -> void:
_connect_disconnect(texture_changed, callable, is_disconnecting)

## connects/disconnects a signal to [param callable], that emits
## Connects/disconnects a signal to [param callable], that emits
## whenever preview is about to be drawn.[br]
## [b]Binds: [/b]It has one bind of type [Dictionary] with keys: [code]exporter_id[/code],
## [code]export_tab[/code], [code]preview_images[/code], [code]durations[/code]
Expand Down
2 changes: 1 addition & 1 deletion src/Autoload/Global.gd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ signal project_created(project: Project) ## Emitted when a new project class is
signal project_about_to_switch ## Emitted before a project is about to be switched
signal project_switched ## Emitted whenever you switch to some other project tab.
signal cel_switched ## Emitted whenever you select a different cel.
signal project_changed(project: Project) ## Emitted when project data is modified.
signal project_data_changed(project: Project) ## Emitted when project data is modified.

enum LayerTypes { PIXEL, GROUP, THREE_D }
enum GridTypes { CARTESIAN, ISOMETRIC, ALL }
Expand Down
2 changes: 1 addition & 1 deletion src/Classes/Project.gd
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var has_changed := false:
set(value):
has_changed = value
if value:
Global.project_changed.emit(self)
Global.project_data_changed.emit(self)
Global.tabs.set_tab_title(Global.tabs.current_tab, name + "(*)")
else:
Global.tabs.set_tab_title(Global.tabs.current_tab, name)
Expand Down

0 comments on commit d3db8f5

Please sign in to comment.