MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / updateCodexList

Method updateCodexList

source/frontend/StarCodexInterface.cpp:143–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143void 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}

Callers

nothing calls this directly

Calls 9

filterFunction · 0.85
removeAllChildrenMethod · 0.80
addItemMethod · 0.80
setImageMethod · 0.80
iconMethod · 0.80
codexesMethod · 0.45
speciesMethod · 0.45
setTextMethod · 0.45
titleMethod · 0.45

Tested by

no test coverage detected