Exemplo n.º 1
0
void CStrengthenItem::onClose(CCObject* pSender)
{
	PlayEffectSound(SFX_Ensure);

	LayerManager::instance()->pop();
	LayerManager::instance()->pop();
}
Exemplo n.º 2
0
void CCommandLayer::onClose(CCObject* pSender)
{
	PlayEffectSound(SFX_Ensure);

	LayerManager::instance()->pop();
	LayerManager::instance()->pop();
}
Exemplo n.º 3
0
void CChangeHeadImg::onChangHeadImg(CCObject* pSender)
{
	PlayEffectSound(SFX_Button);

	CImageView *head = (CImageView *)pSender;
	int *icon = (int*)head->getUserData();
	CPlayerControl::getInstance().sendChangeHeadImg(*icon);
	LayerManager::instance()->pop();
	LayerManager::instance()->pop();
}
Exemplo n.º 4
0
void CHandBookPanel::onSwitchBtn( CCObject *pSender, bool bChecked )
{
	CRadioButton* pBtn = (CRadioButton*)pSender;
	int iSelectIndex = pBtn->getTag();

	if (bChecked)
	{
		PlayEffectSound(SFX_Button);

		selectTabPanel((HandBookTabType)iSelectIndex);
	}
}
Exemplo n.º 5
0
void CStrengthenItem::onTouchItem(CCObject* pSender)
{
	if(isVisible())
	{
		PlayEffectSound(SFX_Button);
	}

	CImageView * img = (CImageView*)pSender;
	m_item = (CItem*)img->getUserData();

	m_pItemTip->showItemProperty(m_item);

	CLayout *attribute = (CLayout*)(m_ui->findWidgetById("attr"));
	attribute->setVisible(true);

	m_selectCellImg->removeFromParent();
	img->addChild(m_selectCellImg);
	m_selectCellImg->setVisible(true);
	m_selectCellImg->setPosition(ccp(img->getContentSize().width/2,0/*img->getContentSize().height/2*/));

	CButton *select = (CButton*)(m_ui->findWidgetById("select")); //sel_font
	CLabel *selfont = (CLabel*)(m_ui->findWidgetById("sel_font"));
	if (m_toHero==m_item->armor.hero&&m_toHero>0)
	{
		select->setVisible(true);
		selfont->setVisible(false);
	}
	else if (m_toHero>0&&!m_item->canUse)
	{
		select->setVisible(false);
		selfont->setVisible(false);
	}
	else
	{
		select->setVisible(true);
		selfont->setVisible(true);
	}

	if (m_type==2)
	{
		if (m_toHero>0)
		{
			CImageView *uninstall = (CImageView*)(m_ui->findWidgetById("uninstall"));
			CImageView *change = (CImageView*)(m_ui->findWidgetById("change"));
			CImageView *selfont = (CImageView*)(m_ui->findWidgetById("sel_font"));
			uninstall->setVisible(m_toHero==m_item->armor.hero);
			change->setVisible(m_toHero!=m_item->armor.hero&&m_item->armor.hero>0&&m_item->canUse);
			selfont->setVisible(m_item->armor.hero==0&&m_item->canUse);
		}
	}
}
Exemplo n.º 6
0
void ActionBar::onSliderChanged(Ref* sender, extension::Control::EventType controlEvent)
{
	if (m_pMenuItemSlideRaise->isVisible())
	{
		double dRaiseValue = m_pSliderRaise->getValue();
		double dRaise = m_dMinRaise + (int)((m_dMaxRaise - m_dMinRaise) * (dRaiseValue - m_sliderStartValue) / (m_sliderEndValue - m_sliderStartValue));
        if (!doubleIsInt(dRaise / m_dBigBlind))
        {
            if (dRaise <= m_dMinRaise)
            {
                dRaise = m_dMinRaise;
            }
            else if (getUpInt(dRaise, m_dBigBlind) >= m_dMaxRaise)
            {
                dRaise = m_dMaxRaise;
            }
            else
            {
                dRaise = getUpInt(dRaise, m_dBigBlind);
            }
        }
        



		bool bAllIn = (dRaise >= m_dCash);
		if (bAllIn)
		{
			if (!m_pSpriteAllIn->isVisible())
			{
				m_pSpriteAllIn->setVisible(true);
				m_pSpriteAllIn->playByIndexAndRepatForever(0);
				//m_pSpriteAllIn->runAction(RepeatForever::create(CreateAnimate("actionbar/aniallin.png", 1, 2, 2, 0.3, false)));
				m_pMenuItemSlideRaiseAllIn->setVisible(true);
				if (m_pSliderRaise->isVisible()) {
					#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID
						PlayEffectSound("sound/table/allin.ogg");
					#elif CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32
						PlayEffectSound("sound/table/allin.mp3");
					#endif
				}
			}
		}
		else
		{
			m_pSpriteAllIn->stopAllActions();
			m_pSpriteAllIn->setVisible(false);
			m_pMenuItemSlideRaiseAllIn->setVisible(false);
		}

        double dCurrentTime = getCurrentTime();
        if (dCurrentTime - m_dCurrentTime > 20)
        {
#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID
            PlayEffectSound("sound/table/addchip.ogg");
#elif CC_TARGET_PLATFORM == CC_PLATFORM_IOS
			PlayEffectSound("sound/table/addchip.mp3");
#endif
        }
        m_dCurrentTime = dCurrentTime;

        m_dCurRaise = dRaise;
		//SetLabelString(m_pMenuItemSlideRaise->GetLabel(), FormatCash(dRaise));
		setUITextString(m_pMenuItemSlideRaiseText,FormatCash(dRaise));
	}
}