mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 10:34:43 -04:00
When exporting a png, "Export PNG..." becomes "Export (filename)"
Also updated the translations to simply translate "export". Feel free to fix anything I may did wrong.
This commit is contained in:
parent
a840f7d35f
commit
87d6d6140b
13 changed files with 662 additions and 166 deletions
|
@ -331,7 +331,7 @@ func _ready() -> void:
|
|||
|
||||
error_dialog = find_node_by_name(root, "ErrorDialog")
|
||||
|
||||
#Thanks to https://godotengine.org/qa/17524/how-to-find-an-instanced-scene-by-its-name
|
||||
# Thanks to https://godotengine.org/qa/17524/how-to-find-an-instanced-scene-by-its-name
|
||||
func find_node_by_name(root, node_name) -> Node:
|
||||
if root.get_name() == node_name:
|
||||
return root
|
||||
|
@ -373,8 +373,8 @@ func undo(_canvases : Array, layer_index : int = -1) -> void:
|
|||
if action_name == "Add Frame":
|
||||
canvas_parent.remove_child(_canvases[0])
|
||||
frame_container.remove_child(_canvases[0].frame_button)
|
||||
#This actually means that canvases.size is one, but it hasn't been updated yet
|
||||
if canvases.size() == 2: #Stop animating
|
||||
# This actually means that canvases.size is one, but it hasn't been updated yet
|
||||
if canvases.size() == 2: # Stop animating
|
||||
play_forward.pressed = false
|
||||
play_backwards.pressed = false
|
||||
animation_timer.stop()
|
||||
|
@ -392,7 +392,7 @@ func undo(_canvases : Array, layer_index : int = -1) -> void:
|
|||
|
||||
|
||||
func redo(_canvases : Array, layer_index : int = -1) -> void:
|
||||
if undos < undo_redo.get_version(): #If we did undo and then redo
|
||||
if undos < undo_redo.get_version(): # If we did undo and then redo
|
||||
undos = undo_redo.get_version()
|
||||
var action_name := undo_redo.get_current_action_name()
|
||||
if action_name == "Draw" || action_name == "Rectangle Select" || action_name == "Scale" || action_name == "Merge Layer":
|
||||
|
@ -419,7 +419,7 @@ func redo(_canvases : Array, layer_index : int = -1) -> void:
|
|||
elif action_name == "Remove Frame":
|
||||
canvas_parent.remove_child(_canvases[0])
|
||||
frame_container.remove_child(_canvases[0].frame_button)
|
||||
if canvases.size() == 1: #Stop animating
|
||||
if canvases.size() == 1: # Stop animating
|
||||
play_forward.pressed = false
|
||||
play_backwards.pressed = false
|
||||
animation_timer.stop()
|
||||
|
@ -485,7 +485,7 @@ func undo_custom_brush(_brush_button : BaseButton = null) -> void:
|
|||
notification_label("Undo: %s" % action_name)
|
||||
|
||||
func redo_custom_brush(_brush_button : BaseButton = null) -> void:
|
||||
if undos < undo_redo.get_version(): #If we did undo and then redo
|
||||
if undos < undo_redo.get_version(): # If we did undo and then redo
|
||||
undos = undo_redo.get_version()
|
||||
var action_name := undo_redo.get_current_action_name()
|
||||
if action_name == "Delete Custom Brush":
|
||||
|
|
|
@ -3,6 +3,7 @@ extends Control
|
|||
var current_save_path := ""
|
||||
var current_export_path := ""
|
||||
var opensprite_file_selected := false
|
||||
var file_menu : PopupMenu
|
||||
var view_menu : PopupMenu
|
||||
var tools := []
|
||||
var import_as_new_frame : CheckBox
|
||||
|
@ -100,7 +101,7 @@ func _ready() -> void:
|
|||
theme.default_font = preload("res://Assets/Fonts/Roboto-Regular.tres")
|
||||
|
||||
|
||||
var file_menu : PopupMenu = Global.file_menu.get_popup()
|
||||
file_menu = Global.file_menu.get_popup()
|
||||
var edit_menu : PopupMenu = Global.edit_menu.get_popup()
|
||||
view_menu = Global.view_menu.get_popup()
|
||||
var image_menu : PopupMenu = Global.image_menu.get_popup()
|
||||
|
@ -586,9 +587,11 @@ func clear_canvases() -> void:
|
|||
Global.canvases.clear()
|
||||
current_save_path = ""
|
||||
current_export_path = ""
|
||||
file_menu.set_item_text(5, "Export PNG...")
|
||||
|
||||
func _on_ExportSprites_file_selected(path : String) -> void:
|
||||
current_export_path = path
|
||||
file_menu.set_item_text(5, tr("Export") + " %s" % path.get_file())
|
||||
export_project()
|
||||
|
||||
func export_project() -> void:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue