本文整理汇总了C++中SUIArguments::GetArg方法的典型用法代码示例。如果您正苦于以下问题:C++ SUIArguments::GetArg方法的具体用法?C++ SUIArguments::GetArg怎么用?C++ SUIArguments::GetArg使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SUIArguments
的用法示例。
在下文中一共展示了SUIArguments::GetArg方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: GetArray
//------------------------------------------------------------------------
int CScriptBind_UIAction::GetArray( IFunctionHandler *pH, const char * elementName, int instanceID, const char* arrayName )
{
IUIElement* pElement = GetElement( elementName, instanceID );
if ( pElement )
{
const SUIParameterDesc* pArrayDesc = pElement->GetArrayDesc( arrayName );
SUIArguments vals;
if ( pArrayDesc && pElement->GetArray( pArrayDesc, vals ) )
{
SmartScriptTable res(m_pSS);
string val;
for (int i = 0; i < vals.GetArgCount(); ++i)
{
vals.GetArg(i).GetValueWithConversion(val);
res->SetAt( i+1, val.c_str() );
}
return pH->EndFunction( res );
}
UIACTION_WARNING( "LUA: Element %s has no array %s", elementName, arrayName );
}
else
{
UIACTION_WARNING( "LUA: UIElement %s does not exist", elementName );
}
return pH->EndFunction( false );
}
示例3: TryArgToLuaTable
bool TryArgToLuaTable(const SUIArguments &args, SmartScriptTable table, int idx)
{
T val;
if (args.GetArg(idx, val))
{
SetTableVal<T>(val, table, idx);
return true;
}
return false;
}
示例4: OnUIEvent
// IUIElementEventListener
virtual void OnUIEvent( IUIElement* pSender, const SUIEventDesc& event, const SUIArguments& args )
{
assert(pSender == m_pElement);
if ( strcmp(event.sDisplayName, "OnPlay") == 0)
{
ActivateOutput(&m_ActInfo, eO_OnPlay, true);
}
else if ( strcmp(event.sDisplayName, "OnPause") == 0)
{
ActivateOutput(&m_ActInfo, eO_OnPause, true);
}
else if ( strcmp(event.sDisplayName, "OnResume") == 0)
{
ActivateOutput(&m_ActInfo, eO_OnResume, true);
}
else if ( strcmp(event.sDisplayName, "OnStop") == 0)
{
if (m_bPlaying)
{
m_bPlaying = false;
UnloadPlayerNextFrame();
bool bFinished;
args.GetArg(0, bFinished);
ActivateOutput(&m_ActInfo, eO_OnStop, bFinished);
}
}
else if ( strcmp(event.sDisplayName, "OnLooped") == 0)
{
ActivateOutput(&m_ActInfo, eO_OnLooped, true);
}
else if ( strcmp(event.sDisplayName, "OnFileNotFound") == 0)
{
m_bPlaying = false;
UnloadPlayerNextFrame();
ActivateOutput(&m_ActInfo, eO_OnStop, false);
ActivateOutput(&m_ActInfo, eO_OnVideoNotFound, true);
}
}
示例5: 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);
}
}
}
}