本文整理汇总了C++中SUIArguments::SetDelimiter方法的典型用法代码示例。如果您正苦于以下问题:C++ SUIArguments::SetDelimiter方法的具体用法?C++ SUIArguments::SetDelimiter怎么用?C++ SUIArguments::SetDelimiter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SUIArguments
的用法示例。
在下文中一共展示了SUIArguments::SetDelimiter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnGameplayCommand
void CDevMode::OnGameplayCommand(const char* cmd)
{
SUIArguments args;
args.SetDelimiter(":");
args.SetArguments(cmd);
string action;
args.GetArg(0, action);
if (action == "GotoTagPoint")
{
int tagpoint;
args.GetArg(1, tagpoint);
if (tagpoint >= 0 && tagpoint <= 11)
GotoTagPoint(tagpoint);
}
else if (action == "SetViewMode" && gEnv->pGame && gEnv->pGame->GetIGameFramework())
{
int mode;
args.GetArg(1, mode);
IActor* pPlayer = gEnv->pGame->GetIGameFramework()->GetClientActor();
static ICVar* pCamVar = gEnv->pConsole->GetCVar("cl_cam_orbit");
if (pPlayer && pCamVar)
{
switch (mode)
{
case 0:
pCamVar->Set(0);
if (pPlayer->IsThirdPerson())
pPlayer->ToggleThirdPerson();
break;
case 1:
pCamVar->Set(0);
if (!pPlayer->IsThirdPerson())
pPlayer->ToggleThirdPerson();
break;
case 2:
pCamVar->Set(1);
break;
}
}
}
else if (action == "SetFlyMode" && gEnv->pGame && gEnv->pGame->GetIGameFramework())
{
int mode;
args.GetArg(1, mode);
IActor* pPlayer = gEnv->pGame->GetIGameFramework()->GetClientActor();
if (pPlayer && mode >= 0 && mode < 3)
pPlayer->SetFlyMode(mode);
}
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:50,代码来源:DevMode.cpp
示例2: HandleFSCommand
void CHUDInventory::HandleFSCommand(const char *strCommand,const char *strArgs, void* pUserData)
{
if(!strcmp(strCommand,"itemPressed"))
{
EntityId id = static_cast<EntityId>(atoi(strArgs));
if(id>=1)
{
CActor *pActor=static_cast<CActor *>(gEnv->pGame->GetIGameFramework()->GetClientActor());
if(IItem *pItem = gEnv->pGame->GetIGameFramework()->GetIItemSystem()->GetItem(id))
{
if (pItem->CanSelect())
{
CItem *pItemii = static_cast<CItem*>(gEnv->pGame->GetIGameFramework()->GetIItemSystem()->GetItem(id));
if(!pItemii->IsSelected())
{
pActor->SelectItem(id,true,true);
}
}
}
}
}
if(!strcmp(strCommand,"slotChanged"))
{
SUIArguments args;
args.SetDelimiter(",");
args.SetArguments(strArgs);
int oldSlotID;
int slotID;
int itemID;
args.GetArg(0, oldSlotID);
args.GetArg(1, slotID);
args.GetArg(2, itemID);
for(int i = 0; i<inventoryItems.size(); i++)
{
if(inventoryItems[i].itemID == itemID)
{
//CryLog("ID find in items, changing slotID....");
inventoryItems[i].slotID = slotID;
}
}
}
if(!strcmp(strCommand,"dropItem"))
{
EntityId itemID = static_cast<EntityId>(atoi(strArgs));
CItem *curItem = static_cast<CItem*>(gEnv->pGame->GetIGameFramework()->GetIItemSystem()->GetItem(itemID));
curItem->Drop(1.f,false,false);
//CryLog("Drop item = %d", itemID);
for(int i = 0; i<inventoryItems.size(); i++)
{
if(inventoryItems[i].itemID == itemID)
{
SFlashVarValue args[1] = {inventoryItems[i].slotID};
IUIElement* pElement = gEnv->pFlashUI->GetUIElement("Inventory");
pElement->GetFlashPlayer()->Invoke("removeInventoryItem", args, 1);
}
}
}
}