From ec58b28375d8030b470a50d21344875390732fb0 Mon Sep 17 00:00:00 2001 From: Stanislas Dolcini Date: Mon, 8 Oct 2018 12:24:07 +0200 Subject: [PATCH] Only go to the next window if login is successful --- gui_scene/GUI/login/login_menu.gd | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gui_scene/GUI/login/login_menu.gd b/gui_scene/GUI/login/login_menu.gd index 79c014a..3e4e835 100644 --- a/gui_scene/GUI/login/login_menu.gd +++ b/gui_scene/GUI/login/login_menu.gd @@ -7,7 +7,6 @@ func _on_login_button_pressed(): func _on_play_button_pressed(): - #emit_signal( "login_button_pressed" ) var username = get_node("h_box_container/v_box_container/margin_container/login_box/email_box/email_edit").get_text(); var password = get_node("h_box_container/v_box_container/margin_container/login_box/password_box/password_edit").get_text(); if username != null and username != "" and password != null and password != "": @@ -34,9 +33,10 @@ func do_request(username, password): func _on_HTTPRequest_request_completed(result, response_code, headers, body): var s = body.get_string_from_utf8().split(":") - print(s) - var ctn = s[1] - print(ctn) + var ctn = s[0] + # No error so login was successful. + if(ctn != "0"): + emit_signal( "login_button_pressed" ) func _make_post_request(url, data_to_send, use_ssl):