Ver Fonte

Register vcmi-only strings as part of 'vcmi' mod instead of 'core'

Ivan Savenko há 1 ano atrás
pai
commit
050157db9d
2 ficheiros alterados com 3 adições e 16 exclusões
  1. 2 2
      lib/CBonusTypeHandler.cpp
  2. 1 14
      lib/CGeneralTextHandler.cpp

+ 2 - 2
lib/CBonusTypeHandler.cpp

@@ -239,8 +239,8 @@ void CBonusTypeHandler::loadItem(const JsonNode & source, CBonusType & dest, con
 
 	if (!dest.hidden)
 	{
-		VLC->generaltexth->registerString( "core", dest.getNameTextID(), source["name"].String());
-		VLC->generaltexth->registerString( "core", dest.getDescriptionTextID(), source["description"].String());
+		VLC->generaltexth->registerString( "vcmi", dest.getNameTextID(), source["name"].String());
+		VLC->generaltexth->registerString( "vcmi", dest.getDescriptionTextID(), source["description"].String());
 	}
 
 	const JsonNode & graphics = source["graphics"];

+ 1 - 14
lib/CGeneralTextHandler.cpp

@@ -500,6 +500,7 @@ CGeneralTextHandler::CGeneralTextHandler():
 	readToVector("core.overview", "DATA/OVERVIEW.TXT" );
 	readToVector("core.arraytxt", "DATA/ARRAYTXT.TXT" );
 	readToVector("core.priskill", "DATA/PRISKILL.TXT" );
+	readToVector("core.plcolors", "DATA/PLCOLORS.TXT" );
 	readToVector("core.jktext",   "DATA/JKTEXT.TXT"   );
 	readToVector("core.tvrninfo", "DATA/TVRNINFO.TXT" );
 	readToVector("core.turndur",  "DATA/TURNDUR.TXT"  );
@@ -554,20 +555,6 @@ CGeneralTextHandler::CGeneralTextHandler():
 		}
 		while (parser.endLine());
 	}
-	{
-		CLegacyConfigParser parser(TextPath::builtin("DATA/PLCOLORS.TXT"));
-		size_t index = 0;
-		do
-		{
-			std::string color = parser.readString();
-
-			registerString("core", {"core.plcolors", index}, color);
-			color[0] = toupper(color[0]);
-			registerString("core", {"vcmi.capitalColors", index}, color);
-			index += 1;
-		}
-		while (parser.endLine());
-	}
 	{
 		CLegacyConfigParser parser(TextPath::builtin("DATA/SEERHUT.TXT"));