Skip to content

Commit

Permalink
add lists support to live comment refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
Cvolton committed Jan 13, 2024
1 parent b0ad045 commit 3434dd0
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions src/hooks/InfoLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ class $modify(BIInfoLayer, InfoLayer) {
GLM->resetCommentTimersForLevelID(this->m_score->m_userID, m_mode);
break;
case CommentKeyType::LevelList:
//GLM->resetCommentTimersForLevelID(this->m_level->m_levelID, m_mode);
//TODO: need levellist class members
GLM->resetCommentTimersForLevelID(- this->m_levelList->m_listID, m_mode);
break;
}

Expand Down Expand Up @@ -96,23 +95,8 @@ class $modify(BIInfoLayer, InfoLayer) {
menu->updateLayout();
}

if(level == nullptr) return true;
//end of level stuff

if(auto menu = m_mainLayer->getChildByID("refresh-menu")) {
auto searchSprite = CCSprite::createWithSpriteFrameName("gj_findBtn_001.png");
searchSprite->setScale(0.8f);
auto searchButton = CCMenuItemSpriteExtra::create(
searchSprite,
this,
menu_selector(BIInfoLayer::onCustomSearch)
);
menu->addChild(searchButton);
searchButton->setSizeMult(1.2f);
searchButton->setID("search-btn"_spr);

menu->updateLayout();
}
if(level == nullptr && list == nullptr) return true;
//end of profile stuff

auto scheduleOffSprite = CCSprite::createWithSpriteFrameName("GJ_playEditorBtn_001.png");
scheduleOffSprite->setScale(.625f);
Expand All @@ -133,6 +117,24 @@ class $modify(BIInfoLayer, InfoLayer) {
if(originalBtn->getPositionX() > 155.4f) originalBtn->setPosition({155.4f, originalBtn->getPositionY()});
}

if(level == nullptr) return true;
//end of list stuff

if(auto menu = m_mainLayer->getChildByID("refresh-menu")) {
auto searchSprite = CCSprite::createWithSpriteFrameName("gj_findBtn_001.png");
searchSprite->setScale(0.8f);
auto searchButton = CCMenuItemSpriteExtra::create(
searchSprite,
this,
menu_selector(BIInfoLayer::onCustomSearch)
);
menu->addChild(searchButton);
searchButton->setSizeMult(1.2f);
searchButton->setID("search-btn"_spr);

menu->updateLayout();
}

return true;
}

Expand Down

0 comments on commit 3434dd0

Please sign in to comment.