(svn r22361) -Codechange: delete the client list popup when the client got removed (instead of previously selecting some other client)

This commit is contained in:
rubidium 2011-04-22 15:53:40 +00:00
parent 2802c742a4
commit 393fb8e46b
3 changed files with 5 additions and 4 deletions

View File

@ -556,7 +556,7 @@ Company *DoStartupNewCompany(bool is_ai, CompanyID company = INVALID_COMPANY)
GeneratePresidentName(c);
SetWindowDirty(WC_GRAPH_LEGEND, 0);
SetWindowDirty(WC_CLIENT_LIST_POPUP, 0);
SetWindowClassesDirty(WC_CLIENT_LIST_POPUP);
SetWindowDirty(WC_CLIENT_LIST, 0);
BuildOwnerLegend();
InvalidateWindowData(WC_SMALLMAP, 0, 1);

View File

@ -1797,7 +1797,7 @@ struct NetworkClientListPopupWindow : Window {
}
this->flags4 &= ~WF_WHITE_BORDER_MASK;
this->InitNested(desc, 0);
this->InitNested(desc, client_id);
}
virtual Point OnInitialPosition(const WindowDesc *desc, int16 sm_width, int16 sm_height, int window_number)
@ -1852,7 +1852,7 @@ struct NetworkClientListPopupWindow : Window {
if (ci != NULL) this->actions[index].proc(ci);
}
DeleteWindowById(WC_CLIENT_LIST_POPUP, 0);
DeleteWindowByClass(WC_CLIENT_LIST_POPUP);
}
}
};
@ -1862,7 +1862,7 @@ struct NetworkClientListPopupWindow : Window {
*/
static void PopupClientList(ClientID client_id, int x, int y)
{
DeleteWindowById(WC_CLIENT_LIST_POPUP, 0);
DeleteWindowByClass(WC_CLIENT_LIST_POPUP);
if (NetworkFindClientInfoFromClientID(client_id) == NULL) return;

View File

@ -253,6 +253,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::CloseConnection(NetworkRecvSta
extern byte _network_clients_connected;
_network_clients_connected--;
DeleteWindowById(WC_CLIENT_LIST_POPUP, this->client_id);
SetWindowDirty(WC_CLIENT_LIST, 0);
this->SendPackets(true);