more improvements

This commit is contained in:
Jonas Weinz 2019-03-21 14:15:00 +01:00
parent 05e5456c4b
commit 7b4789dd2a
3 changed files with 9 additions and 2 deletions

View File

@ -117,6 +117,7 @@ on_close_click = function() {
else if (connection != null) else if (connection != null)
{ {
connection.on_close_click(); connection.on_close_click();
match_control.hide();
} }
} }

View File

@ -28,6 +28,11 @@ class OnlineMatchManager
this.match_button.className = "infobar-button-active"; this.match_button.className = "infobar-button-active";
if (this.match_state.active_player == this.local_player.get_name())
{
this.game_server_connection.notify("your turn against " + this.online_opponent.get_name());
}
this.is_closed = false; this.is_closed = false;
} }
@ -70,9 +75,9 @@ class OnlineMatchManager
this.match_state = match_state; this.match_state = match_state;
this.match_button.className = "infobar-button-active"; this.match_button.className = "infobar-button-active";
if (this.match_state.current_player != this.current_player_name) if (this.match_state.active_player == this.local_player.get_name())
{ {
this.game_server_connection.notify("" + this.online_opponent.get_name() + " moved"); this.game_server_connection.notify("your turn against " + this.online_opponent.get_name());
} }
} }

View File

@ -232,6 +232,7 @@ class WebsocketConnection
}; };
this.socket.send(JSON.stringify(msg_object)); this.socket.send(JSON.stringify(msg_object));
} }
send_match_request(player_name) send_match_request(player_name)