virtual bool IsWeaponSelectable() { if (IsInSelectionMode()) return true; return false; }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CBaseHudWeaponSelection::OnThink( void ) { // Don't allow weapon selection if we're frozen in place C_BasePlayer *pPlayer = C_BasePlayer::GetLocalPlayer(); if ( pPlayer->GetFlags() & FL_FROZEN || pPlayer->IsPlayerDead() ) { if ( IsInSelectionMode() ) { CancelWeaponSelection(); } } }
//----------------------------------------------------------------------------- // Purpose: handles keyboard input //----------------------------------------------------------------------------- int CBaseHudWeaponSelection::KeyInput( int down, ButtonCode_t keynum, const char *pszCurrentBinding ) { if (IsInSelectionMode() && pszCurrentBinding && !stricmp(pszCurrentBinding, "cancelselect")) { HideSelection(); // returning 0 indicates, we've handled it, no more action needs to be taken return 0; } // let someone else handle it return 1; }
//----------------------------------------------------------------------------- // Purpose: handles keyboard input //----------------------------------------------------------------------------- int CBaseHudWeaponSelection::KeyInput( int down, ButtonCode_t keynum, const char *pszCurrentBinding ) { if (IsInSelectionMode() && pszCurrentBinding && !stricmp(pszCurrentBinding, "cancelselect")) { HideSelection(); // returning 0 indicates, we've handled it, no more action needs to be taken return 0; } //Tony; check 0 as well, otherwise you have to have 0 bound to slot10 no matter what. if ( down >= 1 && keynum >= KEY_0 && keynum <= KEY_9 ) { //Tony; 0 is actually '10' (slot10) if (keynum == KEY_0) keynum = KEY_A; //Dealing with button codes, so just use KEY_A, which is equal to 11 anyway. if ( HandleHudMenuInput( keynum - 1 ) ) return 0; } // let someone else handle it return 1; }