mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 21:14:42 -04:00
Made TopMenuContainer.gd and moved all the menu code there from Main.gd
Main.gd is now easier to read
This commit is contained in:
parent
af078d590d
commit
2e587e3634
6 changed files with 431 additions and 419 deletions
|
@ -150,6 +150,7 @@ var help_menu : MenuButton
|
|||
var cursor_position_label : Label
|
||||
var zoom_level_label : Label
|
||||
|
||||
var new_image_dialog : ConfirmationDialog
|
||||
var open_sprites_dialog : FileDialog
|
||||
var save_sprites_dialog : FileDialog
|
||||
var export_dialog : AcceptDialog
|
||||
|
@ -223,6 +224,8 @@ var new_palette_dialog : ConfirmationDialog
|
|||
var new_palette_name_line_edit : LineEdit
|
||||
var palette_import_file_dialog : FileDialog
|
||||
var error_dialog : AcceptDialog
|
||||
var quit_dialog : ConfirmationDialog
|
||||
var quit_and_save_dialog : ConfirmationDialog
|
||||
|
||||
onready var current_version : String = ProjectSettings.get_setting("application/config/Version")
|
||||
|
||||
|
@ -269,6 +272,7 @@ func _ready() -> void:
|
|||
cursor_position_label = find_node_by_name(root, "CursorPosition")
|
||||
zoom_level_label = find_node_by_name(root, "ZoomLevel")
|
||||
|
||||
new_image_dialog = find_node_by_name(root, "CreateNewImage")
|
||||
open_sprites_dialog = find_node_by_name(root, "OpenSprite")
|
||||
save_sprites_dialog = find_node_by_name(root, "SaveSprite")
|
||||
export_dialog = find_node_by_name(root, "ExportDialog")
|
||||
|
@ -361,6 +365,8 @@ func _ready() -> void:
|
|||
palette_import_file_dialog = find_node_by_name(root, "PaletteImportFileDialog")
|
||||
|
||||
error_dialog = find_node_by_name(root, "ErrorDialog")
|
||||
quit_dialog = find_node_by_name(root, "QuitDialog")
|
||||
quit_and_save_dialog = find_node_by_name(root, "QuitAndSaveDialog")
|
||||
|
||||
projects.append(Project.new())
|
||||
projects[0].layers.append(Layer.new())
|
||||
|
|
|
@ -93,8 +93,8 @@ func open_pxo_file(path : String, untitled_backup : bool = false) -> void:
|
|||
Global.export_dialog.file_name = path.get_file().trim_suffix(".pxo")
|
||||
Global.export_dialog.directory_path = path.get_base_dir()
|
||||
Global.export_dialog.was_exported = false
|
||||
Global.control.file_menu.set_item_text(3, tr("Save") + " %s" % path.get_file())
|
||||
Global.control.file_menu.set_item_text(5, tr("Export"))
|
||||
Global.file_menu.get_popup().set_item_text(3, tr("Save") + " %s" % path.get_file())
|
||||
Global.file_menu.get_popup().set_item_text(5, tr("Export"))
|
||||
|
||||
|
||||
# For pxo files older than v0.8
|
||||
|
@ -283,7 +283,7 @@ func save_pxo_file(path : String, autosave : bool, project : Project = Global.cu
|
|||
Global.export_dialog.file_name = path.get_file().trim_suffix(".pxo")
|
||||
Global.export_dialog.directory_path = path.get_base_dir()
|
||||
Global.export_dialog.was_exported = false
|
||||
Global.control.file_menu.set_item_text(3, tr("Save") + " %s" % path.get_file())
|
||||
Global.file_menu.get_popup().set_item_text(3, tr("Save") + " %s" % path.get_file())
|
||||
|
||||
else:
|
||||
Global.notification_label("File failed to save")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue