Changeset View
Changeset View
Standalone View
Standalone View
source/gui/COList.cpp
Show First 20 Lines • Show All 226 Lines • ▼ Show 20 Lines | else if (child.GetNodeName() == elmt_column) | ||||
for (XMBAttribute attr : child.GetAttributes()) | for (XMBAttribute attr : child.GetAttributes()) | ||||
{ | { | ||||
CStr attr_name(pFile->GetAttributeString(attr.Name)); | CStr attr_name(pFile->GetAttributeString(attr.Name)); | ||||
CStr attr_value(attr.Value); | CStr attr_value(attr.Value); | ||||
if (attr_name == "color") | if (attr_name == "color") | ||||
{ | { | ||||
CColor color; | CColor color; | ||||
if (!GUI<CColor>::ParseString(attr_value.FromUTF8(), color)) | if (!GUI<CColor>::ParseString(GetGUI(), attr_value.FromUTF8(), color)) | ||||
LOGERROR("GUI: Error parsing '%s' (\"%s\")", attr_name.c_str(), attr_value.c_str()); | LOGERROR("GUI: Error parsing '%s' (\"%s\")", attr_name.c_str(), attr_value.c_str()); | ||||
else | else | ||||
column.m_TextColor = color; | column.m_TextColor = color; | ||||
} | } | ||||
else if (attr_name == "id") | else if (attr_name == "id") | ||||
{ | { | ||||
column.m_Id = attr_value; | column.m_Id = attr_value; | ||||
} | } | ||||
else if (attr_name == "hidden") | else if (attr_name == "hidden") | ||||
{ | { | ||||
if (!GUI<bool>::ParseString(attr_value.FromUTF8(), hidden)) | if (!GUI<bool>::ParseString(GetGUI(),attr_value.FromUTF8(), hidden)) | ||||
LOGERROR("GUI: Error parsing '%s' (\"%s\")", attr_name.c_str(), attr_value.c_str()); | LOGERROR("GUI: Error parsing '%s' (\"%s\")", attr_name.c_str(), attr_value.c_str()); | ||||
} | } | ||||
else if (attr_name == "width") | else if (attr_name == "width") | ||||
{ | { | ||||
float width; | float width; | ||||
if (!GUI<float>::ParseString(attr_value.FromUTF8(), width)) | if (!GUI<float>::ParseString(GetGUI(),attr_value.FromUTF8(), width)) | ||||
LOGERROR("GUI: Error parsing '%s' (\"%s\")", attr_name.c_str(), attr_value.c_str()); | LOGERROR("GUI: Error parsing '%s' (\"%s\")", attr_name.c_str(), attr_value.c_str()); | ||||
else | else | ||||
{ | { | ||||
// Check if it's a relative value, and save as decimal if so. | // Check if it's a relative value, and save as decimal if so. | ||||
if (attr_value.find("%") != std::string::npos) | if (attr_value.find("%") != std::string::npos) | ||||
width = width / 100.f; | width = width / 100.f; | ||||
column.m_Width = width; | column.m_Width = width; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 230 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator