summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorYexo <yexo@openttd.org>2020-06-01 10:19:47 +0200
committerYexo <t.marinussen@gmail.com>2020-06-01 10:59:11 +0200
commita9b3312d1a4962d07a2e7976e8352c7113201a9e (patch)
tree1ad707a62a93573c014cc801e2456bf02fb6574d /src/network
parent281d93f60052703b82394ab63fcb063ba700e004 (diff)
downloadopenttd-a9b3312d1a4962d07a2e7976e8352c7113201a9e.tar.xz
Fix #8024: make online content gui more responsive while loading
Previously the internal content list was invalidated and sorted for every new item added. Now the sorting is delayed until the GUI is drawn, which means we only sort once per GUI tick. Since the amount of incoming items per GUI tick is not controlled by the GUI but rather by network speed, we were previously doing a lot of duplicate work per tick, causing the mouse cursor to lag while the list was initialized.
Diffstat (limited to 'src/network')
-rw-r--r--src/network/network_content_gui.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp
index 6083396ee..dd87a4948 100644
--- a/src/network/network_content_gui.cpp
+++ b/src/network/network_content_gui.cpp
@@ -951,7 +951,7 @@ public:
{
if (this->auto_select && !rci->IsSelected()) _network_content_client.ToggleSelectedState(rci);
this->content.ForceRebuild();
- this->InvalidateData();
+ this->InvalidateData(0, false);
}
void OnDownloadComplete(ContentID cid) override