Skip to content

Commit

Permalink
add featured lite
Browse files Browse the repository at this point in the history
  • Loading branch information
Cvolton committed Nov 25, 2024
1 parent 08b7ea7 commit 27338ad
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
Binary file added resources/BI_featuredLiteBtn_001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions src/layers/CustomCreatorLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ bool CustomCreatorLayer::init() {
featuredBtn->setSizeMult(1.2f);
featuredBtn->setID("featured-button"_spr);

auto featuredLiteBtn = CCMenuItemSpriteExtra::create(
BetterInfo::createWithBISpriteFrameName("BI_featuredLiteBtn_001.png"),
this,
menu_selector(CustomCreatorLayer::onFeaturedLite)
);
buttonsMenu->addChild(featuredLiteBtn);
featuredLiteBtn->setSizeMult(1.2f);
featuredLiteBtn->setID("featured-lite-button"_spr);

auto fameBtn = CCMenuItemSpriteExtra::create(
BetterInfo::createBISprite("GJ_fameBtn_001.png"),
this,
Expand Down Expand Up @@ -184,6 +193,15 @@ void CustomCreatorLayer::onFeatured(CCObject* object) {
CCDirector::sharedDirector()->pushScene(transitionFade);
}

void CustomCreatorLayer::onFeaturedLite(CCObject* object) {
auto searchObject = GJSearchObject::create(SearchType::FeaturedLite);
auto browserLayer = LevelBrowserLayer::scene(searchObject);

auto transitionFade = CCTransitionFade::create(0.5, browserLayer);

CCDirector::sharedDirector()->pushScene(transitionFade);
}

void CustomCreatorLayer::onMostLiked(CCObject* object) {
auto searchObject = GJSearchObject::create(SearchType::LikedGDW);
auto browserLayer = LevelBrowserLayer::scene(searchObject);
Expand Down
1 change: 1 addition & 0 deletions src/layers/CustomCreatorLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class BI_DLL CustomCreatorLayer : public BIBaseLayer {
virtual bool init();
void onBack(cocos2d::CCObject*);
void onFeatured(cocos2d::CCObject*);
void onFeaturedLite(cocos2d::CCObject*);
void onMostLiked(cocos2d::CCObject*);
void onDaily(cocos2d::CCObject*);
void onWeekly(cocos2d::CCObject*);
Expand Down

0 comments on commit 27338ad

Please sign in to comment.