Skip to content

Commit faae464

Browse files
Fix not being able to change the name of pxo files when saving them in the Web version
1 parent d0fef33 commit faae464

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/Main.gd

+6-3
Original file line numberDiff line numberDiff line change
@@ -456,9 +456,9 @@ func _on_OpenSprite_files_selected(paths: PackedStringArray) -> void:
456456
func show_save_dialog(project := Global.current_project) -> void:
457457
Global.dialog_open(true, true)
458458
if OS.get_name() == "Web":
459-
var save_filename := save_sprite_html5.get_node("%FileNameLineEdit")
460459
save_sprite_html5.popup_centered()
461-
save_filename.text = project.name
460+
var save_filename_line_edit := save_sprite_html5.get_node("%FileNameLineEdit")
461+
save_filename_line_edit.text = project.name
462462
else:
463463
save_sprite_dialog.popup_centered()
464464
save_sprite_dialog.get_line_edit().text = project.name
@@ -473,12 +473,15 @@ func _on_save_sprite_visibility_changed() -> void:
473473
is_quitting_on_save = false
474474

475475

476-
func save_project(path: String) -> void:
476+
func save_project(path: String, through_dialog := true) -> void:
477477
var project_to_save := Global.current_project
478478
if is_quitting_on_save:
479479
project_to_save = changed_projects_on_quit[0]
480480
var include_blended := false
481481
if OS.get_name() == "Web":
482+
if through_dialog:
483+
var save_filename_line_edit := save_sprite_html5.get_node("%FileNameLineEdit")
484+
project_to_save.name = save_filename_line_edit.text
482485
var file_name := project_to_save.name + ".pxo"
483486
path = "user://".path_join(file_name)
484487
include_blended = save_sprite_html5.get_node("%IncludeBlended").button_pressed

src/UI/TopMenuContainer/TopMenuContainer.gd

+1-1
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ func _save_project_file() -> void:
677677
if path == "":
678678
Global.control.show_save_dialog()
679679
else:
680-
Global.control.save_project(path)
680+
Global.control.save_project(path, false)
681681

682682

683683
func _export_file() -> void:

0 commit comments

Comments
 (0)