Add a Utility class and update command interface.
This commit is contained in:
@@ -18,20 +18,20 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
{
|
||||
class ExtractLanguageStringsCommand : IUtilityCommand
|
||||
{
|
||||
public string Name { get { return "--extract-language-strings"; } }
|
||||
string IUtilityCommand.Name { get { return "--extract-language-strings"; } }
|
||||
|
||||
public bool ValidateArguments(string[] args)
|
||||
bool IUtilityCommand.ValidateArguments(string[] args)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
[Desc("Extract translatable strings that are not yet localized and update chrome layout.")]
|
||||
public void Run(ModData modData, string[] args)
|
||||
void IUtilityCommand.Run(Utility utility, string[] args)
|
||||
{
|
||||
// HACK: The engine code assumes that Game.modData is set.
|
||||
Game.ModData = modData;
|
||||
var modData = Game.ModData = utility.ModData;
|
||||
|
||||
var types = Game.ModData.ObjectCreator.GetTypes();
|
||||
var types = modData.ObjectCreator.GetTypes();
|
||||
var translatableFields = types.SelectMany(t => t.GetFields())
|
||||
.Where(f => f.HasAttribute<TranslateAttribute>()).Distinct();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user