|
@@ -33,11 +33,8 @@ RoadType * RoadTypeHandler::loadFromJson(
|
|
|
RoadType * info = new RoadType;
|
|
|
|
|
|
info->id = RoadId(index);
|
|
|
- if (identifier.find(':') == std::string::npos)
|
|
|
- info->identifier = scope + ":" + identifier;
|
|
|
- else
|
|
|
- info->identifier = identifier;
|
|
|
-
|
|
|
+ info->identifier = identifier;
|
|
|
+ info->modScope = scope;
|
|
|
info->tilesFilename = json["tilesFilename"].String();
|
|
|
info->shortIdentifier = json["shortIdentifier"].String();
|
|
|
info->movementCost = json["moveCost"].Integer();
|
|
@@ -64,9 +61,14 @@ std::vector<bool> RoadTypeHandler::getDefaultAllowed() const
|
|
|
return {};
|
|
|
}
|
|
|
|
|
|
+std::string RoadType::getJsonKey() const
|
|
|
+{
|
|
|
+ return modScope + ":" + identifier;
|
|
|
+}
|
|
|
+
|
|
|
std::string RoadType::getNameTextID() const
|
|
|
{
|
|
|
- return TextIdentifier( "road", identifier, "name" ).get();
|
|
|
+ return TextIdentifier( "road", modScope, identifier, "name" ).get();
|
|
|
}
|
|
|
|
|
|
std::string RoadType::getNameTranslated() const
|
|
@@ -77,6 +79,7 @@ std::string RoadType::getNameTranslated() const
|
|
|
RoadType::RoadType():
|
|
|
id(Road::NO_ROAD),
|
|
|
identifier("empty"),
|
|
|
+ modScope("core"),
|
|
|
movementCost(GameConstants::BASE_MOVEMENT_COST)
|
|
|
{}
|
|
|
VCMI_LIB_NAMESPACE_END
|