MCPcopy Create free account
hub / github.com/Open-GD/OpenGD / onChestClicked

Method onChestClicked

Source/RewardsPage.cpp:149–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147}
148
149void RewardsPage::onChestClicked(int chestID)
150{
151 if (_dailyChestTimer1->getString() == "00:00:00") return;
152
153 Label* timer;
154 RewardUnlockLayer* unlockLayer;
155
156 if (chestID == 1)
157 {
158 if (_dailyChestTimer1->getString() != "Open")
159 {
160 timer = _dailyChestTimer1;
161 // unlockLayer = RewardUnlockLayer::create(chestID); // temp
162 // unlockLayer->show(kNone);
163 }
164 else
165 {
166 unlockLayer = RewardUnlockLayer::create(chestID);
167 unlockLayer->show(kNone);
168 return;
169 }
170 }
171 else
172 {
173 if (_dailyChestTimer2->getString() != "Open")
174 {
175 timer = _dailyChestTimer2;
176 // unlockLayer = RewardUnlockLayer::create(chestID); // temp
177 // unlockLayer->show(kNone);
178 }
179 else
180 {
181 unlockLayer = RewardUnlockLayer::create(chestID);
182 unlockLayer->show(kNone);
183 return;
184 }
185 }
186
187 this->stopAllActions();
188 timer->setColor(ax::Color3B(255, 75, 0));
189 auto ax = TintTo::create(1.0,0xff,0xff,0xff);
190 timer->runAction(ax);
191}
192
193std::string formatSeconds(int seconds)
194{

Callers

nothing calls this directly

Calls 5

createFunction · 0.85
Color3BClass · 0.85
getStringMethod · 0.80
showMethod · 0.80
setColorMethod · 0.45

Tested by

no test coverage detected