Ejemplo n.º 1
0
void HSLanRoomListLayer::Load()
{
    CCSprite* pBackground = HSCCSprite::create("Image/BEIJING.png");
	pBackground->setPosition(HSBase::GetTemplateScreenCentre());
	this->addChild(pBackground);
	HSTool::SetNodeFilldScreen(pBackground);

	HSGlobal::ShaderGlobal()->AddCloud(this);
    
	HSReadUI::ShareReadUI()->ReadUI("Image/RoomListLan.data","Image/",this);
    

    HS_SET_MENU_TARGET("UI_Fanhuianniu", this, HSLanRoomListLayer::Call_Back);
    HS_SET_MENU_TARGET("UI_Chuangjianfangjian", this, HSLanRoomListLayer::Call_CreateRoom);
    HS_SET_MENU_TARGET("UI_Shuaxin", this, HSLanRoomListLayer::Call_Refresh);
    pRefreshMenu = HS_FIND_UI_MENU("UI_Shuaxin");
    pRefreshMenu->setVisible(false);
    
    
    CCSprite* pRadarItem = HS_FIND_UI_PANEL_SPRITE("UI_Leida", "Leidasaomiao");
    CCRotateBy* pRotate = CCRotateBy::create(3.f, -360.f);
    pRadarItem->runAction(CCRepeatForever::create(pRotate));
    Call_PlayRefreshEffect();
    
    //@ 头像 名称
    CCSprite* pHeadFrame = HS_FIND_UI_PANEL_SPRITE("UI_Wanjiaxinxi", "Touxiangdikuang");
    CCSprite* pNameFrame = HS_FIND_UI_PANEL_SPRITE("UI_Wanjiaxinxi", "Wanjiamingzikuang");
    CCSprite* pHead = HSCCSprite::create("Image/6000.png");
    pHead->setPosition(pHeadFrame->getAnchorPointInPoints());
    pHeadFrame->addChild(pHead);
    CCLabelTTF* pName = CCLabelTTF::create(HS_GAME_CACHE_DATA_LAN().name().c_str(),HS_FONT_HuaKang, 25.f,pNameFrame->getContentSize(),kCCTextAlignmentCenter,kCCVerticalTextAlignmentCenter);
    pName->setPosition(pNameFrame->getAnchorPointInPoints());
    pNameFrame->addChild(pName);
    
    UserBasicInfo* pTarget = HS_MUTABLE_TARGET_TARGET();
    pTarget->Clear();
    
    this->schedule(schedule_selector(HSLanRoomListLayer::ListerTargetJoinRoom), 0);
    this->schedule(schedule_selector(HSLanRoomListLayer::ListerCreateRoomSuccessful));
    this->schedule(schedule_selector(HSLanRoomListLayer::Updata));
    this->scheduleOnce(schedule_selector(HSLanRoomListLayer::ListerOnce), 0);
    this->schedule(schedule_selector(HSLanRoomListLayer::ListerTargetUserInfo), 0);
    
    this->Call_Refresh();
}
void HSDailyRewardSystemLayer::Load()
{
	CCLayerColor* pLayerColor = CCLayerColor::create(ccc4(0,0,0,200),HSBase::GetTemplateScreenW(),HSBase::GetTemplateScreenH());
	HSTool::SetNodeFilldScreen(pLayerColor);
	this->addChild(pLayerColor);

	HSReadUI::ShareReadUI()->ReadUI("Image/DailyRewardSystem/DailyRewardSystem.data","Image/DailyRewardSystem/",this);

	HS_SET_MENU_TARGET("UI_LingQuJiangLi",this,HSDailyRewardSystemLayer::Call_Claimed);

	int dayCount = HS_GAME_CACHE()->m_DailyRewardSystemData.dailyrewardlist_size();
	for (int i=0;i<dayCount;++i)
	{
		DailyRewardSystemData_DailyReward dailyReward = HS_GAME_CACHE()->m_DailyRewardSystemData.dailyrewardlist(i);
		CCString* UI = CCString::createWithFormat("UI_DengLuJiangLi_day%d",i);
		for (int j=0;j<7;++j)
		{
			if (j != i)
			{
				CCString* day = CCString::createWithFormat("day%d",j);
				CCSprite* s = HS_FIND_UI_PANEL_SPRITE(UI->getCString(),day->getCString());
				s->setVisible(false);
			}
		}

		CCSprite* pGoldFrame = HS_FIND_UI_PANEL_SPRITE(UI->getCString(),"Shuzidiandikuang");
		CCLabelTTF* pGoldTTF = CCLabelTTF::create(CCString::createWithFormat("%d",dailyReward.gold())->getCString(),"Marker Felt",25.f);
		pGoldTTF->setPosition(pGoldFrame->getAnchorPointInPoints());
		pGoldFrame->addChild(pGoldTTF);

		switch (dailyReward.state())
		//switch (DailyRewardSystemData_DailyReward_ClaimedState_ClaimedState_AllowClaimed)
		{
		case DailyRewardSystemData_DailyReward_ClaimedState_ClaimedState_Unclaimed:
			{
				//CCSprite* s = HS_FIND_UI_PANEL_SPRITE(UI->getCString(),"riqibiaoji");
				//s->setVisible(false);
			}
			break;
		case DailyRewardSystemData_DailyReward_ClaimedState_ClaimedState_Claimed:
			{
				CCSprite* pBlue = HS_FIND_UI_PANEL_SPRITE(UI->getCString(),"riqidiban0");
				pBlue->setVisible(false);

				CCSprite* s = HS_FIND_UI_PANEL_SPRITE(UI->getCString(),"riqibiaoji");
				s->setVisible(false);
			}
			break;
		case DailyRewardSystemData_DailyReward_ClaimedState_ClaimedState_AllowClaimed:
			{
				m_AllowClaimedDayID = dailyReward.dayid();
			}
			break;
		}
	}
}