Skip to content

Commit

Permalink
add fallback lists loading, hide unnecessary buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
Cvolton committed Sep 28, 2024
1 parent a863678 commit e33e2b2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/managers/BetterInfoCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,24 @@ void BetterInfoCache::showClaimableLists() {
}
GameLevelManager::sharedState()->storeSearchResult(lists, fmt::format("{}:{}:{}", lists->count(), 0, lists->count()), searchObj->getKey());

//fallback code path for when cache fails to load any lists in time
if(lists->count() == 0 && m_claimableLists.size() > 0) {
searchObj = GJSearchObject::create(SearchType::Search, std::to_string(m_claimableLists.begin()->first));
searchObj->m_searchMode = 1;
}

auto scene = LevelBrowserLayer::scene(searchObj);
auto transitionFade = CCTransitionFade::create(0.5, scene);
CCDirector::sharedDirector()->pushScene(transitionFade);

if(auto LBL = getChildOfType<LevelBrowserLayer>(scene, 0)) {
LBL->m_refreshBtn->setVisible(false);
if(auto starButton = LBL->getChildByIDRecursive("star-button"_spr)) {
auto parent = starButton->getParent();
starButton->removeFromParent();
parent->updateLayout();
}
}
}

void BetterInfoCache::removeClaimedLists() {
Expand Down

0 comments on commit e33e2b2

Please sign in to comment.