summaryrefslogtreecommitdiff
path: root/src/network/network_gui.cpp
diff options
context:
space:
mode:
authorPeterN <peter@fuzzle.org>2019-01-12 23:23:23 +0000
committerCharles Pigott <charlespigott@googlemail.com>2019-01-12 23:23:23 +0000
commit5ff0c24993c52546f1809e87a036d1e8f21d6e17 (patch)
tree7c1440ca7eb772f21ecd47e7f54f8226d87e03d9 /src/network/network_gui.cpp
parent9aecbac2b4a4137abc44ff12a672916ec7482047 (diff)
downloadopenttd-5ff0c24993c52546f1809e87a036d1e8f21d6e17.tar.xz
Fix #6780: Some windows didn't get updated from OnTick() (#7048)
Diffstat (limited to 'src/network/network_gui.cpp')
-rw-r--r--src/network/network_gui.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp
index 3e4a4b050..65ecb3b99 100644
--- a/src/network/network_gui.cpp
+++ b/src/network/network_gui.cpp
@@ -31,6 +31,7 @@
#include "../core/geometry_func.hpp"
#include "../genworld.h"
#include "../map_type.h"
+#include "../guitimer_func.h"
#include "../widgets/network_widget.h"
@@ -234,6 +235,7 @@ protected:
Scrollbar *vscroll; ///< vertical scrollbar of the list of servers
QueryString name_editbox; ///< Client name editbox.
QueryString filter_editbox; ///< Editbox for filter on servers
+ GUITimer requery_timer; ///< Timer for network requery
int lock_offset; ///< Left offset for lock icon.
int blot_offset; ///< Left offset for green/yellow/red compatibility icon.
@@ -480,6 +482,8 @@ public:
this->server = this->last_joined;
if (this->last_joined != NULL) NetworkUDPQueryServer(this->last_joined->address);
+ this->requery_timer.SetInterval(MILLISECONDS_PER_TICK);
+
this->servers.SetListing(this->last_sorting);
this->servers.SetSortFuncs(this->sorter_funcs);
this->servers.SetFilterFuncs(this->filter_funcs);
@@ -903,8 +907,11 @@ public:
this->vscroll->SetCapacityFromWidget(this, WID_NG_MATRIX);
}
- virtual void OnTick()
+ virtual void OnRealtimeTick(uint delta_ms)
{
+ if (!this->requery_timer.Elapsed(delta_ms)) return;
+ this->requery_timer.SetInterval(MILLISECONDS_PER_TICK);
+
NetworkGameListRequery();
}
};