summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-11-06 00:14:36 +0000
committerDarkvater <darkvater@openttd.org>2006-11-06 00:14:36 +0000
commitc94db0a92914ea433ba76127f177ba365dee1ea0 (patch)
treec445001f1e05ccfd3c5f3c7af14004f15c5fac9a
parentd327ffb0f44e4b5ccff615a362143f50053bc062 (diff)
downloadopenttd-c94db0a92914ea433ba76127f177ba365dee1ea0.tar.xz
(svn r7077) -Codechange: Send proper message to network window, and handle selection control in
there instead of calling function.
-rw-r--r--network_gui.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/network_gui.c b/network_gui.c
index d254e67b5..f3615f01c 100644
--- a/network_gui.c
+++ b/network_gui.c
@@ -97,15 +97,12 @@ enum {
NET_PRC__SIZE_OF_ROW = 14,
};
-// called when a new server is found on the network
+/** Update the network new window because a new server is
+ * found on the network.
+ * @param unselect unselect the currently selected item */
void UpdateNetworkGameWindow(bool unselect)
{
- Window *w = FindWindowById(WC_NETWORK_WINDOW, 0);
-
- if (w != NULL) {
- if (unselect) WP(w, network_ql_d).n.server = NULL;
- SendWindowMessage(WC_NETWORK_WINDOW, 0, true, 0, 0);
- }
+ SendWindowMessage(WC_NETWORK_WINDOW, 0, unselect, 0, 0);
}
static bool _internal_sort_order; // Used for Qsort order-flipping
@@ -457,6 +454,7 @@ static void NetworkGameWindowWndProc(Window *w, WindowEvent *e)
break;
case WE_MESSAGE:
+ if (e->we.message.msg != 0) nd->server = NULL;
ld->flags |= VL_REBUILD;
SetWindowDirty(w);
break;