diff options
author | Darkvater <Darkvater@openttd.org> | 2006-12-30 01:52:09 +0000 |
---|---|---|
committer | Darkvater <Darkvater@openttd.org> | 2006-12-30 01:52:09 +0000 |
commit | 6250b90a6bfe73d96ec02e9bc81af323f55b857d (patch) | |
tree | 1966fa0f816ba2f76eb61aa26361eda5de1eb0eb /network_client.c | |
parent | 990270fda928f7ce9e0638189b8fc65683583e71 (diff) | |
download | openttd-6250b90a6bfe73d96ec02e9bc81af323f55b857d.tar.xz |
(svn r7638) -Codechange: Remove special window ShowJoinStatusWindowAfterJoin and shuffle around
some code for SetupColorsAndInitialWindow. Because we know that after a successful
load all windows are removed we can setup default windows in this function, and
show ShowJoinStatusWindow in PACKET_SERVER_MAP.
-Setup the global _network_join_status for ShowJoinStatusWindow in the only two
places where the function is called, instead of inside it.
-Turn the join status window into a modal window of the network window so it
stays on top.
Diffstat (limited to 'network_client.c')
-rw-r--r-- | network_client.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/network_client.c b/network_client.c index ef0ae0e03..39a12c28c 100644 --- a/network_client.c +++ b/network_client.c @@ -497,6 +497,8 @@ DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_MAP) _switch_mode_errorstr = STR_NETWORK_ERR_SAVEGAMEERROR; return NETWORK_RECV_STATUS_SAVEGAME; } + /* If the savegame has successfully loaded, ALL windows have been removed, + * only toolbar/statusbar and gamefield are visible */ _opt_ptr = &_opt; // during a network game you are always in-game @@ -510,18 +512,16 @@ DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_MAP) SetLocalPlayer(PLAYER_SPECTATOR); - if (_network_playas == PLAYER_SPECTATOR) { - // The client wants to be a spectator.. - DeleteWindowById(WC_NETWORK_STATUS_WINDOW, 0); - } else { + if (_network_playas != PLAYER_SPECTATOR) { /* We have arrived and ready to start playing; send a command to make a new player; * the server will give us a client-id and let us in */ + _network_join_status = NETWORK_JOIN_STATUS_REGISTERING; + ShowJoinStatusWindow(); NetworkSend_Command(0, 0, 0, CMD_PLAYER_CTRL, NULL); } } else { // take control over an existing company SetLocalPlayer(_network_playas); - DeleteWindowById(WC_NETWORK_STATUS_WINDOW, 0); } } |