(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.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user