void asw_make_jeep_f() { C_ASW_Player *pPlayer = C_ASW_Player::GetLocalASWPlayer(); if (pPlayer) { C_ASW_PropJeep_Clientside* pJeep = C_ASW_PropJeep_Clientside::CreateNew(false); pJeep->SetAbsOrigin(pPlayer->GetAbsOrigin()); pJeep->Initialize(); g_pJeep = pJeep; // need to set player? } }
void asw_camera_report_defaults_f() { QAngle default_ang(cam_idealpitch.GetFloat(),cam_idealyaw.GetFloat(),0); Vector default_dir; AngleVectors(default_ang, &default_dir); Msg("Default dir: %f, %f, %f\n", default_dir.x, default_dir.y, default_dir.z); default_dir *= -cam_idealdist.GetFloat(); Msg("Default offset: %f, %f, %f\n", default_dir.x, default_dir.y, default_dir.z); C_ASW_Player *pPlayer = C_ASW_Player::GetLocalASWPlayer(); if (pPlayer) { Msg("RTS cam is at: %f, %f, %f\n", VectorExpand( pPlayer->GetAbsOrigin() ) ); } }
void CC_ASWEditEmitterFrame(void) { using namespace vgui; // find the asw player C_ASW_Player *pPlayer = C_ASW_Player::GetLocalASWPlayer(); if (!pPlayer) return; // fine the nearest emitter float distance = 0; float best_distance = 0; C_ASW_Emitter* pEmitter = NULL; C_ASW_Emitter* pTemp = NULL; unsigned int c = ClientEntityList().GetHighestEntityIndex(); for ( unsigned int i = 0; i <= c; i++ ) { C_BaseEntity *e = ClientEntityList().GetBaseEntity( i ); if ( !e ) continue; pTemp = dynamic_cast<C_ASW_Emitter*>(e); if (pTemp) { distance = pTemp->GetAbsOrigin().DistTo(pPlayer->GetAbsOrigin()); if (best_distance == 0 || distance < best_distance) { best_distance = distance; pEmitter = pTemp; } } } if (pEmitter == NULL) { Msg("Couldn't find any asw_emitter to edit\n"); return; } // create the basic frame which holds our briefing panels CASW_VGUI_Edit_Emitter* pEditEmitterFrame = new CASW_VGUI_Edit_Emitter( GetClientMode()->GetViewport(), "EditEmitterFrame" ); HScheme scheme = vgui::scheme()->LoadSchemeFromFile("resource/SwarmSchemeNew.res", "SwarmSchemeNew"); pEditEmitterFrame->SetScheme(scheme); pEditEmitterFrame->Activate();// set visible, move to front, request focus pEditEmitterFrame->SetEmitter((C_ASW_Emitter*) pEmitter); pEditEmitterFrame->InitFrom((C_ASW_Emitter*) pEmitter); }