| 147 | } |
| 148 | |
| 149 | void 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 | |
| 193 | std::string formatSeconds(int seconds) |
| 194 | { |