summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-12-23 17:12:20 +0000
committerrubidium <rubidium@openttd.org>2008-12-23 17:12:20 +0000
commitf7a52c4444a5ef00a1d84362c0af02bd982e67d2 (patch)
tree2f178e1efb8b624ca7b17bf994f30da334b0f6e6
parentbc8984a9bbe3974c6ca606569d54947a99395244 (diff)
downloadopenttd-f7a52c4444a5ef00a1d84362c0af02bd982e67d2.tar.xz
(svn r14728) -Fix [FS#2470]: don't select anything when opening the client list.
-Fix: don't show clients that are "only" in the lobby.
-rw-r--r--src/network/network_gui.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp
index d0ea0551d..e4bcde4fa 100644
--- a/src/network/network_gui.cpp
+++ b/src/network/network_gui.cpp
@@ -1639,13 +1639,13 @@ static void PopupClientList(int client_no, int x, int y)
*/
struct NetworkClientListWindow : Window
{
- byte selected_item;
- byte selected_y;
+ int selected_item;
+ int selected_y;
NetworkClientListWindow(const WindowDesc *desc, WindowNumber window_number) :
Window(desc, window_number),
- selected_item(0),
- selected_y(255)
+ selected_item(-1),
+ selected_y(0)
{
this->FindWindowPlacementAndResize(desc);
}
@@ -1660,7 +1660,7 @@ struct NetworkClientListWindow : Window
/* Should be replaced with a loop through all clients */
FOR_ALL_CLIENT_INFOS(ci) {
- num++;
+ if (ci->client_playas != COMPANY_INACTIVE_CLIENT) num++;
}
num *= CLNWND_ROWSIZE;
@@ -1716,7 +1716,7 @@ struct NetworkClientListWindow : Window
virtual void OnClick(Point pt, int widget)
{
/* Show the popup with option */
- if (this->selected_item != 255) {
+ if (this->selected_item != -1) {
PopupClientList(this->selected_item, pt.x + this->left, pt.y + this->top);
}
}
@@ -1726,7 +1726,7 @@ struct NetworkClientListWindow : Window
/* -1 means we left the current window */
if (pt.y == -1) {
this->selected_y = 0;
- this->selected_item = 255;
+ this->selected_item = -1;
this->SetDirty();
return;
}
@@ -1738,7 +1738,7 @@ struct NetworkClientListWindow : Window
if (pt.y > CLNWND_OFFSET) {
this->selected_item = (pt.y - CLNWND_OFFSET) / CLNWND_ROWSIZE;
} else {
- this->selected_item = 255;
+ this->selected_item = -1;
}
/* Repaint */