void BossLottery::btnHandler() { int cost = INSTANCE(SystemConfigRule)->getBossLotteryCost(); if(times > 1){ if(cost >= INSTANCE(UserData)->getCurrentMoney()){ INSTANCE(MessageBoxFacade)->showMessageBox("元宝不足,是否充值?", INSTANCE(RechargeFacade), callfunc_selector(RechargeFacade::open),"充值"); return; } INSTANCE(UserData)->costCurrentMoney(cost); INSTANCE(MoneyLayerManager)->createReduceMoney(cost); } CCNotificationCenter::sharedNotificationCenter()->postNotification(NoticeUpdateMoney); btn->setEnabled(false); closeBtn->setEnabled(false); int r = INSTANCE(SystemConfigRule)->getWheelMultiple(); result = getMultiple(r); INSTANCE(BossLotteryFacade)->setBossMultiple(result); CCRotateBy *rotate = CCRotateBy::create(4.0f, 3600 + r * 60 - 30); CCEaseInOut *easeInOut = CCEaseInOut::create((CCActionInterval *)rotate->copy()->autorelease(), 1.5f); CCSequence *action = CCSequence::create(easeInOut,CCCallFunc::create(this, callfunc_selector(BossLottery::rotateComplete)),NULL); circle->setRotation(0); circle->runAction(action); costLabel->setString(CCString::createWithFormat("消耗%d元宝",cost)->getCString()); INSTANCE(UserData)->addWheelTimes(1); times++; }
// Read a single OD value. Blocks. Returns the value. 0xffff == error inline uint32_t get(OdName name) { uint32_t value; if (getMultiple(&name, &value, 1)) return 0xffff; return value; }