本文整理汇总了C++中IUIElement::Reload方法的典型用法代码示例。如果您正苦于以下问题:C++ IUIElement::Reload方法的具体用法?C++ IUIElement::Reload怎么用?C++ IUIElement::Reload使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IUIElement
的用法示例。
在下文中一共展示了IUIElement::Reload方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReloadElement
//------------------------------------------------------------------------
int CScriptBind_UIAction::ReloadElement( IFunctionHandler *pH, const char * elementName, int instanceID )
{
IUIElement* pElement = GetElement( elementName, instanceID );
if ( pElement )
{
if ( instanceID < 0 )
{
IUIElementIteratorPtr elements = pElement->GetInstances();
while ( IUIElement* pInstance = elements->Next() )
pInstance->Reload();
}
else
{
pElement->Reload();
}
return pH->EndFunction( true );
}
UIACTION_WARNING( "LUA: UIElement %s does not exist", elementName );
return pH->EndFunction( false );
}
示例2: ShowInventory
void CHUDInventory::ShowInventory()
{
IUIElement* pElement = gEnv->pFlashUI->GetUIElement("Inventory");
if(pElement)
{
if(!Inv_loaded)
{
pElement->Reload();
pElement->GetFlashPlayer()->SetVisible(true);
pElement->SetVisible(true);
CActor *pActor = static_cast<CActor *>(gEnv->pGame->GetIGameFramework()->GetClientActor());
IInventory *pInventory = pActor->GetInventory();
g_pGame->Actions().FilterNoMouse()->Enable(true);
for (int i = 0; i < pInventory->GetCount(); i++)
{
EntityId ide = pInventory->GetItem(i);
EntityId slotID = pActor->GetInventory()->FindItem(ide);
CItem *curItem = static_cast<CItem*>(gEnv->pGame->GetIGameFramework()->GetIItemSystem()->GetItem(ide));
IItem *pItem = static_cast<IItem*>(gEnv->pGame->GetIGameFramework()->GetIItemSystem()->GetItem(ide));
CItem::SInventotyInfo info = curItem->GetInventoryInfo();
//int slotID;
EntityId itemID = pItem->GetEntityId();
itemsSaved = false;
for(int i = 0; i<inventoryItems.size(); i++)
{
if(inventoryItems[i].itemID == itemID)
{
//CryLog("Items finded in saved items");
slotID = inventoryItems[i].slotID;
itemsSaved = true;
break;
}
}
if(!itemsSaved)
slotID--;
SFlashVarValue args[8] = {slotID, info.iconName.c_str(), itemID, info.itemName.c_str(), info.itemDescription.c_str(), 0, info.canStack, info.canQuick};
if(info.itemClass)
{
pElement->GetFlashPlayer()->Invoke("addInventoryItem", args, 8);
if(!itemsSaved)
{
SInventoryItem inventoryItem;
inventoryItem.itemName = info.itemName.c_str();
inventoryItem.itemID = itemID;
inventoryItem.slotID = slotID++;
inventoryItem.itemAmmount = 0;
inventoryItem.canStack = info.canStack;
inventoryItems.push_back(inventoryItem);
}
}
}
pElement->GetFlashPlayer()->SetFSCommandHandler(this);
Inv_loaded = true;
}
else
{
g_pGame->Actions().FilterNoMouse()->Enable(false);
pElement->SetVisible(false);
pElement->GetFlashPlayer()->SetVisible(false);
pElement->GetFlashPlayer()->SetFSCommandHandler(NULL);
Inv_loaded = false;
}
}
else
CryLog("CHUDInventory::Error open inventory!");
}