diff --git a/src/Autoload/Global.gd b/src/Autoload/Global.gd index d2b8a4abe..415d4a48c 100644 --- a/src/Autoload/Global.gd +++ b/src/Autoload/Global.gd @@ -578,7 +578,6 @@ var layer_button_node := preload("res://src/UI/Timeline/LayerButton.tscn") ## The [PackedScene] of the button used by cels in the timeline. var cel_button_scene: PackedScene = load("res://src/UI/Timeline/CelButton.tscn") -@onready var main_window := get_window() ## The main Pixelorama [Window]. ## The control node (aka Main node). It has the [param Main.gd] script attached. @onready var control := get_tree().current_scene as Control @@ -942,7 +941,7 @@ func undo_or_redo( canvas_preview_container.canvas_preview.queue_redraw() if !project.has_changed: if project == current_project: - main_window.title = main_window.title + "(*)" + get_window().title = get_window().title + "(*)" project.has_changed = true diff --git a/src/Autoload/OpenSave.gd b/src/Autoload/OpenSave.gd index f1f67b6de..112038558 100644 --- a/src/Autoload/OpenSave.gd +++ b/src/Autoload/OpenSave.gd @@ -275,7 +275,7 @@ func open_pxo_file(path: String, is_backup := false, replace_empty := true) -> v else: # Loading a backup should not change window title and save path new_project.save_path = path - Global.main_window.title = new_project.name + " - Pixelorama " + Global.current_version + get_window().title = new_project.name + " - Pixelorama " + Global.current_version Global.save_sprites_dialog.current_path = path # Set last opened project path and save Global.config_cache.set_value("data", "current_dir", path.get_base_dir()) @@ -437,7 +437,7 @@ func save_pxo_file( project.has_changed = false Global.current_project.remove_backup_file() Global.notification_label("File saved") - Global.main_window.title = project.name + " - Pixelorama " + Global.current_version + get_window().title = project.name + " - Pixelorama " + Global.current_version # Set last opened project path and save Global.config_cache.set_value("data", "current_dir", path.get_base_dir()) @@ -798,11 +798,11 @@ func set_new_imported_tab(project: Project, path: String) -> void: var prev_project_empty := Global.current_project.is_empty() var prev_project_pos := Global.current_project_index - Global.main_window.title = ( + get_window().title = ( path.get_file() + " (" + tr("imported") + ") - Pixelorama " + Global.current_version ) if project.has_changed: - Global.main_window.title = Global.main_window.title + "(*)" + get_window().title = get_window().title + "(*)" var file_name := path.get_basename().get_file() project.export_directory_path = path.get_base_dir() project.file_name = file_name diff --git a/src/Classes/Project.gd b/src/Classes/Project.gd index 50db0a0a9..177dc3623 100644 --- a/src/Classes/Project.gd +++ b/src/Classes/Project.gd @@ -198,9 +198,9 @@ func change_project() -> void: Brushes.add_project_brush(brush) Global.transparent_checker.update_rect() Global.cursor_position_label.text = "[%s×%s]" % [size.x, size.y] - Global.main_window.title = "%s - Pixelorama %s" % [name, Global.current_version] + Global.get_window().title = "%s - Pixelorama %s" % [name, Global.current_version] if has_changed: - Global.main_window.title = Global.main_window.title + "(*)" + Global.get_window().title = Global.get_window().title + "(*)" if export_directory_path != "": Global.open_sprites_dialog.current_path = export_directory_path Global.save_sprites_dialog.current_path = export_directory_path diff --git a/src/Main.gd b/src/Main.gd index a000895fd..1b82d10f5 100644 --- a/src/Main.gd +++ b/src/Main.gd @@ -165,7 +165,7 @@ func _init() -> void: func _ready() -> void: get_tree().set_auto_accept_quit(false) - Global.main_window.title = tr("untitled") + " - Pixelorama " + Global.current_version + get_window().title = tr("untitled") + " - Pixelorama " + Global.current_version Global.current_project.layers.append(PixelLayer.new(Global.current_project)) Global.current_project.frames.append(Global.current_project.new_empty_frame())