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.
This commit is contained in:
Yexo 2020-06-01 10:19:47 +02:00 committed by Yexo
parent 281d93f600
commit a9b3312d1a
1 changed files with 1 additions and 1 deletions

View File

@ -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