void LoginScene::menuCallBack(Ref *pSender, Widget::TouchEventType eventType){ if(eventType == Widget::TouchEventType::ENDED){ MButton *button = (MButton*) pSender; int tag = button->getTag(); switch (tag) { case BTN_FACEBOOK: CCLOG("%s","Login with facebook!"); break; case BTN_LOGIN: CCLOG("%s","Login with esxit!"); break; case BTN_REGISTER: { auto registerscene = RegisterScene::createScene(); Director::getInstance()->replaceScene(TransitionMoveInR::create(0.25f, registerscene)); } break; case BTN_PLAYNOW: { auto select = ShowGame::createScene(); Director::getInstance()->replaceScene(TransitionCrossFade::create(0.15f, select)); } break; case BTN_FOGOTPASSWORD: CCLOG("%s","Forgot_Password!"); break; default: break; } } }
void ShowGame::menuCallBack(cocos2d::Ref *sender, Widget::TouchEventType type){ if(type == Widget::TouchEventType::ENDED) { MButton *button = (MButton*) sender; int tag = button->getTag(); switch (tag) { case TAG_BTN_BACK: CCLOG("%s","btn_back"); { auto registerscene = LoginScene::createScene(); Director::getInstance()->replaceScene(TransitionCrossFade::create(0.25f, registerscene)); } break; case TAG_BTN_CAIDAT: CCLOG("%s","btn_catdat"); { m_popupSetting->appear(); } break; case TAG_BTN_MENU: CCLOG("%s","btn_menu"); break; case TAG_BTN_NAPXU: CCLOG("%s","btn_napxu"); break; case TAG_BTN_TROGIUP: CCLOG("%s","btn_trogiup"); break; default: break; } } }
void TLMienNam::menuCallBack(Ref *pSender, ui::Widget::TouchEventType eventType){ MButton *btn = (MButton*) pSender; if(eventType == ui::Widget::TouchEventType::ENDED){ int tag = btn->getTag(); switch (tag) { case BTN_MENU: CCLOG("%s","menu"); { auto select = TableSelect::createScene(); Director::getInstance()->replaceScene(TransitionCrossFade::create(0.15f, select)); } break; case BTN_MESSAGE: CCLOG("%s","message"); break; case BTN_PURCHASE: CCLOG("%s","purchase"); break; case BTN_SOUND: CCLOG("%s","sound"); break; default: break; } } }
void TableSelect::menuCallBack(cocos2d::Ref *sender, Widget::TouchEventType type){ if(type == Widget::TouchEventType::ENDED){ MButton *button = (MButton*) sender; int tag = button->getTag(); switch (tag) { case BTN_BACK: CCLOG("%s","Button Back"); { auto select = ShowGame::createScene(); Director::getInstance()->replaceScene(TransitionCrossFade::create(0.15f, select)); } break; case BTN_CREATE: CCLOG("%s","Button create"); break; case BTN_GOTO: CCLOG("%s","Button GoTo"); break; case BTN_PLAYNOW: CCLOG("%s","Button Play Now"); { auto select = TLMienNam::createScene(); Director::getInstance()->replaceScene(TransitionCrossFade::create(0.15f, select)); } break; case BTN_REFRESH: CCLOG("%s","Button Refresh"); break; default: break; } } }
void TLMienNam::playCallBack(Ref *pSender, ui::Widget::TouchEventType eventType){ MButton *btn = (MButton*) pSender; if(eventType == ui::Widget::TouchEventType::ENDED){ int tag = btn->getTag(); switch (tag) { case BTN_XEPBAI: CCLOG("%s","xep bai"); break; case BTN_CHONLAI: CCLOG("%s","chon lai"); break; default: break; } } }
void TableSelect::phongCallBack(cocos2d::Ref *sender, Widget::TouchEventType type){ if(type == Widget::TouchEventType::ENDED){ Size visibleSize = Director::getInstance()->getVisibleSize(); Vec2 origin = Director::getInstance()->getVisibleOrigin(); MButton *button = (MButton*) sender; int tag = button->getTag(); switch (tag) { case BTN_PHONGVIP: CCLOG("%s","Phong Vip"); btn_phong->runAction(MoveTo::create(0.1f, Vec2(origin.x+visibleSize.width*0.2f,origin.y))); break; case BTN_PHONGFREE: CCLOG("%s","Phong Free"); btn_phong->runAction(MoveTo::create(0.1f, Vec2(origin.x+visibleSize.width*0.6f,origin.y))); break; default: break; } } }
void LoginScene::menuCallBack(Ref *pSender, Widget::TouchEventType eventType){ if(eventType == Widget::TouchEventType::ENDED){ MButton *button = (MButton*) pSender; int tag = button->getTag(); switch (tag) { case TAG_BTN_FACEBOOK: CCLOG("%s","Login with facebook!"); #ifdef SDKBOX_ENABLED sdkbox::PluginFacebook::login(); #endif break; case TAG_BTN_LOGIN: CCLOG("%s","Login with esxit!"); NetworkManager::getInstance()->getLoginMessageFromServer(user_id_str, password_str); break; case TAG_BTN_REGISTER: { auto registerscene = RegisterScene::createScene(); Director::getInstance()->replaceScene(TransitionMoveInR::create(0.25f, registerscene)); } break; case TAG_BTN_PLAYNOW: { NetworkManager::getInstance()->getQuickPlayMessageFromServer("00000000", "Samsung galaxy S2"); // auto select = ShowGame::createScene(); // Director::getInstance()->replaceScene(TransitionCrossFade::create(0.15f, select)); } break; case TAG_BTN_FOGOTPASSWORD: CCLOG("%s","Forgot_Password!"); break; default: break; } } }
void ShowGame::gameItemCallBack(cocos2d::Ref *sender, Widget::TouchEventType type){ if(type == Widget::TouchEventType::ENDED){ MButton *button = (MButton*) sender; int tag = button->getTag(); switch (tag) { case TAG_GAME_XOCDIA: CCLOG("%s","game : xocdia"); break; case TAG_GAME_XITO: CCLOG("%s","game : xito"); break; case TAG_GAME_TLMN: CCLOG("%s","game : tlmn"); { auto registerscene = TLMienNam::createScene(); Director::getInstance()->replaceScene(TransitionCrossFade::create(0.25f, registerscene)); } break; case TAG_GAME_TLMB: CCLOG("%s","game : tlmb"); break; case TAG_GAME_POCKER: CCLOG("%s","game : pocker"); break; case TAG_GAME_PHOM: CCLOG("%s","game : phom"); break; case TAG_GAME_BACAY: CCLOG("%s","game : bacay"); break; default: break; } } }