From 0ffb2a6cf9c69c0b17565a6c6209c11701e2757e Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Thu, 21 Nov 2019 20:13:15 +0100 Subject: [PATCH] Display the name of the currently open file in the window title This also removes the version number from the window title, as it can be seen in the About dialog. --- Scripts/Main.gd | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Scripts/Main.gd b/Scripts/Main.gd index 061793ca9..c3167a8ec 100644 --- a/Scripts/Main.gd +++ b/Scripts/Main.gd @@ -17,7 +17,7 @@ var animation_forward := true # Called when the node enters the scene tree for the first time. func _ready() -> void: - OS.set_window_title("Pixelorama %s" % ProjectSettings.get_setting("application/config/Version")) + OS.set_window_title("(untitled) - Pixelorama") # Set a minimum window size to prevent UI elements from collapsing on each other. # This property is only available in 3.2alpha or later, so use `set()` to fail gracefully if it doesn't exist. OS.set("min_window_size", Vector2(1152, 648)) @@ -281,7 +281,7 @@ func _on_CreateNewImage_confirmed() -> void: Global.canvas.update_texture(0) Global.undo_redo.clear_history(false) -func _on_OpenSprite_file_selected(path) -> void: +func _on_OpenSprite_file_selected(path : String) -> void: var file := File.new() var err := file.open(path, File.READ) if err != OK: #An error occured @@ -355,6 +355,9 @@ func _on_OpenSprite_file_selected(path) -> void: file.close() Global.undo_redo.clear_history(false) + OS.set_window_title(path.get_file() + " - Pixelorama") + + func _on_SaveSprite_file_selected(path) -> void: current_save_path = path var file := File.new()