Changeset View
Changeset View
Standalone View
Standalone View
source/ps/TemplateLoader.cpp
Show First 20 Lines • Show All 198 Lines • ▼ Show 20 Lines | source = "<Entity>" | ||||
"<Selectable>" | "<Selectable>" | ||||
"<EditorOnly/>" | "<EditorOnly/>" | ||||
"<Overlay><Texture><MainTexture>128x128/ellipse.png</MainTexture><MainTextureMask>128x128/ellipse_mask.png</MainTextureMask></Texture></Overlay>" | "<Overlay><Texture><MainTexture>128x128/ellipse.png</MainTexture><MainTextureMask>128x128/ellipse_mask.png</MainTextureMask></Texture></Overlay>" | ||||
"</Selectable>" | "</Selectable>" | ||||
"</Entity>"; | "</Entity>"; | ||||
// We'll assume that actorName is valid XML, otherwise this will fail and report the error anyways. | // We'll assume that actorName is valid XML, otherwise this will fail and report the error anyways. | ||||
CParamNode::LoadXMLString(out, source.c_str(), actorNameW.c_str()); | CParamNode::LoadXMLString(out, source.c_str(), actorNameW.c_str()); | ||||
} | } | ||||
const CParamNode& CTemplateLoader::Script_GetTemplate(const std::string& templateName) | |||||
{ | |||||
const CParamNode& templateRoot = GetTemplateFileData(templateName).GetChild("Entity"); | |||||
if (!templateRoot.IsOk()) | |||||
LOGERROR("Invalid template found for '%s'", templateName.c_str()); | |||||
return templateRoot; | |||||
} | |||||
bool CTemplateLoader::Script_TemplateExists(const std::string& templateName) const | |||||
{ | |||||
return TemplateExists(templateName); | |||||
} | |||||
std::vector<std::string> CTemplateLoader::Script_FindTemplates(const std::string& path, bool includeSubdirectories) const | |||||
{ | |||||
return FindTemplates(path, includeSubdirectories, SIMULATION_TEMPLATES); | |||||
} | |||||
std::vector<std::string> CTemplateLoader::Script_FindActorTemplates(const std::string& path, bool includeSubdirectories) const | |||||
{ | |||||
return FindTemplates(path, includeSubdirectories, ACTOR_TEMPLATES); | |||||
} |
Wildfire Games · Phabricator