Skip to content

Commit ecdf5c6

Browse files
committed
Added event levels notifications
1 parent bb505cc commit ecdf5c6

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

mod.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,20 @@
8989
"default": true
9090
},
9191
"daily": {
92-
"name": "Daily",
92+
"name": "Daily Levels",
9393
"description": "Whether or not to notify about upcoming <cy>Daily Levels</c>",
9494
"type": "bool",
9595
"default": true
9696
},
9797
"weekly": {
98-
"name": "Weekly",
99-
"description": "Whether or not to notify about upcoming <cy>Weekly Demons</c>",
98+
"name": "Weekly Levels",
99+
"description": "Whether or not to notify about upcoming <cr>Weekly Demons</c>",
100+
"type": "bool",
101+
"default": true
102+
},
103+
"event": {
104+
"name": "Event Levels",
105+
"description": "Whether or not to notify about upcoming <cp>Event Levels</c>",
100106
"type": "bool",
101107
"default": true
102108
},

src/Notifications/EventsPush.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,9 @@ void EventsPush::onClickBtn(CCObject* ret) {
356356
} else if (eventType == EventType::Weekly) {
357357
DailyLevelPage::create(GJTimedLevelType::Weekly)->show();
358358
return;
359+
} else if (eventType == EventType::Event) {
360+
DailyLevelPage::create(GJTimedLevelType::Event)->show();
361+
return;
359362
} else if (eventType == EventType::List) {
360363
if (events_layer->level->m_levelID == 0) return;
361364

@@ -419,6 +422,7 @@ bool EventsPush::init(sio::message::ptr const& data) {
419422
bool newRate = Mod::get()->template getSettingValue<bool>("newRate");
420423
bool daily = Mod::get()->template getSettingValue<bool>("daily");
421424
bool weekly = Mod::get()->template getSettingValue<bool>("weekly");
425+
bool event = Mod::get()->template getSettingValue<bool>("event");
422426
bool smallChest = Mod::get()->template getSettingValue<bool>("smallChest");
423427
bool largeChest = Mod::get()->template getSettingValue<bool>("largeChest");
424428
bool list = Mod::get()->template getSettingValue<bool>("newListRate");
@@ -441,6 +445,9 @@ bool EventsPush::init(sio::message::ptr const& data) {
441445
case 5: // List
442446
eventType = EventType::List;
443447
break;
448+
case 6: // Event
449+
eventType = EventType::Event;
450+
break;
444451
}
445452
if (type == 0 && !newRate) {
446453
EventsPush::eventCompletedCallback(scene);
@@ -466,6 +473,10 @@ bool EventsPush::init(sio::message::ptr const& data) {
466473
EventsPush::eventCompletedCallback(scene);
467474
return true;
468475
}
476+
if (type == 6 && !event) {
477+
EventsPush::eventCompletedCallback(scene);
478+
return true;
479+
}
469480

470481
auto director = CCDirector::sharedDirector();
471482
auto winSize = director->getWinSize();
@@ -793,10 +804,12 @@ bool EventsPush::init(sio::message::ptr const& data) {
793804
level_title->limitLabelWidth(120, 0.46f, 0.1f);
794805
node->addChild(level_title);
795806

796-
if (type > 0 && type < 3) {
807+
if ((type > 0 && type < 3) || type == 6) {
797808
CCSprite* crown;
798809
if (type == 1) {
799810
crown = cocos2d::CCSprite::createWithSpriteFrameName("gj_dailyCrown_001.png");
811+
} else if (type == 6) {
812+
crown = cocos2d::CCSprite::createWithSpriteFrameName("gj_eventCrown_001.png");
800813
} else {
801814
crown = cocos2d::CCSprite::createWithSpriteFrameName("gj_weeklyCrown_001.png");
802815
}

src/Notifications/EventsPush.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ enum EventType {
77
Rate,
88
Daily,
99
Weekly,
10+
Event,
1011
smallChest,
1112
largeChest,
1213
List,

0 commit comments

Comments
 (0)