void CAI_StandoffBehavior::UnlockHintNode() { CAI_Hint *pHintNode = GetOuter()->m_pHintNode; if ( pHintNode ) { if ( pHintNode->IsLocked() && pHintNode->IsLockedBy( GetOuter() ) ) pHintNode->Unlock(); CAI_Node *pNode = pHintNode->GetNode(); if ( pNode && pNode->IsLocked() ) pNode->Unlock(); GetOuter()->m_pHintNode = NULL; } }
//------------------------------------------------------------------------------ // Purpose : // Input : // Output : //------------------------------------------------------------------------------ void CAI_HintManager::DrawHintOverlays(float flDrawDuration) { int c = gm_AllHints.Count(); for ( int i = 0; i < c; ++i ) { CAI_Hint *pHint = gm_AllHints[ i ]; int r = 0; int g = 0; int b = 255; Vector vHintPos; if (pHint->m_NodeData.nNodeID != NO_NODE) { vHintPos = g_pBigAINet->GetNode(pHint->m_NodeData.nNodeID)->GetPosition(g_pAINetworkManager->GetEditOps()->m_iHullDrawNum); } else { vHintPos = pHint->GetAbsOrigin(); } if ( pHint->GetNodeId() != NO_NODE ) NDebugOverlay::Text( vHintPos + Vector(0,6,8), CFmtStr("(%d), (%d)", pHint->HintType(), pHint->GetNodeId()), true, flDrawDuration ); else NDebugOverlay::Text( vHintPos + Vector(0,6,8), CFmtStr("(%d)", pHint->HintType()), true, flDrawDuration ); // If node is currently locked if (pHint->m_NodeData.iDisabled) { r = 100; g = 100; b = 100; } else if (pHint->m_hHintOwner != NULL) { r = 255; g = 0; b = 0; CBaseEntity* pOwner = pHint->User(); if (pOwner) { char owner[255]; Q_strncpy(owner,pOwner->GetDebugName(),sizeof(owner)); Vector loc = vHintPos; loc.x+=6; loc.y+=6; loc.z+=6; NDebugOverlay::Text( loc, owner, true, flDrawDuration ); NDebugOverlay::Line( vHintPos, pOwner->WorldSpaceCenter(), 128, 128, 128, false, 0); } } else if (pHint->IsLocked()) { r = 200; g = 150; b = 10; } NDebugOverlay::Box(vHintPos, Vector(-3,-3,-3), Vector(3,3,3), r,g,b,0,flDrawDuration); // Draw line in facing direction Vector offsetDir = 12.0 * Vector(cos(DEG2RAD(pHint->Yaw())),sin(DEG2RAD(pHint->Yaw())),0); NDebugOverlay::Line(vHintPos, vHintPos+offsetDir, r,g,b,false,flDrawDuration); } }