本文整理汇总了C++中IVehicleSeat::GetSeatName方法的典型用法代码示例。如果您正苦于以下问题:C++ IVehicleSeat::GetSeatName方法的具体用法?C++ IVehicleSeat::GetSeatName怎么用?C++ IVehicleSeat::GetSeatName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVehicleSeat
的用法示例。
在下文中一共展示了IVehicleSeat::GetSeatName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessEvent
virtual void ProcessEvent( EFlowEvent event,SActivationInfo *pActInfo )
{
IVehicleSystem * pVehicleSystem = NULL;
IVehicle * pVehicle = NULL;
switch(event)
{
case eFE_Initialize:
{
pActInfo->pGraph->SetRegularlyUpdated(pActInfo->myID, false);
break;
}
case eFE_Activate:
{
if (!pActInfo->pEntity)
return;
pVehicleSystem = gEnv->pGame->GetIGameFramework()->GetIVehicleSystem();
pVehicle = pVehicleSystem->GetVehicle(pActInfo->pEntity->GetId());
if (!pVehicleSystem || !pVehicle)
return;
string givenString = GetPortString(pActInfo, IN_PARTS);
currentParam = givenString.substr(0,givenString.find_first_of(":"));
currentSetting = givenString.substr(givenString.find_first_of(":")+1,(givenString.length()-givenString.find_first_of(":")));
column1 = 10.f;
column2 = 100.f;
if (IsPortActive(pActInfo,IN_SHOW))
pActInfo->pGraph->SetRegularlyUpdated(pActInfo->myID, true);
break;
}
case eFE_Update:
{
IRenderer * pRenderer = gEnv->pRenderer;
pVehicleSystem = gEnv->pGame->GetIGameFramework()->GetIVehicleSystem();
pVehicle = pVehicleSystem->GetVehicle(pActInfo->pEntity->GetId());
if(!pVehicleSystem || !pActInfo->pEntity || !pVehicle)
return;
pRenderer->Draw2dLabel(column1,10,GetPortFloat(pActInfo,IN_SIZE)+2.f,Col_Cyan,false,pActInfo->pEntity->GetName());
if(currentParam=="Seats")
{
loops = 0;
for(uint32 i=0;i<pVehicle->GetSeatCount();i++)
{
IVehicleSeat * currentSeat;
if(currentSetting=="All")
{
currentSeat = pVehicle->GetSeatById(i+1);
}
else
{
currentSeat = pVehicle->GetSeatById(pVehicle->GetSeatId(currentSetting));
i = pVehicle->GetSeatCount()-1;
}
loops += 1;
// column 1
string pMessage = ("%s:", currentSeat->GetSeatName());
if (column2<pMessage.size()*8*GetPortFloat(pActInfo, IN_SIZE))
column2=pMessage.size()*8*GetPortFloat(pActInfo, IN_SIZE);
pRenderer->Draw2dLabel(column1,(15*(float(loops+1))*GetPortFloat(pActInfo,IN_SIZE)),GetPortFloat(pActInfo,IN_SIZE),Col_Cyan,false,pMessage);
// column 2
if(currentSeat->GetPassenger(true))
{
pMessage = ("- %s", gEnv->pEntitySystem->GetEntity(currentSeat->GetPassenger(true))->GetName());
pRenderer->Draw2dLabel(column2,(15*(float(loops+1))*GetPortFloat(pActInfo,IN_SIZE)),GetPortFloat(pActInfo,IN_SIZE),Col_Cyan,false,pMessage);
}
}
}
else if(currentParam=="Wheels")
{
pRenderer->Draw2dLabel(column1,50.f,GetPortFloat(pActInfo,IN_SIZE)+1.f,Col_Red,false,"!");
}
else if(currentParam=="Weapons")
{
loops = 0;
for(int i=0;i<pVehicle->GetWeaponCount();i++)
{
IItemSystem * pItemSystem = gEnv->pGame->GetIGameFramework()->GetIItemSystem();
IWeapon * currentWeapon;
EntityId currentEntityId;
//.........这里部分代码省略.........