mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Revert "Load template name from user settings"
This reverts commit 73cc606ee2.
# Conflicts:
# lib/rmg/CRmgTemplateStorage.cpp
# lib/rmg/CRmgTemplateStorage.h
# mapeditor/windownewmap.cpp
This commit is contained in:
@@ -32,8 +32,6 @@ void CRmgTemplateStorage::loadObject(std::string scope, std::string name, const
|
||||
templates[fullKey].setId(name);
|
||||
templates[fullKey].serializeJson(handler);
|
||||
templates[fullKey].validate();
|
||||
|
||||
templatesByName[name] = templates[fullKey];
|
||||
}
|
||||
catch(const std::exception & e)
|
||||
{
|
||||
@@ -53,22 +51,14 @@ std::vector<JsonNode> CRmgTemplateStorage::loadLegacyData(size_t dataSize)
|
||||
//it would be cool to load old rmg.txt files
|
||||
}
|
||||
|
||||
const CRmgTemplate * CRmgTemplateStorage::getTemplate(const std::string & templateFullId) const
|
||||
const CRmgTemplate * CRmgTemplateStorage::getTemplate(const std::string & templateName) const
|
||||
{
|
||||
auto iter = templates.find(templateFullId);
|
||||
auto iter = templates.find(templateName);
|
||||
if(iter==templates.end())
|
||||
return nullptr;
|
||||
return &iter->second;
|
||||
}
|
||||
|
||||
const CRmgTemplate * CRmgTemplateStorage::getTemplateByName(const std::string & templateName) const
|
||||
{
|
||||
auto iter = templatesByName.find(templateName);
|
||||
if(iter == templatesByName.end())
|
||||
return nullptr;
|
||||
return &iter->second;
|
||||
}
|
||||
|
||||
std::vector<const CRmgTemplate *> CRmgTemplateStorage::getTemplates() const
|
||||
{
|
||||
std::vector<const CRmgTemplate *> result;
|
||||
|
||||
Reference in New Issue
Block a user