本文整理汇总了C++中IActionMapManager::Reset方法的典型用法代码示例。如果您正苦于以下问题:C++ IActionMapManager::Reset方法的具体用法?C++ IActionMapManager::Reset怎么用?C++ IActionMapManager::Reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IActionMapManager
的用法示例。
在下文中一共展示了IActionMapManager::Reset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Reset
//------------------------------------------------------------------------
bool CPlayerProfile::Reset()
{
if (IsDefault())
return false;
// for now, try to get the action map from the IActionMapManager
IActionMapManager* pAM = CCryAction::GetCryAction()->GetIActionMapManager();
pAM->Reset();
// well, not very efficient at the moment...
TAttributeMap::iterator iter = m_attributeMap.begin();
while (iter != m_attributeMap.end())
{
TAttributeMap::iterator next = iter;
++next;
ResetAttribute(iter->first);
iter = next;
}
LoadGamerProfileDefaults();
gEnv->pSystem->AutoDetectSpec(false);
return true;
}
示例2: SerializeXML
//------------------------------------------------------------------------
bool CPlayerProfile::SerializeXML(CPlayerProfileManager::IProfileXMLSerializer* pSerializer)
{
if (pSerializer->IsLoading())
{
// serialize attributes
XmlNodeRef attributesNode = pSerializer->GetSection(CPlayerProfileManager::ePPS_Attribute);
if (attributesNode)
{
CPlayerProfile* pDefaultProfile = static_cast<CPlayerProfile*> (m_pManager->GetDefaultProfile());
int requiredVersion = 0;
if (IsDefault() == false && pDefaultProfile)
requiredVersion = pDefaultProfile->m_attributesVersion;
bool ok = LoadAttributes(attributesNode, requiredVersion);
}
else
{
GameWarning("CPlayerProfile::SerializeXML: No attributes tag '%s' found", ATTRIBUTES_TAG);
return false;
}
// preview profiles never load actionmaps!
if (m_bIsPreview == false)
{
// serialize action maps
XmlNodeRef actionMaps = pSerializer->GetSection(CPlayerProfileManager::ePPS_Actionmap);
if (actionMaps)
{
// the default profile loaded has no associated actionmaps, but
// rather assumes that all actionmaps which are currently loaded belong to the default
// profile
// if it's not the default profile to be loaded, then we load the ActionMap
// but we do a version check. if the profile's actionmaps are outdated, it's not loaded
// but the default action map is used instead
// on saving the profile it's automatically updated (e.g. the current actionmaps [correct version]
// are saved
IActionMapManager* pAM = CCryAction::GetCryAction()->GetIActionMapManager();
if (IsDefault() == false && pAM)
{
pAM->Reset();
pAM->LoadRebindDataFromXML(actionMaps); // check version and don't load if outdated
}
}
else
{
GameWarning("CPlayerProfile::SerializeXML: No actionmaps tag '%s' found", ACTIONMAPS_TAG);
return false;
}
}
}
else
{
if (m_bIsPreview == false)
{
// serialize attributes
XmlNodeRef attributesNode = pSerializer->CreateNewSection(CPlayerProfileManager::ePPS_Attribute, CPlayerProfile::ATTRIBUTES_TAG);
bool ok = SaveAttributes(attributesNode);
if (!ok)
return false;
// serialize action maps
IActionMapManager* pAM = CCryAction::GetCryAction()->GetIActionMapManager();
XmlNodeRef actionMapsNode = pSerializer->CreateNewSection(CPlayerProfileManager::ePPS_Actionmap, CPlayerProfile::ACTIONMAPS_TAG);
pAM->SaveRebindDataToXML(actionMapsNode);
return ok;
}
}
return true;
}