Don't crash when joining a game after asset installation.
This commit is contained in:
committed by
Pavel Penev
parent
0f90713aba
commit
648c56bca1
@@ -14,7 +14,6 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using Fluent.Net;
|
||||
using OpenRA.Widgets;
|
||||
|
||||
namespace OpenRA.Network
|
||||
{
|
||||
@@ -119,7 +118,7 @@ namespace OpenRA.Network
|
||||
.JoinWith("\n");
|
||||
}
|
||||
|
||||
public string Translate()
|
||||
public string Translate(ModData modData)
|
||||
{
|
||||
var argumentDictionary = new Dictionary<string, object>();
|
||||
foreach (var argument in Arguments)
|
||||
@@ -130,7 +129,7 @@ namespace OpenRA.Network
|
||||
argumentDictionary.Add(argument.Key, new FluentString(argument.Value));
|
||||
}
|
||||
|
||||
return Ui.Translate(Key, argumentDictionary);
|
||||
return modData.Translation.GetFormattedMessage(Key, argumentDictionary);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace OpenRA.Network
|
||||
foreach (var node in yaml)
|
||||
{
|
||||
var localizedMessage = new LocalizedMessage(node.Value);
|
||||
TextNotificationsManager.AddSystemLine(localizedMessage.Translate());
|
||||
TextNotificationsManager.AddSystemLine(localizedMessage.Translate(Game.ModData));
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user