summaryrefslogtreecommitdiff
path: root/network_client.c
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-12-30 01:52:09 +0000
committerDarkvater <darkvater@openttd.org>2006-12-30 01:52:09 +0000
commitf475636186a7c4d3aac9ae8998cdd3cd9f3983f9 (patch)
tree1966fa0f816ba2f76eb61aa26361eda5de1eb0eb /network_client.c
parentc87fcab77216fa2a3c8a5a334c32099665b1241d (diff)
downloadopenttd-f475636186a7c4d3aac9ae8998cdd3cd9f3983f9.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.c10
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);
}
}