Skip to content

Commit

Permalink
Add info button for LSVL
Browse files Browse the repository at this point in the history
  • Loading branch information
Cvolton committed Aug 25, 2023
1 parent cd51ac6 commit 2f45e41
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/layers/LevelSearchViewLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,15 @@ bool LevelSearchViewLayer::init(BISearchObject searchObj) {
buttonButton->setAnchorPoint({0,0});
menu->addChild(buttonButton);

auto infoSprite = CCSprite::createWithSpriteFrameName("GJ_infoIcon_001.png");
auto infoBtn = CCMenuItemSpriteExtra::create(
infoSprite,
this,
menu_selector(LevelSearchViewLayer::onInfo)
);
infoBtn->setPosition({+ (winSize.width / 2) - 25, - (winSize.height / 2) + 25});
menu->addChild(infoBtn);

reload();

if(m_gjSearchObj && !(Mod::get()->getSavedValue<bool>("lsvl_seen_info"))) showInfoDialog();
Expand Down Expand Up @@ -339,6 +348,10 @@ void LevelSearchViewLayer::onFilters(cocos2d::CCObject*) {
searchOptions->show();
}

void LevelSearchViewLayer::onInfo(cocos2d::CCObject*) {
LevelSearchViewLayer::showInfoDialog();
}

void LevelSearchViewLayer::keyDown(enumKeyCodes key){
switch(key){
case KEY_Left:
Expand Down Expand Up @@ -367,7 +380,9 @@ void LevelSearchViewLayer::showInfoDialog() {
"This allows you to further filter search results in ways the server usually wouldn't allow you.\n"
"\n"
"All of the filtering is done <cg>client-side</c>.\n"
"As a result it may take a while to load all results depending on the filter combinations.",
"As a result it may take a while to load all results depending on the filter combinations.\n"
"\n"
"Press the <cy>Filters</c> <cp>button</c> in the bottom left corner to change the enabled search filters.",

"OK",
nullptr,
Expand Down
1 change: 1 addition & 0 deletions src/layers/LevelSearchViewLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class LevelSearchViewLayer : public cocos2d::CCLayer, public OnlineListDelegate,
void onPrev(cocos2d::CCObject*);
void onNext(cocos2d::CCObject*);
void onFilters(cocos2d::CCObject*);
void onInfo(cocos2d::CCObject*);
void keyDown(cocos2d::enumKeyCodes key);

void loadListFinished(cocos2d::CCArray*, const char*);
Expand Down

0 comments on commit 2f45e41

Please sign in to comment.