예제 #1
0
VOID CActionItem_Skill::Update_Skill(const SCLIENT_SKILL* pSkill)
{
	KLAssert(pSkill);

	//引用
	m_idSkillImpl =	pSkill->m_pDefine->m_nID;
	//名称
	m_strName = pSkill->m_pDefine->m_lpszName;
	//图标
	m_strIconName = pSkill->m_pDefine->m_lpszIconName;

	BOOL bOldEnable = IsEnabled();
	BOOL bNewEnable = FALSE;
	ORESULT oResult = pSkill->IsCanUse_CheckDeplete( CObjectManager::GetMe()->GetMySelf()->GetID());
	if ( OR_SUCCEEDED( oResult ) )
	{
		oResult = pSkill->IsCanUse_Leaned();
		if ( OR_SUCCEEDED( oResult ) )
		{
			bNewEnable = TRUE;
		}
	}

	if ( bNewEnable != bOldEnable )
	{
		(bNewEnable)?(Enable()):(Disable());

		//通知UI
		UpdateToRefrence();
	}
}
VOID CActionItem_Skill::Update_Skill(const SCLIENT_SKILL* pSkill)
{
	TDAssert(pSkill);

	//引用
	m_idSkillImpl =	pSkill->m_pDefine->m_nID*100 + pSkill->m_nLevel;
	//名称
	m_strName = pSkill->m_pDefine->m_lpszName;
	//图标
	m_strIconName = pSkill->m_pDefine->m_lpszIconName;

	BOOL bOldEnable = IsEnabled();
	BOOL bNewEnable = FALSE;
	ORESULT oResult = pSkill->IsCanUse_CheckDeplete( CObjectManager::GetMe()->GetMySelf()->GetID());
	if ( OR_SUCCEEDED( oResult ) )
	{
		oResult = pSkill->IsCanUse_Leaned();
		if ( OR_SUCCEEDED( oResult ) )
		{
			bNewEnable = TRUE;
		}
	}

	if ( bNewEnable != bOldEnable )
	{
		(bNewEnable)?(Enable()):(Disable());
		//通知UI
		UpdateToRefrence();
	}

	////引用
	//m_idSkillImpl =	pSkill->m_pDefine->m_nID;
	////名称
	//m_strName = pSkill->m_pDefine->m_lpszName;
	////图标
	//m_strIconName = pSkill->m_pDefine->m_lpszIconName;
	//
	//const SCLIENT_XINFA* pXinfa = CObjectManager::GetMe()->GetMySelf()->GetCharacterData()->Get_XinFa(pSkill->m_pDefine->m_nXinFaID);

	//if(pXinfa && pXinfa->m_nLevel < pSkill->m_pDefine->m_nXinFaLevelRequirement)
	//{
	//	Disable();
	//}
	////是否激活
	//else if( (0==pSkill->m_nActiveTime)  || (FALSE == pSkill->m_bLeaned) )
	//{
	//	Disable();
	//}
	//else
	//{
	//	Enable();
	//}
	////通知UI
	//UpdateToRefrence();
}