mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 13:44:42 -04:00
* Add request #276 * Remove a warning message * Some fixes * Bug fix. Remove Global.save_project_to_recent_list() from src/Main.gd Co-authored-by: Daniel Simon <dasimon@gmx.org>
This commit is contained in:
parent
d85efce73a
commit
7126074a0e
5 changed files with 76 additions and 4 deletions
|
@ -23,21 +23,33 @@ func setup_file_menu() -> void:
|
|||
"Save as..." : InputMap.get_action_list("save_file_as")[0].get_scancode_with_modifiers(),
|
||||
"Export..." : InputMap.get_action_list("export_file")[0].get_scancode_with_modifiers(),
|
||||
"Export as..." : InputMap.get_action_list("export_file_as")[0].get_scancode_with_modifiers(),
|
||||
"Recent projects": 0,
|
||||
"Quit" : InputMap.get_action_list("quit")[0].get_scancode_with_modifiers(),
|
||||
}
|
||||
file_menu = Global.file_menu.get_popup()
|
||||
var i := 0
|
||||
|
||||
for item in file_menu_items.keys():
|
||||
file_menu.add_item(item, i, file_menu_items[item])
|
||||
i += 1
|
||||
|
||||
if item == "Recent projects":
|
||||
setup_recent_projects_submenu(item)
|
||||
else:
|
||||
file_menu.add_item(item, i, file_menu_items[item])
|
||||
i += 1
|
||||
|
||||
file_menu.connect("id_pressed", self, "file_menu_id_pressed")
|
||||
|
||||
|
||||
if OS.get_name() == "HTML5":
|
||||
file_menu.set_item_disabled(2, true)
|
||||
|
||||
|
||||
func setup_recent_projects_submenu(item : String) -> void:
|
||||
Global.recent_projects_submenu.connect("id_pressed", self, "on_recent_projects_submenu_id_pressed")
|
||||
Global.update_recent_projects_submenu()
|
||||
|
||||
file_menu.add_child(Global.recent_projects_submenu)
|
||||
file_menu.add_submenu_item(item, Global.recent_projects_submenu.get_name())
|
||||
|
||||
|
||||
func setup_edit_menu() -> void:
|
||||
var edit_menu_items := {
|
||||
"Undo" : InputMap.get_action_list("undo")[0].get_scancode_with_modifiers(),
|
||||
|
@ -202,6 +214,10 @@ func export_file() -> void:
|
|||
Export.external_export()
|
||||
|
||||
|
||||
func on_recent_projects_submenu_id_pressed(id : int) -> void:
|
||||
Global.control.load_recent_project_file(Global.recent_projects[id])
|
||||
|
||||
|
||||
func edit_menu_id_pressed(id : int) -> void:
|
||||
match id:
|
||||
0: # Undo
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue