Page 1 of 1

Xml access

Posted: Sat Apr 21, 2018 5:44 pm
by thecleanuser
Is this the proper way of doing something with xml?

Code: Select all

//

CryLogAlways("Started");

const char* itemPackageFilePath = "Scripts/UI/PlayerHelper/ShowInformation.xml";
XmlNodeRef itemPackageFile = gEnv->pSystem->LoadXmlFromFile(itemPackageFilePath);

if (itemPackageFile)
{
int numEntries = itemPackageFile->getChildCount();

for (int i = 0; i = numEntries; i++)
{
string currentItem = GetEntity()->GetClass()->GetName();

string searchingItem = itemPackageFile->getChild(i)->getAttr("name");
if (currentItem == searchingItem)
{
i = numEntries; // stop "for"

CryLog(searchingItem);
};
}
}
//

Re: Xml access

Posted: Sun Apr 22, 2018 4:56 am
by fury22uk
Yes