| 141 | } |
| 142 | |
| 143 | void CodexInterface::updateCodexList() { |
| 144 | auto newCodexList = m_player->codexes()->codexes(); |
| 145 | filter(newCodexList, [&](auto const& p) { |
| 146 | return p.first->species() == m_currentSpecies; |
| 147 | }); |
| 148 | if (m_codexList != newCodexList) { |
| 149 | m_bookList->removeAllChildren(); |
| 150 | m_codexList = newCodexList; |
| 151 | for (auto entry : m_codexList) { |
| 152 | auto newEntry = m_bookList->addItem(); |
| 153 | newEntry->fetchChild<LabelWidget>("bookName")->setText(entry.first->title()); |
| 154 | newEntry->fetchChild<ImageWidget>("bookIcon")->setImage(entry.first->icon()); |
| 155 | } |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | } |