From 2a4d823c289deba34440389cde4682b20cd5b255 Mon Sep 17 00:00:00 2001 From: osquallo Date: Wed, 8 Aug 2018 14:59:20 +0200 Subject: [PATCH] correction d'un erreur avec change_title lorsquele node n'existe pas encore. --- scenes/Main.gd | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/scenes/Main.gd b/scenes/Main.gd index 0988c98..0aece0f 100644 --- a/scenes/Main.gd +++ b/scenes/Main.gd @@ -21,12 +21,13 @@ func on_window_size_changed(): change_title() func change_title(): - var title_node = get_node( WINDOW_TITLE_INPUT ) - var title = "Khanat" - if title_node and not title_node.text.strip_edges() == "": - title = title_node.text.strip_edges() - title += " (" + String(OS.get_window_size().x) + "x" + String(OS.get_window_size().y) + ")" - OS.set_window_title( title ) + if has_node( WINDOW_TITLE_INPUT ): + var title_node = get_node( WINDOW_TITLE_INPUT ) + var title = "Khanat" + if title_node and not title_node.text.strip_edges() == "": + title = title_node.text.strip_edges() + title += " (" + String(OS.get_window_size().x) + "x" + String(OS.get_window_size().y) + ")" + OS.set_window_title( title ) func _on_login_scene_character_creation_finished(): var config_file = ConfigFile.new()