示例#1
0
void CClientWeaponMgr::SelectCustomWeapon(HWEAPON hWeapon)
{
	if (hWeapon)
	{
		// find the common prefix of the custom weapon select and deselect enums
		HWEAPONDATA hWpnData = g_pWeaponDB->GetWeaponData(hWeapon, !USE_AI_DATA);
		std::string sSelect(  g_pWeaponDB->GetString( hWpnData, "CustomSelectStimulus" ));
		std::string sDeselect(  g_pWeaponDB->GetString( hWpnData, "CustomDeselectStimulus" ));
		std::pair<std::string::iterator,std::string::iterator> prCommonPrefix;
		prCommonPrefix = std::mismatch(sSelect.begin(), sSelect.end(), sDeselect.begin());
		std::string sStimulusGroup(sSelect.begin(),prCommonPrefix.first);

		// Play an appropriate animation...
		CPlayerBodyMgr& PlayerBodyMgr = CPlayerBodyMgr::Instance();

		PlayerBodyMgr.HandleAnimationStimulus(sSelect.c_str());
		if(PlayerBodyMgr.ActiveAnimationStimulus())
		{
			CClientWeapon* pWeapon = g_pPlayerMgr->GetClientWeaponMgr()->GetClientWeapon(hWeapon);
			if (pWeapon)
			{
				// Attach the weapon model
				g_pPlayerMgr->GetClientWeaponMgr()->ShowCustomWeapon(pWeapon, sStimulusGroup.c_str());
			}
		}
	}		
}
示例#2
0
void contactMerge::sCntctDoubleClicked()
{
  if ((_cntct->altId() == 0) || (_cntct->altId() == 4)) // cNone or cError
  {
    sSelect(false);
  }
  else if ((_cntct->altId() == 1) || (_cntct->altId() == 2)) // cTarget or cSource
  {
    sDeselect(_cntct->id());
  }
}
示例#3
0
void contactMerge::sDeselectSource()
{
  sDeselect(_srccntct->id());
}
示例#4
0
void contactMerge::sDeselectCntct()
{
  sDeselect(_cntct->id());
}