1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-31 07:29:49 +00:00

fix recent projects (#755)

This commit is contained in:
Variable 2022-09-20 23:14:42 +05:00 committed by GitHub
parent 950a6d77af
commit 56a113d36d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View file

@ -748,7 +748,7 @@ func save_project_to_recent_list(path: String) -> void:
return
if top_menu_container.recent_projects.has(path):
return
top_menu_container.recent_projects.erase(path)
if top_menu_container.recent_projects.size() >= 5:
top_menu_container.recent_projects.pop_front()

View file

@ -82,7 +82,9 @@ func _setup_recent_projects_submenu(item: String) -> void:
func update_recent_projects_submenu() -> void:
for project in recent_projects:
var reversed_recent_projects = recent_projects.duplicate()
reversed_recent_projects.invert()
for project in reversed_recent_projects:
recent_projects_submenu.add_item(project.get_file())
@ -394,7 +396,9 @@ func _export_file() -> void:
func _on_recent_projects_submenu_id_pressed(id: int) -> void:
Global.control.load_recent_project_file(recent_projects[id])
var reversed_recent_projects = recent_projects.duplicate()
reversed_recent_projects.invert()
Global.control.load_recent_project_file(reversed_recent_projects[id])
func edit_menu_id_pressed(id: int) -> void: