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()); } } } }
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()); } }
void contactMerge::sDeselectSource() { sDeselect(_srccntct->id()); }
void contactMerge::sDeselectCntct() { sDeselect(_cntct->id()); }