mirror of https://github.com/AxioDL/metaforce.git
CLogBookScreen: Make use of std::any_of within IsScanCategoryReady()
Same thing but collapses into a single return.
This commit is contained in:
parent
251a2a7723
commit
d64824d3e5
|
@ -159,16 +159,19 @@ void CLogBookScreen::PumpArticleLoad() {
|
|||
}
|
||||
|
||||
bool CLogBookScreen::IsScanCategoryReady(CSaveWorld::EScanCategory category) const {
|
||||
CPlayerState& playerState = *x4_mgr.GetPlayerState();
|
||||
for (const std::pair<CAssetId, CSaveWorld::EScanCategory>& scanState : g_MemoryCardSys->GetScanStates()) {
|
||||
if (scanState.second != category)
|
||||
continue;
|
||||
if (IsScanComplete(scanState.second, scanState.first, playerState))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
const CPlayerState& playerState = *x4_mgr.GetPlayerState();
|
||||
const auto& scanState = g_MemoryCardSys->GetScanStates();
|
||||
|
||||
return std::any_of(scanState.cbegin(), scanState.cend(), [category, &playerState](const auto& state) {
|
||||
if (state.second != category) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return IsScanComplete(state.second, state.first, playerState);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
void CLogBookScreen::UpdateBodyText() {
|
||||
if (x10_mode != EMode::TextScroll) {
|
||||
x174_textpane_body->TextSupport().SetText(u"");
|
||||
|
|
Loading…
Reference in New Issue