1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-19 20:49:11 +00:00

Fix #6780: Some windows didn't get updated from OnTick() (#7048)

This commit is contained in:
2019-01-12 23:23:23 +00:00
committed by Charles Pigott
parent 9aecbac2b4
commit 5ff0c24993
5 changed files with 35 additions and 18 deletions

View File

@@ -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();
}
};