mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-18 17:19:50 +00:00
Add a resized
signal to Project
, remove the Global.tile_mode_offset_dialog
variable
Continue to slowly remove nodes from `Global`.
This commit is contained in:
parent
1678738d75
commit
19e4c94fe3
|
@ -642,7 +642,6 @@ var cel_button_scene: PackedScene = load("res://src/UI/Timeline/CelButton.tscn")
|
|||
## The patterns popup dialog used to display patterns
|
||||
## It has the [param PatternsPopup.gd] script attached.
|
||||
@onready var patterns_popup: Popup = control.find_child("PatternsPopup")
|
||||
@onready var tile_mode_offset_dialog: AcceptDialog = control.find_child("TileModeOffsetsDialog")
|
||||
## Dialog used to navigate and open images and projects.
|
||||
@onready var open_sprites_dialog: FileDialog = control.find_child("OpenSprite")
|
||||
## Dialog used to save (.pxo) projects.
|
||||
|
|
|
@ -5,6 +5,7 @@ extends RefCounted
|
|||
|
||||
signal serialized(dict: Dictionary)
|
||||
signal about_to_deserialize(dict: Dictionary)
|
||||
signal resized
|
||||
signal timeline_updated
|
||||
|
||||
var name := "":
|
||||
|
@ -422,9 +423,9 @@ func _size_changed(value: Vector2i) -> void:
|
|||
else:
|
||||
tiles.y_basis = Vector2i(0, value.y)
|
||||
tiles.tile_size = value
|
||||
Global.tile_mode_offset_dialog.change_mask()
|
||||
size = value
|
||||
Global.canvas.crop_rect.reset()
|
||||
resized.emit()
|
||||
|
||||
|
||||
func change_cel(new_frame: int, new_layer := -1) -> void:
|
||||
|
|
|
@ -20,6 +20,7 @@ var splash_dialog: AcceptDialog:
|
|||
@onready var backup_confirmation: ConfirmationDialog = $Dialogs/BackupConfirmation
|
||||
@onready var save_sprite_dialog := $Dialogs/SaveSprite as FileDialog
|
||||
@onready var save_sprite_html5: ConfirmationDialog = $Dialogs/SaveSpriteHTML5
|
||||
@onready var tile_mode_offsets_dialog: ConfirmationDialog = $Dialogs/TileModeOffsetsDialog
|
||||
@onready var quit_dialog: ConfirmationDialog = $Dialogs/QuitDialog
|
||||
@onready var quit_and_save_dialog: ConfirmationDialog = $Dialogs/QuitAndSaveDialog
|
||||
@onready var download_confirmation := $Dialogs/DownloadImageConfirmationDialog as ConfirmationDialog
|
||||
|
|
|
@ -9,12 +9,22 @@ extends ConfirmationDialog
|
|||
|
||||
|
||||
func _ready() -> void:
|
||||
Global.project_about_to_switch.connect(_project_about_to_switch)
|
||||
Global.project_switched.connect(_project_switched)
|
||||
Global.project_switched.connect(change_mask)
|
||||
Global.cel_switched.connect(change_mask)
|
||||
await get_tree().process_frame
|
||||
change_mask()
|
||||
|
||||
|
||||
func _project_about_to_switch() -> void:
|
||||
Global.current_project.resized.disconnect(change_mask)
|
||||
|
||||
|
||||
func _project_switched() -> void:
|
||||
Global.current_project.resized.connect(change_mask)
|
||||
|
||||
|
||||
func _on_TileModeOffsetsDialog_about_to_show() -> void:
|
||||
tile_mode.draw_center = true
|
||||
tile_mode.tiles = Tiles.new(Global.current_project.size)
|
||||
|
|
|
@ -592,7 +592,7 @@ func edit_menu_id_pressed(id: int) -> void:
|
|||
func view_menu_id_pressed(id: int) -> void:
|
||||
match id:
|
||||
Global.ViewMenu.TILE_MODE_OFFSETS:
|
||||
_popup_dialog(Global.tile_mode_offset_dialog)
|
||||
_popup_dialog(get_tree().current_scene.tile_mode_offsets_dialog)
|
||||
Global.ViewMenu.GREYSCALE_VIEW:
|
||||
_toggle_greyscale_view()
|
||||
Global.ViewMenu.MIRROR_VIEW:
|
||||
|
@ -638,7 +638,7 @@ func _tile_mode_submenu_id_pressed(id: Tiles.MODE) -> void:
|
|||
Global.canvas.tile_mode.queue_redraw()
|
||||
Global.canvas.pixel_grid.queue_redraw()
|
||||
Global.canvas.grid.queue_redraw()
|
||||
Global.tile_mode_offset_dialog.change_mask()
|
||||
get_tree().current_scene.tile_mode_offsets_dialog.change_mask()
|
||||
|
||||
|
||||
func _snap_to_submenu_id_pressed(id: int) -> void:
|
||||
|
@ -846,7 +846,7 @@ func select_menu_id_pressed(id: int) -> void:
|
|||
func help_menu_id_pressed(id: int) -> void:
|
||||
match id:
|
||||
Global.HelpMenu.VIEW_SPLASH_SCREEN:
|
||||
_popup_dialog(Global.control.splash_dialog)
|
||||
_popup_dialog(get_tree().current_scene.splash_dialog)
|
||||
Global.HelpMenu.ONLINE_DOCS:
|
||||
OS.shell_open(DOCS_URL)
|
||||
SteamManager.set_achievement("ACH_ONLINE_DOCS")
|
||||
|
|
Loading…
Reference in a new issue