From 34cb198dee827a4e5e504e15df4f37ad405cd28c Mon Sep 17 00:00:00 2001 From: av-dx Date: Sun, 30 May 2021 04:19:09 +0530 Subject: [PATCH] GUI: Group entries by "gameid". --- gui/widget.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gui/widget.cpp b/gui/widget.cpp index 06c6e43f75c..45966a6afc7 100644 --- a/gui/widget.cpp +++ b/gui/widget.cpp @@ -1153,7 +1153,7 @@ void GridWidget::gridFromGameList(Common::Array *list) { int k = 0; for (Common::Array::iterator i = list->begin(); i != list->end(); ++i) { k = row * entriesPerRow + col; - EntryContainerWidget *newEntry = entryById[i->key]; + EntryContainerWidget *newEntry = entryById[i->domain->getVal("gameid")]; if (!newEntry) { GraphicsWidget *th = new GraphicsWidget(this, 0, 0 , kThumbnailWidth, kThumbnailHeight); GraphicsWidget *p = new GraphicsWidget(this, kThumbnailWidth - 32, kThumbnailHeight - 32, 32, 32); @@ -1171,15 +1171,15 @@ void GridWidget::gridFromGameList(Common::Array *list) { // newEntry = new EntryContainerWidget(this, 50 + col * (kThumbnailWidth + 50), 50 + row * (kThumbnailHeight + 80), kThumbnailWidth, kThumbnailHeight+kLineHeight*2); _entries.push_back(newEntry); + if (++col >= entriesPerRow) { + ++row; + col = 0; + } + ++k; } newEntry->addInstallation(*i); newEntry->updateEntry(); - entryById[i->key] = newEntry; - if (++col >= entriesPerRow) { - ++row; - col = 0; - } - ++k; + entryById[i->domain->getVal("gameid")] = newEntry; } _innerHeight = 100 + (row * (kThumbnailHeight + 80)); _innerWidth = 100 + (col * (kThumbnailWidth + 50));