Rename Fluent *GetString methods to GetMessage.
This commit is contained in:
@@ -112,15 +112,15 @@ namespace OpenRA
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetString(string key, object[] args = null)
|
public string GetMessage(string key, object[] args = null)
|
||||||
{
|
{
|
||||||
if (!TryGetString(key, out var message, args))
|
if (!TryGetMessage(key, out var message, args))
|
||||||
message = key;
|
message = key;
|
||||||
|
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool TryGetString(string key, out string value, object[] args = null)
|
public bool TryGetMessage(string key, out string value, object[] args = null)
|
||||||
{
|
{
|
||||||
if (key == null)
|
if (key == null)
|
||||||
throw new ArgumentNullException(nameof(key));
|
throw new ArgumentNullException(nameof(key));
|
||||||
|
|||||||
@@ -31,32 +31,32 @@ namespace OpenRA
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetString(string key, params object[] args)
|
public static string GetMessage(string key, params object[] args)
|
||||||
{
|
{
|
||||||
lock (SyncObject)
|
lock (SyncObject)
|
||||||
{
|
{
|
||||||
// By prioritizing mod-level fluent bundles we prevent maps from overwriting string keys. We do not want to
|
// By prioritizing mod-level fluent bundles we prevent maps from overwriting string keys. We do not want to
|
||||||
// allow maps to change the UI nor any other strings not exposed to the map.
|
// allow maps to change the UI nor any other strings not exposed to the map.
|
||||||
if (modFluentBundle.TryGetString(key, out var message, args))
|
if (modFluentBundle.TryGetMessage(key, out var message, args))
|
||||||
return message;
|
return message;
|
||||||
|
|
||||||
if (mapFluentBundle != null)
|
if (mapFluentBundle != null)
|
||||||
return mapFluentBundle.GetString(key, args);
|
return mapFluentBundle.GetMessage(key, args);
|
||||||
|
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool TryGetString(string key, out string message, params object[] args)
|
public static bool TryGetMessage(string key, out string message, params object[] args)
|
||||||
{
|
{
|
||||||
lock (SyncObject)
|
lock (SyncObject)
|
||||||
{
|
{
|
||||||
// By prioritizing mod-level bundle we prevent maps from overwriting string keys. We do not want to
|
// By prioritizing mod-level bundle we prevent maps from overwriting string keys. We do not want to
|
||||||
// allow maps to change the UI nor any other strings not exposed to the map.
|
// allow maps to change the UI nor any other strings not exposed to the map.
|
||||||
if (modFluentBundle.TryGetString(key, out message, args))
|
if (modFluentBundle.TryGetMessage(key, out message, args))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (mapFluentBundle != null && mapFluentBundle.TryGetString(key, out message, args))
|
if (mapFluentBundle != null && mapFluentBundle.TryGetMessage(key, out message, args))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@@ -64,11 +64,11 @@ namespace OpenRA
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Should only be used by <see cref="MapPreview"/>.</summary>
|
/// <summary>Should only be used by <see cref="MapPreview"/>.</summary>
|
||||||
internal static bool TryGetModString(string key, out string message, params object[] args)
|
internal static bool TryGetModMessage(string key, out string message, params object[] args)
|
||||||
{
|
{
|
||||||
lock (SyncObject)
|
lock (SyncObject)
|
||||||
{
|
{
|
||||||
return modFluentBundle.TryGetString(key, out message, args);
|
return modFluentBundle.TryGetMessage(key, out message, args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -595,7 +595,7 @@ namespace OpenRA
|
|||||||
Log.Write("debug", "Taking screenshot " + path);
|
Log.Write("debug", "Taking screenshot " + path);
|
||||||
|
|
||||||
Renderer.SaveScreenshot(path);
|
Renderer.SaveScreenshot(path);
|
||||||
TextNotificationsManager.Debug(FluentProvider.GetString(SavedScreenshot, "filename", filename));
|
TextNotificationsManager.Debug(FluentProvider.GetMessage(SavedScreenshot, "filename", filename));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -152,8 +152,8 @@ namespace OpenRA
|
|||||||
if (player.IsBot)
|
if (player.IsBot)
|
||||||
{
|
{
|
||||||
var number = Players.Where(p => p.BotType == player.BotType).ToList().IndexOf(player) + 1;
|
var number = Players.Where(p => p.BotType == player.BotType).ToList().IndexOf(player) + 1;
|
||||||
return FluentProvider.GetString(EnumeratedBotName,
|
return FluentProvider.GetMessage(EnumeratedBotName,
|
||||||
"name", FluentProvider.GetString(player.Name),
|
"name", FluentProvider.GetMessage(player.Name),
|
||||||
"number", number);
|
"number", number);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -80,12 +80,12 @@ namespace OpenRA
|
|||||||
public static string DisplayString(Modifiers m)
|
public static string DisplayString(Modifiers m)
|
||||||
{
|
{
|
||||||
if (m == Modifiers.Meta && Platform.CurrentPlatform == PlatformType.OSX)
|
if (m == Modifiers.Meta && Platform.CurrentPlatform == PlatformType.OSX)
|
||||||
return FluentProvider.GetString(Cmd);
|
return FluentProvider.GetMessage(Cmd);
|
||||||
|
|
||||||
if (!ModifierFluentKeys.TryGetValue(m, out var fluentKey))
|
if (!ModifierFluentKeys.TryGetValue(m, out var fluentKey))
|
||||||
return m.ToString();
|
return m.ToString();
|
||||||
|
|
||||||
return FluentProvider.GetString(fluentKey);
|
return FluentProvider.GetMessage(fluentKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -507,7 +507,7 @@ namespace OpenRA
|
|||||||
if (!KeycodeFluentKeys.TryGetValue(k, out var fluentKey))
|
if (!KeycodeFluentKeys.TryGetValue(k, out var fluentKey))
|
||||||
return k.ToString();
|
return k.ToString();
|
||||||
|
|
||||||
return FluentProvider.GetString(fluentKey);
|
return FluentProvider.GetMessage(fluentKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,8 +57,8 @@ namespace OpenRA
|
|||||||
public readonly bool Hidden;
|
public readonly bool Hidden;
|
||||||
#pragma warning restore IDE1006 // Naming Styles
|
#pragma warning restore IDE1006 // Naming Styles
|
||||||
|
|
||||||
public string TitleTranslated => FluentProvider.GetString(Title);
|
public string TitleTranslated => FluentProvider.GetMessage(Title);
|
||||||
public string WindowTitleTranslated => WindowTitle != null ? FluentProvider.GetString(WindowTitle) : null;
|
public string WindowTitleTranslated => WindowTitle != null ? FluentProvider.GetMessage(WindowTitle) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Describes what is to be loaded in order to run a mod.</summary>
|
/// <summary>Describes what is to be loaded in order to run a mod.</summary>
|
||||||
|
|||||||
@@ -224,16 +224,16 @@ namespace OpenRA
|
|||||||
public int DownloadPercentage { get; private set; }
|
public int DownloadPercentage { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Functionality mirrors <see cref="FluentProvider.GetString"/>, except instead of using
|
/// Functionality mirrors <see cref="FluentProvider.GetMessage"/>, except instead of using
|
||||||
/// loaded <see cref="Map"/>'s fluent bundle as backup, we use this <see cref="MapPreview"/>'s.
|
/// loaded <see cref="Map"/>'s fluent bundle as backup, we use this <see cref="MapPreview"/>'s.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string GetString(string key, object[] args = null)
|
public string GetMessage(string key, object[] args = null)
|
||||||
{
|
{
|
||||||
// PERF: instead of loading mod level strings per each MapPreview, reuse the already loaded one in FluentProvider.
|
// PERF: instead of loading mod level strings per each MapPreview, reuse the already loaded one in FluentProvider.
|
||||||
if (FluentProvider.TryGetModString(key, out var message, args))
|
if (FluentProvider.TryGetModMessage(key, out var message, args))
|
||||||
return message;
|
return message;
|
||||||
|
|
||||||
return innerData.FluentBundle?.GetString(key, args) ?? key;
|
return innerData.FluentBundle?.GetMessage(key, args) ?? key;
|
||||||
}
|
}
|
||||||
|
|
||||||
Sprite minimap;
|
Sprite minimap;
|
||||||
|
|||||||
@@ -238,8 +238,8 @@ namespace OpenRA
|
|||||||
{
|
{
|
||||||
var botInfo = botInfos.First(b => b.Type == BotType);
|
var botInfo = botInfos.First(b => b.Type == BotType);
|
||||||
var botsOfSameType = World.Players.Where(c => c.BotType == BotType).ToArray();
|
var botsOfSameType = World.Players.Where(c => c.BotType == BotType).ToArray();
|
||||||
return FluentProvider.GetString(EnumeratedBotName,
|
return FluentProvider.GetMessage(EnumeratedBotName,
|
||||||
"name", FluentProvider.GetString(botInfo.Name),
|
"name", FluentProvider.GetMessage(botInfo.Name),
|
||||||
"number", botsOfSameType.IndexOf(this) + 1);
|
"number", botsOfSameType.IndexOf(this) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -958,7 +958,7 @@ namespace OpenRA.Server
|
|||||||
DispatchServerOrdersToClients(Order.FromTargetString("FluentMessage", text, true));
|
DispatchServerOrdersToClients(Order.FromTargetString("FluentMessage", text, true));
|
||||||
|
|
||||||
if (Type == ServerType.Dedicated)
|
if (Type == ServerType.Dedicated)
|
||||||
WriteLineWithTimeStamp(FluentProvider.GetString(key, args));
|
WriteLineWithTimeStamp(FluentProvider.GetMessage(key, args));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendFluentMessageTo(Connection conn, string key, object[] args = null)
|
public void SendFluentMessageTo(Connection conn, string key, object[] args = null)
|
||||||
@@ -1302,7 +1302,7 @@ namespace OpenRA.Server
|
|||||||
{
|
{
|
||||||
lock (LobbyInfo)
|
lock (LobbyInfo)
|
||||||
{
|
{
|
||||||
WriteLineWithTimeStamp(FluentProvider.GetString(GameStarted));
|
WriteLineWithTimeStamp(FluentProvider.GetMessage(GameStarted));
|
||||||
|
|
||||||
// Drop any players who are not ready
|
// Drop any players who are not ready
|
||||||
foreach (var c in Conns.Where(c => !c.Validated || GetClient(c).IsInvalid).ToArray())
|
foreach (var c in Conns.Where(c => !c.Validated || GetClient(c).IsInvalid).ToArray())
|
||||||
|
|||||||
@@ -38,12 +38,12 @@ namespace OpenRA
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (player == null || player == player.World.LocalPlayer)
|
if (player == null || player == player.World.LocalPlayer)
|
||||||
AddTextNotification(TextNotificationPool.Transients, SystemClientId, SystemMessageLabel, FluentProvider.GetString(text));
|
AddTextNotification(TextNotificationPool.Transients, SystemClientId, SystemMessageLabel, FluentProvider.GetMessage(text));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void AddFeedbackLine(string text, params object[] args)
|
public static void AddFeedbackLine(string text, params object[] args)
|
||||||
{
|
{
|
||||||
AddTextNotification(TextNotificationPool.Feedback, SystemClientId, SystemMessageLabel, FluentProvider.GetString(text, args));
|
AddTextNotification(TextNotificationPool.Feedback, SystemClientId, SystemMessageLabel, FluentProvider.GetMessage(text, args));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void AddMissionLine(string prefix, string text, Color? prefixColor = null)
|
public static void AddMissionLine(string prefix, string text, Color? prefixColor = null)
|
||||||
@@ -53,17 +53,17 @@ namespace OpenRA
|
|||||||
|
|
||||||
public static void AddPlayerJoinedLine(string text, params object[] args)
|
public static void AddPlayerJoinedLine(string text, params object[] args)
|
||||||
{
|
{
|
||||||
AddTextNotification(TextNotificationPool.Join, SystemClientId, SystemMessageLabel, FluentProvider.GetString(text, args));
|
AddTextNotification(TextNotificationPool.Join, SystemClientId, SystemMessageLabel, FluentProvider.GetMessage(text, args));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void AddPlayerLeftLine(string text, params object[] args)
|
public static void AddPlayerLeftLine(string text, params object[] args)
|
||||||
{
|
{
|
||||||
AddTextNotification(TextNotificationPool.Leave, SystemClientId, SystemMessageLabel, FluentProvider.GetString(text, args));
|
AddTextNotification(TextNotificationPool.Leave, SystemClientId, SystemMessageLabel, FluentProvider.GetMessage(text, args));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void AddSystemLine(string text, params object[] args)
|
public static void AddSystemLine(string text, params object[] args)
|
||||||
{
|
{
|
||||||
AddSystemLine(SystemMessageLabel, FluentProvider.GetString(text, args));
|
AddSystemLine(SystemMessageLabel, FluentProvider.GetMessage(text, args));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void AddSystemLine(string prefix, string text)
|
public static void AddSystemLine(string prefix, string text)
|
||||||
|
|||||||
@@ -586,11 +586,11 @@ namespace OpenRA.Traits
|
|||||||
IReadOnlyDictionary<string, string> values, string defaultValue, bool locked)
|
IReadOnlyDictionary<string, string> values, string defaultValue, bool locked)
|
||||||
{
|
{
|
||||||
Id = id;
|
Id = id;
|
||||||
Name = map.GetString(name);
|
Name = map.GetMessage(name);
|
||||||
Description = description != null ? map.GetString(description).Replace(@"\n", "\n") : null;
|
Description = description != null ? map.GetMessage(description).Replace(@"\n", "\n") : null;
|
||||||
IsVisible = visible;
|
IsVisible = visible;
|
||||||
DisplayOrder = displayorder;
|
DisplayOrder = displayorder;
|
||||||
Values = values.ToDictionary(v => v.Key, v => map.GetString(v.Value));
|
Values = values.ToDictionary(v => v.Key, v => map.GetMessage(v.Value));
|
||||||
DefaultValue = defaultValue;
|
DefaultValue = defaultValue;
|
||||||
IsLocked = locked;
|
IsLocked = locked;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ namespace OpenRA.Mods.Cnc
|
|||||||
|
|
||||||
versionText = modData.Manifest.Metadata.Version;
|
versionText = modData.Manifest.Metadata.Version;
|
||||||
|
|
||||||
message = FluentProvider.GetString(Loading);
|
message = FluentProvider.GetMessage(Loading);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DisplayInner(Renderer r, Sheet s, int density)
|
public override void DisplayInner(Renderer r, Sheet s, int density)
|
||||||
|
|||||||
@@ -51,9 +51,9 @@ namespace OpenRA.Mods.Cnc.Installer
|
|||||||
|
|
||||||
Action<long> onProgress = null;
|
Action<long> onProgress = null;
|
||||||
if (stream.Length < InstallFromSourceLogic.ShowPercentageThreshold)
|
if (stream.Length < InstallFromSourceLogic.ShowPercentageThreshold)
|
||||||
updateMessage(FluentProvider.GetString(InstallFromSourceLogic.Extracting, "filename", displayFilename));
|
updateMessage(FluentProvider.GetMessage(InstallFromSourceLogic.Extracting, "filename", displayFilename));
|
||||||
else
|
else
|
||||||
onProgress = b => updateMessage(FluentProvider.GetString(InstallFromSourceLogic.ExtractingProgress,
|
onProgress = b => updateMessage(FluentProvider.GetMessage(InstallFromSourceLogic.ExtractingProgress,
|
||||||
"filename", displayFilename,
|
"filename", displayFilename,
|
||||||
"progress", 100 * b / stream.Length));
|
"progress", 100 * b / stream.Length));
|
||||||
|
|
||||||
|
|||||||
@@ -371,7 +371,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
|||||||
string IResourceRenderer.GetRenderedResourceTooltip(CPos cell)
|
string IResourceRenderer.GetRenderedResourceTooltip(CPos cell)
|
||||||
{
|
{
|
||||||
if (renderIndices[cell] != null || borders[cell] != Adjacency.None)
|
if (renderIndices[cell] != null || borders[cell] != Adjacency.None)
|
||||||
return FluentProvider.GetString(info.Name);
|
return FluentProvider.GetMessage(info.Name);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ namespace OpenRA.Mods.Common.Commands
|
|||||||
if (Commands.TryGetValue(name, out var command))
|
if (Commands.TryGetValue(name, out var command))
|
||||||
command.InvokeCommand(name, message[(1 + name.Length)..].Trim());
|
command.InvokeCommand(name, message[(1 + name.Length)..].Trim());
|
||||||
else
|
else
|
||||||
TextNotificationsManager.Debug(FluentProvider.GetString(InvalidCommand, "name", name));
|
TextNotificationsManager.Debug(FluentProvider.GetMessage(InvalidCommand, "name", name));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ namespace OpenRA.Mods.Common.Commands
|
|||||||
|
|
||||||
if (!developerMode.Enabled)
|
if (!developerMode.Enabled)
|
||||||
{
|
{
|
||||||
TextNotificationsManager.Debug(FluentProvider.GetString(CheatsDisabled));
|
TextNotificationsManager.Debug(FluentProvider.GetMessage(CheatsDisabled));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,7 +149,7 @@ namespace OpenRA.Mods.Common.Commands
|
|||||||
giveCashOrder.ExtraData = (uint)cash;
|
giveCashOrder.ExtraData = (uint)cash;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TextNotificationsManager.Debug(FluentProvider.GetString(InvalidCashAmount));
|
TextNotificationsManager.Debug(FluentProvider.GetMessage(InvalidCashAmount));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,12 +52,12 @@ namespace OpenRA.Mods.Common.Commands
|
|||||||
|
|
||||||
public void InvokeCommand(string name, string arg)
|
public void InvokeCommand(string name, string arg)
|
||||||
{
|
{
|
||||||
TextNotificationsManager.Debug(FluentProvider.GetString(AvailableCommands));
|
TextNotificationsManager.Debug(FluentProvider.GetMessage(AvailableCommands));
|
||||||
|
|
||||||
foreach (var key in console.Commands.Keys.OrderBy(k => k))
|
foreach (var key in console.Commands.Keys.OrderBy(k => k))
|
||||||
{
|
{
|
||||||
if (!helpDescriptions.TryGetValue(key, out var description))
|
if (!helpDescriptions.TryGetValue(key, out var description))
|
||||||
description = FluentProvider.GetString(NoDescription);
|
description = FluentProvider.GetMessage(NoDescription);
|
||||||
|
|
||||||
TextNotificationsManager.Debug($"{key}: {description}");
|
TextNotificationsManager.Debug($"{key}: {description}");
|
||||||
}
|
}
|
||||||
@@ -65,7 +65,7 @@ namespace OpenRA.Mods.Common.Commands
|
|||||||
|
|
||||||
public void RegisterHelp(string name, string description)
|
public void RegisterHelp(string name, string description)
|
||||||
{
|
{
|
||||||
helpDescriptions[name] = FluentProvider.GetString(description);
|
helpDescriptions[name] = FluentProvider.GetMessage(description);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
public void Do()
|
public void Do()
|
||||||
{
|
{
|
||||||
editorActorPreview = editorLayer.Add(actor);
|
editorActorPreview = editorLayer.Add(actor);
|
||||||
Text = FluentProvider.GetString(AddedActor,
|
Text = FluentProvider.GetMessage(AddedActor,
|
||||||
"name", editorActorPreview.Info.Name,
|
"name", editorActorPreview.Info.Name,
|
||||||
"id", editorActorPreview.ID);
|
"id", editorActorPreview.ID);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
|
|
||||||
undoClipboard = CopySelectionContents();
|
undoClipboard = CopySelectionContents();
|
||||||
|
|
||||||
Text = FluentProvider.GetString(CopiedTiles, "amount", clipboard.Tiles.Count);
|
Text = FluentProvider.GetMessage(CopiedTiles, "amount", clipboard.Tiles.Count);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -308,15 +308,15 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (selection.Area != null)
|
if (selection.Area != null)
|
||||||
Text = FluentProvider.GetString(SelectedArea,
|
Text = FluentProvider.GetMessage(SelectedArea,
|
||||||
"x", selection.Area.TopLeft.X,
|
"x", selection.Area.TopLeft.X,
|
||||||
"y", selection.Area.TopLeft.Y,
|
"y", selection.Area.TopLeft.Y,
|
||||||
"width", selection.Area.BottomRight.X - selection.Area.TopLeft.X,
|
"width", selection.Area.BottomRight.X - selection.Area.TopLeft.X,
|
||||||
"height", selection.Area.BottomRight.Y - selection.Area.TopLeft.Y);
|
"height", selection.Area.BottomRight.Y - selection.Area.TopLeft.Y);
|
||||||
else if (selection.Actor != null)
|
else if (selection.Actor != null)
|
||||||
Text = FluentProvider.GetString(SelectedActor, "id", selection.Actor.ID);
|
Text = FluentProvider.GetMessage(SelectedActor, "id", selection.Actor.ID);
|
||||||
else
|
else
|
||||||
Text = FluentProvider.GetString(ClearedSelection);
|
Text = FluentProvider.GetMessage(ClearedSelection);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Execute()
|
public void Execute()
|
||||||
@@ -360,7 +360,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
Actor = defaultBrush.Selection.Actor
|
Actor = defaultBrush.Selection.Actor
|
||||||
};
|
};
|
||||||
|
|
||||||
Text = FluentProvider.GetString(RemovedActor, "name", actor.Info.Name, "id", actor.ID);
|
Text = FluentProvider.GetMessage(RemovedActor, "name", actor.Info.Name, "id", actor.ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Execute()
|
public void Execute()
|
||||||
@@ -396,7 +396,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
this.editorActorLayer = editorActorLayer;
|
this.editorActorLayer = editorActorLayer;
|
||||||
this.actor = actor;
|
this.actor = actor;
|
||||||
|
|
||||||
Text = FluentProvider.GetString(RemovedActor, "name", actor.Info.Name, "id", actor.ID);
|
Text = FluentProvider.GetMessage(RemovedActor, "name", actor.Info.Name, "id", actor.ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Execute()
|
public void Execute()
|
||||||
@@ -464,7 +464,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
to = worldRenderer.Viewport.ViewToWorld(pixelTo + pixelOffset) + cellOffset;
|
to = worldRenderer.Viewport.ViewToWorld(pixelTo + pixelOffset) + cellOffset;
|
||||||
layer.MoveActor(actor, to);
|
layer.MoveActor(actor, to);
|
||||||
|
|
||||||
Text = FluentProvider.GetString(MovedActor, "id", actor.ID, "x1", from.X, "y1", from.Y, "x2", to.X, "y2", to.Y);
|
Text = FluentProvider.GetMessage(MovedActor, "id", actor.ID, "x1", from.X, "y1", from.Y, "x2", to.X, "y2", to.Y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -485,7 +485,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
this.resourceLayer = resourceLayer;
|
this.resourceLayer = resourceLayer;
|
||||||
this.cell = cell;
|
this.cell = cell;
|
||||||
|
|
||||||
Text = FluentProvider.GetString(RemovedResource, "type", resourceType);
|
Text = FluentProvider.GetMessage(RemovedResource, "type", resourceType);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Execute()
|
public void Execute()
|
||||||
|
|||||||
@@ -150,9 +150,9 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (type != null)
|
if (type != null)
|
||||||
Text = FluentProvider.GetString(AddedMarkerTiles, "amount", paintTiles.Count, "type", type);
|
Text = FluentProvider.GetMessage(AddedMarkerTiles, "amount", paintTiles.Count, "type", type);
|
||||||
else
|
else
|
||||||
Text = FluentProvider.GetString(RemovedMarkerTiles, "amount", paintTiles.Count);
|
Text = FluentProvider.GetMessage(RemovedMarkerTiles, "amount", paintTiles.Count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,7 +176,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
|
|
||||||
tiles = new HashSet<CPos>(markerLayerOverlay.Tiles[tile]);
|
tiles = new HashSet<CPos>(markerLayerOverlay.Tiles[tile]);
|
||||||
|
|
||||||
Text = FluentProvider.GetString(ClearedSelectedMarkerTiles, "amount", tiles.Count, "type", tile);
|
Text = FluentProvider.GetMessage(ClearedSelectedMarkerTiles, "amount", tiles.Count, "type", tile);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Execute()
|
public void Execute()
|
||||||
@@ -213,7 +213,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
|
|
||||||
var allTilesCount = tiles.Values.Select(x => x.Count).Sum();
|
var allTilesCount = tiles.Values.Select(x => x.Count).Sum();
|
||||||
|
|
||||||
Text = FluentProvider.GetString(ClearedAllMarkerTiles, "amount", allTilesCount);
|
Text = FluentProvider.GetMessage(ClearedAllMarkerTiles, "amount", allTilesCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Execute()
|
public void Execute()
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
resourceLayer.ClearResources(resourceCell.Cell);
|
resourceLayer.ClearResources(resourceCell.Cell);
|
||||||
resourceLayer.AddResource(resourceCell.NewResourceType, resourceCell.Cell, resourceLayer.GetMaxDensity(resourceCell.NewResourceType));
|
resourceLayer.AddResource(resourceCell.NewResourceType, resourceCell.Cell, resourceLayer.GetMaxDensity(resourceCell.NewResourceType));
|
||||||
cellResources.Add(resourceCell);
|
cellResources.Add(resourceCell);
|
||||||
Text = FluentProvider.GetString(AddedResource, "amount", cellResources.Count, "type", resourceType);
|
Text = FluentProvider.GetMessage(AddedResource, "amount", cellResources.Count, "type", resourceType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
|
|
||||||
var terrainInfo = (ITemplatedTerrainInfo)map.Rules.TerrainInfo;
|
var terrainInfo = (ITemplatedTerrainInfo)map.Rules.TerrainInfo;
|
||||||
terrainTemplate = terrainInfo.Templates[template];
|
terrainTemplate = terrainInfo.Templates[template];
|
||||||
Text = FluentProvider.GetString(AddedTile, "id", terrainTemplate.Id);
|
Text = FluentProvider.GetMessage(AddedTile, "id", terrainTemplate.Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Execute()
|
public void Execute()
|
||||||
@@ -264,7 +264,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
|
|
||||||
var terrainInfo = (ITemplatedTerrainInfo)map.Rules.TerrainInfo;
|
var terrainInfo = (ITemplatedTerrainInfo)map.Rules.TerrainInfo;
|
||||||
terrainTemplate = terrainInfo.Templates[template];
|
terrainTemplate = terrainInfo.Templates[template];
|
||||||
Text = FluentProvider.GetString(FilledTile, "id", terrainTemplate.Id);
|
Text = FluentProvider.GetMessage(FilledTile, "id", terrainTemplate.Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Execute()
|
public void Execute()
|
||||||
|
|||||||
@@ -44,10 +44,10 @@ namespace OpenRA.Mods.Common.Installer
|
|||||||
|
|
||||||
Action<long> onProgress = null;
|
Action<long> onProgress = null;
|
||||||
if (length < InstallFromSourceLogic.ShowPercentageThreshold)
|
if (length < InstallFromSourceLogic.ShowPercentageThreshold)
|
||||||
updateMessage(FluentProvider.GetString(InstallFromSourceLogic.CopyingFilename,
|
updateMessage(FluentProvider.GetMessage(InstallFromSourceLogic.CopyingFilename,
|
||||||
"filename", displayFilename));
|
"filename", displayFilename));
|
||||||
else
|
else
|
||||||
onProgress = b => updateMessage(FluentProvider.GetString(InstallFromSourceLogic.CopyingFilenameProgress,
|
onProgress = b => updateMessage(FluentProvider.GetMessage(InstallFromSourceLogic.CopyingFilenameProgress,
|
||||||
"filename", displayFilename,
|
"filename", displayFilename,
|
||||||
"progress", 100 * b / length));
|
"progress", 100 * b / length));
|
||||||
|
|
||||||
|
|||||||
@@ -68,10 +68,10 @@ namespace OpenRA.Mods.Common.Installer
|
|||||||
|
|
||||||
Action<long> onProgress = null;
|
Action<long> onProgress = null;
|
||||||
if (length < InstallFromSourceLogic.ShowPercentageThreshold)
|
if (length < InstallFromSourceLogic.ShowPercentageThreshold)
|
||||||
updateMessage(FluentProvider.GetString(InstallFromSourceLogic.Extracting,
|
updateMessage(FluentProvider.GetMessage(InstallFromSourceLogic.Extracting,
|
||||||
"filename", displayFilename));
|
"filename", displayFilename));
|
||||||
else
|
else
|
||||||
onProgress = b => updateMessage(FluentProvider.GetString(InstallFromSourceLogic.ExtractingProgress,
|
onProgress = b => updateMessage(FluentProvider.GetMessage(InstallFromSourceLogic.ExtractingProgress,
|
||||||
"filename", displayFilename,
|
"filename", displayFilename,
|
||||||
"progress", 100 * b / length));
|
"progress", 100 * b / length));
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ namespace OpenRA.Mods.Common.Installer
|
|||||||
{
|
{
|
||||||
Log.Write("install", $"Extracting {sourcePath} -> {targetPath}");
|
Log.Write("install", $"Extracting {sourcePath} -> {targetPath}");
|
||||||
var displayFilename = Path.GetFileName(Path.GetFileName(targetPath));
|
var displayFilename = Path.GetFileName(Path.GetFileName(targetPath));
|
||||||
void OnProgress(int percent) => updateMessage(FluentProvider.GetString(
|
void OnProgress(int percent) => updateMessage(FluentProvider.GetMessage(
|
||||||
InstallFromSourceLogic.ExtractingProgress,
|
InstallFromSourceLogic.ExtractingProgress,
|
||||||
"filename", displayFilename, "progress", percent));
|
"filename", displayFilename, "progress", percent));
|
||||||
reader.ExtractFile(node.Value.Value, target, OnProgress);
|
reader.ExtractFile(node.Value.Value, target, OnProgress);
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ namespace OpenRA.Mods.Common.Installer
|
|||||||
{
|
{
|
||||||
Log.Write("install", $"Extracting {sourcePath} -> {targetPath}");
|
Log.Write("install", $"Extracting {sourcePath} -> {targetPath}");
|
||||||
var displayFilename = Path.GetFileName(Path.GetFileName(targetPath));
|
var displayFilename = Path.GetFileName(Path.GetFileName(targetPath));
|
||||||
void OnProgress(int percent) => updateMessage(FluentProvider.GetString(InstallFromSourceLogic.ExtractingProgress,
|
void OnProgress(int percent) => updateMessage(FluentProvider.GetMessage(InstallFromSourceLogic.ExtractingProgress,
|
||||||
"filename", displayFilename,
|
"filename", displayFilename,
|
||||||
"progress", percent));
|
"progress", percent));
|
||||||
reader.ExtractFile(node.Value.Value, target, OnProgress);
|
reader.ExtractFile(node.Value.Value, target, OnProgress);
|
||||||
|
|||||||
@@ -61,10 +61,10 @@ namespace OpenRA.Mods.Common.Installer
|
|||||||
|
|
||||||
Action<long> onProgress = null;
|
Action<long> onProgress = null;
|
||||||
if (length < InstallFromSourceLogic.ShowPercentageThreshold)
|
if (length < InstallFromSourceLogic.ShowPercentageThreshold)
|
||||||
updateMessage(FluentProvider.GetString(InstallFromSourceLogic.Extracting,
|
updateMessage(FluentProvider.GetMessage(InstallFromSourceLogic.Extracting,
|
||||||
"filename", displayFilename));
|
"filename", displayFilename));
|
||||||
else
|
else
|
||||||
onProgress = b => updateMessage(FluentProvider.GetString(InstallFromSourceLogic.ExtractingProgress,
|
onProgress = b => updateMessage(FluentProvider.GetMessage(InstallFromSourceLogic.ExtractingProgress,
|
||||||
"filename", displayFilename,
|
"filename", displayFilename,
|
||||||
"progress", 100 * b / length));
|
"progress", 100 * b / length));
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ namespace OpenRA.Mods.Common.Installer
|
|||||||
using (var targetStream = File.OpenWrite(targetPath))
|
using (var targetStream = File.OpenWrite(targetPath))
|
||||||
sourceStream.CopyTo(targetStream);
|
sourceStream.CopyTo(targetStream);
|
||||||
|
|
||||||
updateMessage(FluentProvider.GetString(InstallFromSourceLogic.ExtractingProgress,
|
updateMessage(FluentProvider.GetMessage(InstallFromSourceLogic.ExtractingProgress,
|
||||||
"filename", displayFilename,
|
"filename", displayFilename,
|
||||||
"progress", 100));
|
"progress", 100));
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ namespace OpenRA.Mods.Common.LoadScreens
|
|||||||
{
|
{
|
||||||
base.Init(modData, info);
|
base.Init(modData, info);
|
||||||
|
|
||||||
messages = FluentProvider.GetString(Loading).Split(',').Select(x => x.Trim()).ToArray();
|
messages = FluentProvider.GetMessage(Loading).Split(',').Select(x => x.Trim()).ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DisplayInner(Renderer r, Sheet s, int density)
|
public override void DisplayInner(Renderer r, Sheet s, int density)
|
||||||
|
|||||||
@@ -56,10 +56,10 @@ namespace OpenRA.Mods.Common.Scripting.Global
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return FluentProvider.GetString(key, argumentDictionary);
|
return FluentProvider.GetMessage(key, argumentDictionary);
|
||||||
}
|
}
|
||||||
|
|
||||||
return FluentProvider.GetString(key);
|
return FluentProvider.GetMessage(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ namespace OpenRA.Mods.Common.Scripting
|
|||||||
if (tooltip == null)
|
if (tooltip == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return FluentProvider.GetString(tooltip.Info.Name);
|
return FluentProvider.GetMessage(tooltip.Info.Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -275,7 +275,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
TextNotificationsManager.Debug(FluentProvider.GetString(CheatUsed,
|
TextNotificationsManager.Debug(FluentProvider.GetMessage(CheatUsed,
|
||||||
"cheat", order.OrderString,
|
"cheat", order.OrderString,
|
||||||
"player", self.Owner.ResolvedPlayerName,
|
"player", self.Owner.ResolvedPlayerName,
|
||||||
"suffix", debugSuffix));
|
"suffix", debugSuffix));
|
||||||
|
|||||||
@@ -177,8 +177,8 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
Key = key;
|
Key = key;
|
||||||
TotalTicks = info.ChargeInterval;
|
TotalTicks = info.ChargeInterval;
|
||||||
remainingSubTicks = info.StartFullyCharged ? 0 : TotalTicks * 100;
|
remainingSubTicks = info.StartFullyCharged ? 0 : TotalTicks * 100;
|
||||||
Name = info.Name == null ? string.Empty : FluentProvider.GetString(info.Name);
|
Name = info.Name == null ? string.Empty : FluentProvider.GetMessage(info.Name);
|
||||||
Description = info.Description == null ? string.Empty : FluentProvider.GetString(info.Description);
|
Description = info.Description == null ? string.Empty : FluentProvider.GetMessage(info.Description);
|
||||||
|
|
||||||
Manager = manager;
|
Manager = manager;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,19 +60,19 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
public string TooltipForPlayerStance(PlayerRelationship relationship)
|
public string TooltipForPlayerStance(PlayerRelationship relationship)
|
||||||
{
|
{
|
||||||
if (relationship == PlayerRelationship.None || !GenericVisibility.HasRelationship(relationship))
|
if (relationship == PlayerRelationship.None || !GenericVisibility.HasRelationship(relationship))
|
||||||
return FluentProvider.GetString(Name);
|
return FluentProvider.GetMessage(Name);
|
||||||
|
|
||||||
var genericName = string.IsNullOrEmpty(GenericName) ? "" : FluentProvider.GetString(GenericName);
|
var genericName = string.IsNullOrEmpty(GenericName) ? "" : FluentProvider.GetMessage(GenericName);
|
||||||
if (GenericStancePrefix)
|
if (GenericStancePrefix)
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(AllyPrefix) && relationship == PlayerRelationship.Ally)
|
if (!string.IsNullOrEmpty(AllyPrefix) && relationship == PlayerRelationship.Ally)
|
||||||
return FluentProvider.GetString(AllyPrefix) + " " + genericName;
|
return FluentProvider.GetMessage(AllyPrefix) + " " + genericName;
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(NeutralPrefix) && relationship == PlayerRelationship.Neutral)
|
if (!string.IsNullOrEmpty(NeutralPrefix) && relationship == PlayerRelationship.Neutral)
|
||||||
return FluentProvider.GetString(NeutralPrefix) + " " + genericName;
|
return FluentProvider.GetMessage(NeutralPrefix) + " " + genericName;
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(EnemyPrefix) && relationship == PlayerRelationship.Enemy)
|
if (!string.IsNullOrEmpty(EnemyPrefix) && relationship == PlayerRelationship.Enemy)
|
||||||
return FluentProvider.GetString(EnemyPrefix) + " " + genericName;
|
return FluentProvider.GetMessage(EnemyPrefix) + " " + genericName;
|
||||||
}
|
}
|
||||||
|
|
||||||
return genericName;
|
return genericName;
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
: base(info)
|
: base(info)
|
||||||
{
|
{
|
||||||
this.self = self;
|
this.self = self;
|
||||||
TooltipText = FluentProvider.GetString(info.Description);
|
TooltipText = FluentProvider.GetMessage(info.Description);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsTooltipVisible(Player forPlayer)
|
public bool IsTooltipVisible(Player forPlayer)
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
public OpenMapAction()
|
public OpenMapAction()
|
||||||
{
|
{
|
||||||
Text = FluentProvider.GetString(Opened);
|
Text = FluentProvider.GetMessage(Opened);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Execute()
|
public void Execute()
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
public readonly ActorInfo Info;
|
public readonly ActorInfo Info;
|
||||||
|
|
||||||
public string Tooltip =>
|
public string Tooltip =>
|
||||||
(tooltip == null ? " < " + Info.Name + " >" : FluentProvider.GetString(tooltip.Name)) + "\n" + Owner.Name + " (" + Owner.Faction + ")"
|
(tooltip == null ? " < " + Info.Name + " >" : FluentProvider.GetMessage(tooltip.Name)) + "\n" + Owner.Name + " (" + Owner.Faction + ")"
|
||||||
+ "\nID: " + ID + "\nType: " + Info.Name;
|
+ "\nID: " + ID + "\nType: " + Info.Name;
|
||||||
|
|
||||||
public string Type => reference.Type;
|
public string Type => reference.Type;
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
ShortGameCheckboxVisible, ShortGameCheckboxDisplayOrder, ShortGameCheckboxEnabled, ShortGameCheckboxLocked);
|
ShortGameCheckboxVisible, ShortGameCheckboxDisplayOrder, ShortGameCheckboxEnabled, ShortGameCheckboxLocked);
|
||||||
|
|
||||||
var techLevels = map.PlayerActorInfo.TraitInfos<ProvidesTechPrerequisiteInfo>()
|
var techLevels = map.PlayerActorInfo.TraitInfos<ProvidesTechPrerequisiteInfo>()
|
||||||
.ToDictionary(t => t.Id, t => map.GetString(t.Name));
|
.ToDictionary(t => t.Id, t => map.GetMessage(t.Name));
|
||||||
|
|
||||||
if (techLevels.Count > 0)
|
if (techLevels.Count > 0)
|
||||||
yield return new LobbyOption(map, "techlevel",
|
yield return new LobbyOption(map, "techlevel",
|
||||||
@@ -94,7 +94,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
techLevels, TechLevel, TechLevelDropdownLocked);
|
techLevels, TechLevel, TechLevelDropdownLocked);
|
||||||
|
|
||||||
var gameSpeeds = Game.ModData.Manifest.Get<GameSpeeds>();
|
var gameSpeeds = Game.ModData.Manifest.Get<GameSpeeds>();
|
||||||
var speeds = gameSpeeds.Speeds.ToDictionary(s => s.Key, s => FluentProvider.GetString(s.Value.Name));
|
var speeds = gameSpeeds.Speeds.ToDictionary(s => s.Key, s => FluentProvider.GetMessage(s.Value.Name));
|
||||||
|
|
||||||
// NOTE: This is just exposing the UI, the backend logic for this option is hardcoded in World.
|
// NOTE: This is just exposing the UI, the backend logic for this option is hardcoded in World.
|
||||||
yield return new LobbyOption(map, "gamespeed",
|
yield return new LobbyOption(map, "gamespeed",
|
||||||
|
|||||||
@@ -273,7 +273,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (info == null)
|
if (info == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return FluentProvider.GetString(info.Name);
|
return FluentProvider.GetMessage(info.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
IEnumerable<string> IResourceRenderer.ResourceTypes => Info.ResourceTypes.Keys;
|
IEnumerable<string> IResourceRenderer.ResourceTypes => Info.ResourceTypes.Keys;
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
// Duplicate classes are defined for different race variants
|
// Duplicate classes are defined for different race variants
|
||||||
foreach (var t in map.WorldActorInfo.TraitInfos<StartingUnitsInfo>())
|
foreach (var t in map.WorldActorInfo.TraitInfos<StartingUnitsInfo>())
|
||||||
startingUnits[t.Class] = map.GetString(t.ClassName);
|
startingUnits[t.Class] = map.GetMessage(t.ClassName);
|
||||||
|
|
||||||
if (startingUnits.Count > 0)
|
if (startingUnits.Count > 0)
|
||||||
yield return new LobbyOption(map, "startingunits", DropdownLabel, DropdownDescription, DropdownVisible, DropdownDisplayOrder,
|
yield return new LobbyOption(map, "startingunits", DropdownLabel, DropdownDescription, DropdownVisible, DropdownDisplayOrder,
|
||||||
|
|||||||
@@ -88,9 +88,9 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
var timelimits = TimeLimitOptions.ToDictionary(m => m.ToStringInvariant(), m =>
|
var timelimits = TimeLimitOptions.ToDictionary(m => m.ToStringInvariant(), m =>
|
||||||
{
|
{
|
||||||
if (m == 0)
|
if (m == 0)
|
||||||
return FluentProvider.GetString(NoTimeLimit);
|
return FluentProvider.GetMessage(NoTimeLimit);
|
||||||
else
|
else
|
||||||
return FluentProvider.GetString(TimeLimitOption, "minutes", m);
|
return FluentProvider.GetMessage(TimeLimitOption, "minutes", m);
|
||||||
});
|
});
|
||||||
|
|
||||||
yield return new LobbyOption(map, "timelimit", TimeLimitLabel, TimeLimitDescription, TimeLimitDropdownVisible, TimeLimitDisplayOrder,
|
yield return new LobbyOption(map, "timelimit", TimeLimitLabel, TimeLimitDescription, TimeLimitDropdownVisible, TimeLimitDisplayOrder,
|
||||||
@@ -182,7 +182,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
countdownLabel.GetText = () => null;
|
countdownLabel.GetText = () => null;
|
||||||
|
|
||||||
if (!info.SkipTimerExpiredNotification)
|
if (!info.SkipTimerExpiredNotification)
|
||||||
TextNotificationsManager.AddSystemLine(FluentProvider.GetString(TimeLimitExpired));
|
TextNotificationsManager.AddSystemLine(FluentProvider.GetMessage(TimeLimitExpired));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,9 +77,9 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
{
|
{
|
||||||
ModRules = modData.DefaultRules;
|
ModRules = modData.DefaultRules;
|
||||||
|
|
||||||
var textCache = new CachedTransform<string, string>(s => !string.IsNullOrEmpty(s) ? FluentProvider.GetString(s) : "");
|
var textCache = new CachedTransform<string, string>(s => !string.IsNullOrEmpty(s) ? FluentProvider.GetMessage(s) : "");
|
||||||
var tooltipTextCache = new CachedTransform<string, string>(s => !string.IsNullOrEmpty(s) ? FluentProvider.GetString(s) : "");
|
var tooltipTextCache = new CachedTransform<string, string>(s => !string.IsNullOrEmpty(s) ? FluentProvider.GetMessage(s) : "");
|
||||||
var tooltipDescCache = new CachedTransform<string, string>(s => !string.IsNullOrEmpty(s) ? FluentProvider.GetString(s) : "");
|
var tooltipDescCache = new CachedTransform<string, string>(s => !string.IsNullOrEmpty(s) ? FluentProvider.GetMessage(s) : "");
|
||||||
|
|
||||||
GetText = () => textCache.Update(Text);
|
GetText = () => textCache.Update(Text);
|
||||||
GetColor = () => TextColor;
|
GetColor = () => TextColor;
|
||||||
|
|||||||
@@ -35,11 +35,11 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
var cancelButton = prompt.GetOrNull<ButtonWidget>("CANCEL_BUTTON");
|
var cancelButton = prompt.GetOrNull<ButtonWidget>("CANCEL_BUTTON");
|
||||||
var otherButton = prompt.GetOrNull<ButtonWidget>("OTHER_BUTTON");
|
var otherButton = prompt.GetOrNull<ButtonWidget>("OTHER_BUTTON");
|
||||||
|
|
||||||
var titleMessage = FluentProvider.GetString(title, titleArguments);
|
var titleMessage = FluentProvider.GetMessage(title, titleArguments);
|
||||||
prompt.Get<LabelWidget>("PROMPT_TITLE").GetText = () => titleMessage;
|
prompt.Get<LabelWidget>("PROMPT_TITLE").GetText = () => titleMessage;
|
||||||
|
|
||||||
var headerTemplate = prompt.Get<LabelWidget>("PROMPT_TEXT");
|
var headerTemplate = prompt.Get<LabelWidget>("PROMPT_TEXT");
|
||||||
var textMessage = FluentProvider.GetString(text, textArguments);
|
var textMessage = FluentProvider.GetMessage(text, textArguments);
|
||||||
var headerLines = textMessage.Split('\n');
|
var headerLines = textMessage.Split('\n');
|
||||||
var headerHeight = 0;
|
var headerHeight = 0;
|
||||||
foreach (var l in headerLines)
|
foreach (var l in headerLines)
|
||||||
@@ -67,7 +67,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
|
|
||||||
if (!string.IsNullOrEmpty(confirmText))
|
if (!string.IsNullOrEmpty(confirmText))
|
||||||
{
|
{
|
||||||
var confirmTextMessage = FluentProvider.GetString(confirmText);
|
var confirmTextMessage = FluentProvider.GetMessage(confirmText);
|
||||||
confirmButton.GetText = () => confirmTextMessage;
|
confirmButton.GetText = () => confirmTextMessage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -84,7 +84,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
|
|
||||||
if (!string.IsNullOrEmpty(cancelText))
|
if (!string.IsNullOrEmpty(cancelText))
|
||||||
{
|
{
|
||||||
var cancelTextMessage = FluentProvider.GetString(cancelText);
|
var cancelTextMessage = FluentProvider.GetMessage(cancelText);
|
||||||
cancelButton.GetText = () => cancelTextMessage;
|
cancelButton.GetText = () => cancelTextMessage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -97,7 +97,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
|
|
||||||
if (!string.IsNullOrEmpty(otherText))
|
if (!string.IsNullOrEmpty(otherText))
|
||||||
{
|
{
|
||||||
var otherTextMessage = FluentProvider.GetString(otherText);
|
var otherTextMessage = FluentProvider.GetMessage(otherText);
|
||||||
otherButton.GetText = () => otherTextMessage;
|
otherButton.GetText = () => otherTextMessage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -113,10 +113,10 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
Func<bool> doValidate = null;
|
Func<bool> doValidate = null;
|
||||||
ButtonWidget acceptButton = null, cancelButton = null;
|
ButtonWidget acceptButton = null, cancelButton = null;
|
||||||
|
|
||||||
var titleMessage = FluentProvider.GetString(title);
|
var titleMessage = FluentProvider.GetMessage(title);
|
||||||
panel.Get<LabelWidget>("PROMPT_TITLE").GetText = () => titleMessage;
|
panel.Get<LabelWidget>("PROMPT_TITLE").GetText = () => titleMessage;
|
||||||
|
|
||||||
var promptMessage = FluentProvider.GetString(prompt);
|
var promptMessage = FluentProvider.GetMessage(prompt);
|
||||||
panel.Get<LabelWidget>("PROMPT_TEXT").GetText = () => promptMessage;
|
panel.Get<LabelWidget>("PROMPT_TEXT").GetText = () => promptMessage;
|
||||||
|
|
||||||
var input = panel.Get<TextFieldWidget>("INPUT_TEXT");
|
var input = panel.Get<TextFieldWidget>("INPUT_TEXT");
|
||||||
@@ -146,7 +146,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
acceptButton = panel.Get<ButtonWidget>("ACCEPT_BUTTON");
|
acceptButton = panel.Get<ButtonWidget>("ACCEPT_BUTTON");
|
||||||
if (!string.IsNullOrEmpty(acceptText))
|
if (!string.IsNullOrEmpty(acceptText))
|
||||||
{
|
{
|
||||||
var acceptTextMessage = FluentProvider.GetString(acceptText);
|
var acceptTextMessage = FluentProvider.GetMessage(acceptText);
|
||||||
acceptButton.GetText = () => acceptTextMessage;
|
acceptButton.GetText = () => acceptTextMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,7 +162,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
cancelButton = panel.Get<ButtonWidget>("CANCEL_BUTTON");
|
cancelButton = panel.Get<ButtonWidget>("CANCEL_BUTTON");
|
||||||
if (!string.IsNullOrEmpty(cancelText))
|
if (!string.IsNullOrEmpty(cancelText))
|
||||||
{
|
{
|
||||||
var cancelTextMessage = FluentProvider.GetString(cancelText);
|
var cancelTextMessage = FluentProvider.GetMessage(cancelText);
|
||||||
cancelButton.GetText = () => cancelTextMessage;
|
cancelButton.GetText = () => cancelTextMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
{
|
{
|
||||||
GetImageName = () => ImageName;
|
GetImageName = () => ImageName;
|
||||||
GetImageCollection = () => ImageCollection;
|
GetImageCollection = () => ImageCollection;
|
||||||
var tooltipCache = new CachedTransform<string, string>(s => !string.IsNullOrEmpty(s) ? FluentProvider.GetString(s) : "");
|
var tooltipCache = new CachedTransform<string, string>(s => !string.IsNullOrEmpty(s) ? FluentProvider.GetMessage(s) : "");
|
||||||
GetTooltipText = () => tooltipCache.Update(TooltipText);
|
GetTooltipText = () => tooltipCache.Update(TooltipText);
|
||||||
tooltipContainer = Exts.Lazy(() =>
|
tooltipContainer = Exts.Lazy(() =>
|
||||||
Ui.Root.Get<TooltipContainerWidget>(TooltipContainer));
|
Ui.Root.Get<TooltipContainerWidget>(TooltipContainer));
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
[ObjectCreator.UseCtor]
|
[ObjectCreator.UseCtor]
|
||||||
public LabelWidget(ModData modData)
|
public LabelWidget(ModData modData)
|
||||||
{
|
{
|
||||||
var textCache = new CachedTransform<string, string>(s => !string.IsNullOrEmpty(s) ? FluentProvider.GetString(s) : "");
|
var textCache = new CachedTransform<string, string>(s => !string.IsNullOrEmpty(s) ? FluentProvider.GetMessage(s) : "");
|
||||||
GetText = () => textCache.Update(Text);
|
GetText = () => textCache.Update(Text);
|
||||||
GetColor = () => TextColor;
|
GetColor = () => TextColor;
|
||||||
GetContrastColorDark = () => ContrastColorDark;
|
GetContrastColorDark = () => ContrastColorDark;
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
this.modData = modData;
|
this.modData = modData;
|
||||||
panel = widget;
|
panel = widget;
|
||||||
|
|
||||||
allPackages = FluentProvider.GetString(AllPackages);
|
allPackages = FluentProvider.GetMessage(AllPackages);
|
||||||
|
|
||||||
var colorPickerPalettes = world.WorldActor.TraitsImplementing<IProvidesAssetBrowserColorPickerPalettes>()
|
var colorPickerPalettes = world.WorldActor.TraitsImplementing<IProvidesAssetBrowserColorPickerPalettes>()
|
||||||
.SelectMany(p => p.ColorPickerPaletteNames)
|
.SelectMany(p => p.ColorPickerPaletteNames)
|
||||||
@@ -238,7 +238,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
if (frameText != null)
|
if (frameText != null)
|
||||||
{
|
{
|
||||||
var soundLength = new CachedTransform<double, string>(p =>
|
var soundLength = new CachedTransform<double, string>(p =>
|
||||||
FluentProvider.GetString(LengthInSeconds, "length", Math.Round(p, 3)));
|
FluentProvider.GetMessage(LengthInSeconds, "length", Math.Round(p, 3)));
|
||||||
|
|
||||||
frameText.GetText = () =>
|
frameText.GetText = () =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var nameFont = Game.Renderer.Fonts[nameLabel.Font];
|
var nameFont = Game.Renderer.Fonts[nameLabel.Font];
|
||||||
var controller = orderManager.LobbyInfo.Clients.FirstOrDefault(c => c.Index == client.BotControllerClientIndex);
|
var controller = orderManager.LobbyInfo.Clients.FirstOrDefault(c => c.Index == client.BotControllerClientIndex);
|
||||||
if (controller != null)
|
if (controller != null)
|
||||||
nameLabel.GetText = () => FluentProvider.GetString(BotManagedBy, "name", controller.Name);
|
nameLabel.GetText = () => FluentProvider.GetMessage(BotManagedBy, "name", controller.Name);
|
||||||
|
|
||||||
widget.Bounds.Width = nameFont.Measure(nameLabel.GetText()).X + 2 * nameLabel.Bounds.Left;
|
widget.Bounds.Width = nameFont.Measure(nameLabel.GetText()).X + 2 * nameLabel.Bounds.Left;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var panel = widget;
|
var panel = widget;
|
||||||
panel.Get<ButtonWidget>("ABORT_BUTTON").OnClick = () => { CloseWindow(); onAbort(); };
|
panel.Get<ButtonWidget>("ABORT_BUTTON").OnClick = () => { CloseWindow(); onAbort(); };
|
||||||
|
|
||||||
var connectingDesc = FluentProvider.GetString(ConnectingToEndpoint, "endpoint", endpoint);
|
var connectingDesc = FluentProvider.GetMessage(ConnectingToEndpoint, "endpoint", endpoint);
|
||||||
widget.Get<LabelWidget>("CONNECTING_DESC").GetText = () => connectingDesc;
|
widget.Get<LabelWidget>("CONNECTING_DESC").GetText = () => connectingDesc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,17 +130,17 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
onRetry(pass);
|
onRetry(pass);
|
||||||
};
|
};
|
||||||
|
|
||||||
var connectingDescText = FluentProvider.GetString(CouldNotConnectToTarget, "target", connection.Target);
|
var connectingDescText = FluentProvider.GetMessage(CouldNotConnectToTarget, "target", connection.Target);
|
||||||
widget.Get<LabelWidget>("CONNECTING_DESC").GetText = () => connectingDescText;
|
widget.Get<LabelWidget>("CONNECTING_DESC").GetText = () => connectingDescText;
|
||||||
|
|
||||||
var connectionError = widget.Get<LabelWidget>("CONNECTION_ERROR");
|
var connectionError = widget.Get<LabelWidget>("CONNECTION_ERROR");
|
||||||
var connectionErrorText = orderManager.ServerError != null
|
var connectionErrorText = orderManager.ServerError != null
|
||||||
? FluentProvider.GetString(orderManager.ServerError)
|
? FluentProvider.GetMessage(orderManager.ServerError)
|
||||||
: connection.ErrorMessage ?? FluentProvider.GetString(UnknownError);
|
: connection.ErrorMessage ?? FluentProvider.GetMessage(UnknownError);
|
||||||
connectionError.GetText = () => connectionErrorText;
|
connectionError.GetText = () => connectionErrorText;
|
||||||
|
|
||||||
var panelTitle = widget.Get<LabelWidget>("TITLE");
|
var panelTitle = widget.Get<LabelWidget>("TITLE");
|
||||||
var panelTitleText = orderManager.AuthenticationFailed ? FluentProvider.GetString(PasswordRequired) : FluentProvider.GetString(ConnectionFailed);
|
var panelTitleText = orderManager.AuthenticationFailed ? FluentProvider.GetMessage(PasswordRequired) : FluentProvider.GetMessage(ConnectionFailed);
|
||||||
panelTitle.GetText = () => panelTitleText;
|
panelTitle.GetText = () => panelTitleText;
|
||||||
|
|
||||||
passwordField = panel.GetOrNull<PasswordFieldWidget>("PASSWORD");
|
passwordField = panel.GetOrNull<PasswordFieldWidget>("PASSWORD");
|
||||||
|
|||||||
@@ -94,8 +94,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
actorIDErrorLabel.IsVisible = () => actorIDStatus != ActorIDStatus.Normal;
|
actorIDErrorLabel.IsVisible = () => actorIDStatus != ActorIDStatus.Normal;
|
||||||
actorIDErrorLabel.GetText = () =>
|
actorIDErrorLabel.GetText = () =>
|
||||||
actorIDStatus == ActorIDStatus.Duplicate || nextActorIDStatus == ActorIDStatus.Duplicate
|
actorIDStatus == ActorIDStatus.Duplicate || nextActorIDStatus == ActorIDStatus.Duplicate
|
||||||
? FluentProvider.GetString(DuplicateActorId)
|
? FluentProvider.GetMessage(DuplicateActorId)
|
||||||
: FluentProvider.GetString(EnterActorId);
|
: FluentProvider.GetMessage(EnterActorId);
|
||||||
|
|
||||||
okButton.IsDisabled = () => !IsValid() || editActorPreview == null || !editActorPreview.IsDirty;
|
okButton.IsDisabled = () => !IsValid() || editActorPreview == null || !editActorPreview.IsDirty;
|
||||||
okButton.OnClick = Save;
|
okButton.OnClick = Save;
|
||||||
@@ -167,7 +167,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
initialActorID = actorIDField.Text = SelectedActor.ID;
|
initialActorID = actorIDField.Text = SelectedActor.ID;
|
||||||
|
|
||||||
var font = Game.Renderer.Fonts[typeLabel.Font];
|
var font = Game.Renderer.Fonts[typeLabel.Font];
|
||||||
var truncatedType = WidgetUtils.TruncateText(FluentProvider.GetString(SelectedActor.DescriptiveName), typeLabel.Bounds.Width, font);
|
var truncatedType = WidgetUtils.TruncateText(FluentProvider.GetMessage(SelectedActor.DescriptiveName), typeLabel.Bounds.Width, font);
|
||||||
typeLabel.GetText = () => truncatedType;
|
typeLabel.GetText = () => truncatedType;
|
||||||
|
|
||||||
actorIDField.CursorPosition = SelectedActor.ID.Length;
|
actorIDField.CursorPosition = SelectedActor.ID.Length;
|
||||||
@@ -180,7 +180,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
|
|
||||||
// Add owner dropdown
|
// Add owner dropdown
|
||||||
var ownerContainer = dropdownOptionTemplate.Clone();
|
var ownerContainer = dropdownOptionTemplate.Clone();
|
||||||
var owner = FluentProvider.GetString(Owner);
|
var owner = FluentProvider.GetMessage(Owner);
|
||||||
ownerContainer.Get<LabelWidget>("LABEL").GetText = () => owner;
|
ownerContainer.Get<LabelWidget>("LABEL").GetText = () => owner;
|
||||||
var ownerDropdown = ownerContainer.Get<DropDownButtonWidget>("OPTION");
|
var ownerDropdown = ownerContainer.Get<DropDownButtonWidget>("OPTION");
|
||||||
var selectedOwner = SelectedActor.Owner;
|
var selectedOwner = SelectedActor.Owner;
|
||||||
@@ -454,7 +454,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
{
|
{
|
||||||
Actor = actor;
|
Actor = actor;
|
||||||
this.handles = handles;
|
this.handles = handles;
|
||||||
Text = FluentProvider.GetString(EditedActor, "name", actor.Info.Name, "id", actor.ID);
|
Text = FluentProvider.GetMessage(EditedActor, "name", actor.Info.Name, "id", actor.ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Execute()
|
public void Execute()
|
||||||
@@ -466,7 +466,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
|
|
||||||
var after = Actor;
|
var after = Actor;
|
||||||
if (before != after)
|
if (before != after)
|
||||||
Text = FluentProvider.GetString(EditedActorId, "name", after.Info.Name, "old-id", before.ID, "new-id", after.ID);
|
Text = FluentProvider.GetMessage(EditedActorId, "name", after.Info.Name, "old-id", before.ID, "new-id", after.ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Do()
|
public void Do()
|
||||||
|
|||||||
@@ -112,12 +112,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var tooltip = a.TraitInfos<EditorOnlyTooltipInfo>().FirstOrDefault(ti => ti.EnabledByDefault) as TooltipInfoBase
|
var tooltip = a.TraitInfos<EditorOnlyTooltipInfo>().FirstOrDefault(ti => ti.EnabledByDefault) as TooltipInfoBase
|
||||||
?? a.TraitInfos<TooltipInfo>().FirstOrDefault(ti => ti.EnabledByDefault);
|
?? a.TraitInfos<TooltipInfo>().FirstOrDefault(ti => ti.EnabledByDefault);
|
||||||
|
|
||||||
var actorType = FluentProvider.GetString(ActorTypeTooltip, "actorType", a.Name);
|
var actorType = FluentProvider.GetMessage(ActorTypeTooltip, "actorType", a.Name);
|
||||||
|
|
||||||
var searchTerms = new List<string>() { a.Name };
|
var searchTerms = new List<string>() { a.Name };
|
||||||
if (tooltip != null)
|
if (tooltip != null)
|
||||||
{
|
{
|
||||||
var actorName = FluentProvider.GetString(tooltip.Name);
|
var actorName = FluentProvider.GetMessage(tooltip.Name);
|
||||||
searchTerms.Add(actorName);
|
searchTerms.Add(actorName);
|
||||||
allActorsTemp.Add(new ActorSelectorActor(a, editorData.Categories, searchTerms.ToArray(), actorName + $"\n{actorType}"));
|
allActorsTemp.Add(new ActorSelectorActor(a, editorData.Categories, searchTerms.ToArray(), actorName + $"\n{actorType}"));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,10 +73,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
|
|
||||||
Editor.DefaultBrush.SelectionChanged += HandleSelectionChanged;
|
Editor.DefaultBrush.SelectionChanged += HandleSelectionChanged;
|
||||||
|
|
||||||
var none = FluentProvider.GetString(None);
|
var none = FluentProvider.GetMessage(None);
|
||||||
var searchResults = FluentProvider.GetString(SearchResults);
|
var searchResults = FluentProvider.GetMessage(SearchResults);
|
||||||
var all = FluentProvider.GetString(All);
|
var all = FluentProvider.GetMessage(All);
|
||||||
var multiple = FluentProvider.GetString(Multiple);
|
var multiple = FluentProvider.GetMessage(Multiple);
|
||||||
|
|
||||||
var categorySelector = widget.Get<DropDownButtonWidget>("CATEGORIES_DROPDOWN");
|
var categorySelector = widget.Get<DropDownButtonWidget>("CATEGORIES_DROPDOWN");
|
||||||
categorySelector.GetText = () =>
|
categorySelector.GetText = () =>
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var resourceValueInRegion = editorResourceLayer.CalculateRegionValue(selectedRegion);
|
var resourceValueInRegion = editorResourceLayer.CalculateRegionValue(selectedRegion);
|
||||||
|
|
||||||
var areaSelectionLabel =
|
var areaSelectionLabel =
|
||||||
$"{FluentProvider.GetString(AreaSelection)} ({DimensionsAsString(selectionSize)}) " +
|
$"{FluentProvider.GetMessage(AreaSelection)} ({DimensionsAsString(selectionSize)}) " +
|
||||||
$"{PositionAsString(selectedRegion.TopLeft)} : {PositionAsString(selectedRegion.BottomRight)}";
|
$"{PositionAsString(selectedRegion.TopLeft)} : {PositionAsString(selectedRegion.BottomRight)}";
|
||||||
|
|
||||||
AreaEditTitle.GetText = () => areaSelectionLabel;
|
AreaEditTitle.GetText = () => areaSelectionLabel;
|
||||||
|
|||||||
@@ -130,11 +130,11 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
switch (markerLayerTrait.MirrorMode)
|
switch (markerLayerTrait.MirrorMode)
|
||||||
{
|
{
|
||||||
case MarkerTileMirrorMode.None:
|
case MarkerTileMirrorMode.None:
|
||||||
return FluentProvider.GetString(MarkerMirrorModeNone);
|
return FluentProvider.GetMessage(MarkerMirrorModeNone);
|
||||||
case MarkerTileMirrorMode.Flip:
|
case MarkerTileMirrorMode.Flip:
|
||||||
return FluentProvider.GetString(MarkerMirrorModeFlip);
|
return FluentProvider.GetMessage(MarkerMirrorModeFlip);
|
||||||
case MarkerTileMirrorMode.Rotate:
|
case MarkerTileMirrorMode.Rotate:
|
||||||
return FluentProvider.GetString(MarkerMirrorModeRotate);
|
return FluentProvider.GetMessage(MarkerMirrorModeRotate);
|
||||||
default:
|
default:
|
||||||
throw new ArgumentException($"Couldn't find fluent string for marker tile mirror mode '{markerLayerTrait.MirrorMode}'");
|
throw new ArgumentException($"Couldn't find fluent string for marker tile mirror mode '{markerLayerTrait.MirrorMode}'");
|
||||||
}
|
}
|
||||||
@@ -221,11 +221,11 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
case MarkerTileMirrorMode.None:
|
case MarkerTileMirrorMode.None:
|
||||||
return FluentProvider.GetString(MarkerMirrorModeNone);
|
return FluentProvider.GetMessage(MarkerMirrorModeNone);
|
||||||
case MarkerTileMirrorMode.Flip:
|
case MarkerTileMirrorMode.Flip:
|
||||||
return FluentProvider.GetString(MarkerMirrorModeFlip);
|
return FluentProvider.GetMessage(MarkerMirrorModeFlip);
|
||||||
case MarkerTileMirrorMode.Rotate:
|
case MarkerTileMirrorMode.Rotate:
|
||||||
return FluentProvider.GetString(MarkerMirrorModeRotate);
|
return FluentProvider.GetMessage(MarkerMirrorModeRotate);
|
||||||
default:
|
default:
|
||||||
throw new ArgumentException($"Couldn't find fluent string for marker tile mirror mode '{mode}'");
|
throw new ArgumentException($"Couldn't find fluent string for marker tile mirror mode '{mode}'");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
toolPanels.Add(MapTool.MarkerTiles, markerToolPanel);
|
toolPanels.Add(MapTool.MarkerTiles, markerToolPanel);
|
||||||
|
|
||||||
toolsDropdown.OnMouseDown = _ => ShowToolsDropDown(toolsDropdown);
|
toolsDropdown.OnMouseDown = _ => ShowToolsDropDown(toolsDropdown);
|
||||||
toolsDropdown.GetText = () => FluentProvider.GetString(toolNames[selectedTool]);
|
toolsDropdown.GetText = () => FluentProvider.GetMessage(toolNames[selectedTool]);
|
||||||
toolsDropdown.Disabled = true; // TODO: Enable if new tools are added
|
toolsDropdown.Disabled = true; // TODO: Enable if new tools are added
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
() => selectedTool == tool,
|
() => selectedTool == tool,
|
||||||
() => SelectTool(tool));
|
() => SelectTool(tool));
|
||||||
|
|
||||||
item.Get<LabelWidget>("LABEL").GetText = () => FluentProvider.GetString(toolNames[tool]);
|
item.Get<LabelWidget>("LABEL").GetText = () => FluentProvider.GetMessage(toolNames[tool]);
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var fileTypes = new Dictionary<MapFileType, MapFileTypeInfo>()
|
var fileTypes = new Dictionary<MapFileType, MapFileTypeInfo>()
|
||||||
{
|
{
|
||||||
{ MapFileType.OraMap, new MapFileTypeInfo { Extension = ".oramap", UiLabel = ".oramap" } },
|
{ MapFileType.OraMap, new MapFileTypeInfo { Extension = ".oramap", UiLabel = ".oramap" } },
|
||||||
{ MapFileType.Unpacked, new MapFileTypeInfo { Extension = "", UiLabel = $"({FluentProvider.GetString(Unpacked)})" } }
|
{ MapFileType.Unpacked, new MapFileTypeInfo { Extension = "", UiLabel = $"({FluentProvider.GetMessage(Unpacked)})" } }
|
||||||
};
|
};
|
||||||
|
|
||||||
var typeDropdown = widget.Get<DropDownButtonWidget>("TYPE_DROPDOWN");
|
var typeDropdown = widget.Get<DropDownButtonWidget>("TYPE_DROPDOWN");
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var label = item.Get<LabelWithTooltipWidget>("TITLE");
|
var label = item.Get<LabelWithTooltipWidget>("TITLE");
|
||||||
var name = actor.TraitInfos<TooltipInfo>().FirstOrDefault(info => info.EnabledByDefault)?.Name;
|
var name = actor.TraitInfos<TooltipInfo>().FirstOrDefault(info => info.EnabledByDefault)?.Name;
|
||||||
if (!string.IsNullOrEmpty(name))
|
if (!string.IsNullOrEmpty(name))
|
||||||
WidgetUtils.TruncateLabelToTooltip(label, FluentProvider.GetString(name));
|
WidgetUtils.TruncateLabelToTooltip(label, FluentProvider.GetMessage(name));
|
||||||
|
|
||||||
if (firstItem == null)
|
if (firstItem == null)
|
||||||
{
|
{
|
||||||
@@ -159,7 +159,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
|
|
||||||
var info = actor.TraitInfoOrDefault<EncyclopediaInfo>();
|
var info = actor.TraitInfoOrDefault<EncyclopediaInfo>();
|
||||||
if (info != null && !string.IsNullOrEmpty(info.Description))
|
if (info != null && !string.IsNullOrEmpty(info.Description))
|
||||||
text += WidgetUtils.WrapText(FluentProvider.GetString(info.Description) + "\n\n", descriptionLabel.Bounds.Width, descriptionFont);
|
text += WidgetUtils.WrapText(FluentProvider.GetMessage(info.Description) + "\n\n", descriptionLabel.Bounds.Width, descriptionFont);
|
||||||
|
|
||||||
var height = descriptionFont.Measure(text).Y;
|
var height = descriptionFont.Measure(text).Y;
|
||||||
descriptionLabel.GetText = () => text;
|
descriptionLabel.GetText = () => text;
|
||||||
@@ -175,7 +175,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
{
|
{
|
||||||
var actorTooltip = actor.TraitInfos<TooltipInfo>().FirstOrDefault(info => info.EnabledByDefault);
|
var actorTooltip = actor.TraitInfos<TooltipInfo>().FirstOrDefault(info => info.EnabledByDefault);
|
||||||
if (actorTooltip != null)
|
if (actorTooltip != null)
|
||||||
return FluentProvider.GetString(actorTooltip.Name);
|
return FluentProvider.GetMessage(actorTooltip.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
return name;
|
return name;
|
||||||
|
|||||||
@@ -293,7 +293,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
TextNotificationsManager.Debug(FluentProvider.GetString(SaveDeletionFailed, "savePath", savePath));
|
TextNotificationsManager.Debug(FluentProvider.GetMessage(SaveDeletionFailed, "savePath", savePath));
|
||||||
Log.Write("debug", ex.ToString());
|
Log.Write("debug", ex.ToString());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,13 +38,13 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
var tooltip = armyUnit.TooltipInfo;
|
var tooltip = armyUnit.TooltipInfo;
|
||||||
var name = tooltip != null ? FluentProvider.GetString(tooltip.Name) : armyUnit.ActorInfo.Name;
|
var name = tooltip != null ? FluentProvider.GetMessage(tooltip.Name) : armyUnit.ActorInfo.Name;
|
||||||
var buildable = armyUnit.BuildableInfo;
|
var buildable = armyUnit.BuildableInfo;
|
||||||
|
|
||||||
nameLabel.GetText = () => name;
|
nameLabel.GetText = () => name;
|
||||||
var nameSize = font.Measure(name);
|
var nameSize = font.Measure(name);
|
||||||
|
|
||||||
var desc = string.IsNullOrEmpty(buildable.Description) ? "" : FluentProvider.GetString(buildable.Description);
|
var desc = string.IsNullOrEmpty(buildable.Description) ? "" : FluentProvider.GetMessage(buildable.Description);
|
||||||
descLabel.GetText = () => desc;
|
descLabel.GetText = () => desc;
|
||||||
var descSize = descFont.Measure(desc);
|
var descSize = descFont.Measure(desc);
|
||||||
descLabel.Bounds.Width = descSize.X;
|
descLabel.Bounds.Width = descSize.X;
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
|
|
||||||
if (tabButton != null)
|
if (tabButton != null)
|
||||||
{
|
{
|
||||||
var tabButtonText = FluentProvider.GetString(label);
|
var tabButtonText = FluentProvider.GetMessage(label);
|
||||||
tabButton.GetText = () => tabButtonText;
|
tabButton.GetText = () => tabButtonText;
|
||||||
tabButton.OnClick = () =>
|
tabButton.OnClick = () =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -51,9 +51,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
}
|
}
|
||||||
|
|
||||||
var missionStatus = widget.Get<LabelWidget>("MISSION_STATUS");
|
var missionStatus = widget.Get<LabelWidget>("MISSION_STATUS");
|
||||||
var inProgress = FluentProvider.GetString(InProgress);
|
var inProgress = FluentProvider.GetMessage(InProgress);
|
||||||
var accomplished = FluentProvider.GetString(Accomplished);
|
var accomplished = FluentProvider.GetMessage(Accomplished);
|
||||||
var failed = FluentProvider.GetString(Failed);
|
var failed = FluentProvider.GetMessage(Failed);
|
||||||
missionStatus.GetText = () => player.WinState == WinState.Undefined ? inProgress :
|
missionStatus.GetText = () => player.WinState == WinState.Undefined ? inProgress :
|
||||||
player.WinState == WinState.Won ? accomplished : failed;
|
player.WinState == WinState.Won ? accomplished : failed;
|
||||||
missionStatus.GetColor = () => player.WinState == WinState.Undefined ? Color.White :
|
missionStatus.GetColor = () => player.WinState == WinState.Undefined ? Color.White :
|
||||||
|
|||||||
@@ -108,9 +108,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
checkbox.GetText = () => mo.Objectives[0].Description;
|
checkbox.GetText = () => mo.Objectives[0].Description;
|
||||||
}
|
}
|
||||||
|
|
||||||
var failed = FluentProvider.GetString(Failed);
|
var failed = FluentProvider.GetMessage(Failed);
|
||||||
var inProgress = FluentProvider.GetString(InProgress);
|
var inProgress = FluentProvider.GetMessage(InProgress);
|
||||||
var accomplished = FluentProvider.GetString(Accomplished);
|
var accomplished = FluentProvider.GetMessage(Accomplished);
|
||||||
statusLabel.GetText = () => player.WinState == WinState.Won ? accomplished :
|
statusLabel.GetText = () => player.WinState == WinState.Won ? accomplished :
|
||||||
player.WinState == WinState.Lost ? failed : inProgress;
|
player.WinState == WinState.Lost ? failed : inProgress;
|
||||||
statusLabel.GetColor = () => player.WinState == WinState.Won ? Color.LimeGreen :
|
statusLabel.GetColor = () => player.WinState == WinState.Won ? Color.LimeGreen :
|
||||||
@@ -133,10 +133,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var teamTemplate = playerPanel.Get<ScrollItemWidget>("TEAM_TEMPLATE");
|
var teamTemplate = playerPanel.Get<ScrollItemWidget>("TEAM_TEMPLATE");
|
||||||
var playerTemplate = playerPanel.Get("PLAYER_TEMPLATE");
|
var playerTemplate = playerPanel.Get("PLAYER_TEMPLATE");
|
||||||
var spectatorTemplate = playerPanel.Get("SPECTATOR_TEMPLATE");
|
var spectatorTemplate = playerPanel.Get("SPECTATOR_TEMPLATE");
|
||||||
var unmuteTooltip = FluentProvider.GetString(Unmute);
|
var unmuteTooltip = FluentProvider.GetMessage(Unmute);
|
||||||
var muteTooltip = FluentProvider.GetString(Mute);
|
var muteTooltip = FluentProvider.GetMessage(Mute);
|
||||||
var kickTooltip = FluentProvider.GetString(KickTooltip);
|
var kickTooltip = FluentProvider.GetMessage(KickTooltip);
|
||||||
var voteKickTooltip = FluentProvider.GetString(KickVoteTooltip);
|
var voteKickTooltip = FluentProvider.GetMessage(KickVoteTooltip);
|
||||||
playerPanel.RemoveChildren();
|
playerPanel.RemoveChildren();
|
||||||
|
|
||||||
var teams = world.Players.Where(p => !p.NonCombatant && p.Playable)
|
var teams = world.Players.Where(p => !p.NonCombatant && p.Playable)
|
||||||
@@ -227,8 +227,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
{
|
{
|
||||||
var teamHeader = ScrollItemWidget.Setup(teamTemplate, () => false, () => { });
|
var teamHeader = ScrollItemWidget.Setup(teamTemplate, () => false, () => { });
|
||||||
var team = t.Key > 0
|
var team = t.Key > 0
|
||||||
? FluentProvider.GetString(TeamNumber, "team", t.Key)
|
? FluentProvider.GetMessage(TeamNumber, "team", t.Key)
|
||||||
: FluentProvider.GetString(NoTeam);
|
: FluentProvider.GetMessage(NoTeam);
|
||||||
teamHeader.Get<LabelWidget>("TEAM").GetText = () => team;
|
teamHeader.Get<LabelWidget>("TEAM").GetText = () => team;
|
||||||
var teamRating = teamHeader.Get<LabelWidget>("TEAM_SCORE");
|
var teamRating = teamHeader.Get<LabelWidget>("TEAM_SCORE");
|
||||||
var scoreCache = new CachedTransform<int, string>(s => s.ToString(NumberFormatInfo.CurrentInfo));
|
var scoreCache = new CachedTransform<int, string>(s => s.ToString(NumberFormatInfo.CurrentInfo));
|
||||||
@@ -257,13 +257,13 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
{
|
{
|
||||||
flag.GetImageName = () => pp.Faction.InternalName;
|
flag.GetImageName = () => pp.Faction.InternalName;
|
||||||
factionName = pp.Faction.Name != factionName
|
factionName = pp.Faction.Name != factionName
|
||||||
? $"{FluentProvider.GetString(factionName)} ({FluentProvider.GetString(pp.Faction.Name)})"
|
? $"{FluentProvider.GetMessage(factionName)} ({FluentProvider.GetMessage(pp.Faction.Name)})"
|
||||||
: FluentProvider.GetString(pp.Faction.Name);
|
: FluentProvider.GetMessage(pp.Faction.Name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
flag.GetImageName = () => pp.DisplayFaction.InternalName;
|
flag.GetImageName = () => pp.DisplayFaction.InternalName;
|
||||||
factionName = FluentProvider.GetString(factionName);
|
factionName = FluentProvider.GetMessage(factionName);
|
||||||
}
|
}
|
||||||
|
|
||||||
WidgetUtils.TruncateLabelToTooltip(item.Get<LabelWithTooltipWidget>("FACTION"), factionName);
|
WidgetUtils.TruncateLabelToTooltip(item.Get<LabelWithTooltipWidget>("FACTION"), factionName);
|
||||||
@@ -291,7 +291,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
if (spectators.Count > 0)
|
if (spectators.Count > 0)
|
||||||
{
|
{
|
||||||
var spectatorHeader = ScrollItemWidget.Setup(teamTemplate, () => false, () => { });
|
var spectatorHeader = ScrollItemWidget.Setup(teamTemplate, () => false, () => { });
|
||||||
var spectatorTeam = FluentProvider.GetString(Spectators);
|
var spectatorTeam = FluentProvider.GetMessage(Spectators);
|
||||||
spectatorHeader.Get<LabelWidget>("TEAM").GetText = () => spectatorTeam;
|
spectatorHeader.Get<LabelWidget>("TEAM").GetText = () => spectatorTeam;
|
||||||
|
|
||||||
playerPanel.AddChild(spectatorHeader);
|
playerPanel.AddChild(spectatorHeader);
|
||||||
@@ -310,7 +310,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
|
|
||||||
nameLabel.GetText = () =>
|
nameLabel.GetText = () =>
|
||||||
{
|
{
|
||||||
var suffix = client.State == Session.ClientState.Disconnected ? $" ({FluentProvider.GetString(Gone)})" : "";
|
var suffix = client.State == Session.ClientState.Disconnected ? $" ({FluentProvider.GetMessage(Gone)})" : "";
|
||||||
return name.Update((client.Name, suffix));
|
return name.Update((client.Name, suffix));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -44,10 +44,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
|
|
||||||
bool Paused() => world.Paused || world.ReplayTimestep == 0;
|
bool Paused() => world.Paused || world.ReplayTimestep == 0;
|
||||||
|
|
||||||
var pausedText = FluentProvider.GetString(GameTimerLogic.Paused);
|
var pausedText = FluentProvider.GetMessage(GameTimerLogic.Paused);
|
||||||
var maxSpeedText = FluentProvider.GetString(MaxSpeed);
|
var maxSpeedText = FluentProvider.GetMessage(MaxSpeed);
|
||||||
var speedText = new CachedTransform<int, string>(p =>
|
var speedText = new CachedTransform<int, string>(p =>
|
||||||
FluentProvider.GetString(Speed, "percentage", p));
|
FluentProvider.GetMessage(Speed, "percentage", p));
|
||||||
|
|
||||||
if (timer != null)
|
if (timer != null)
|
||||||
{
|
{
|
||||||
@@ -79,7 +79,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
}
|
}
|
||||||
|
|
||||||
var timerText = new CachedTransform<int, string>(p =>
|
var timerText = new CachedTransform<int, string>(p =>
|
||||||
FluentProvider.GetString(Complete, "percentage", p));
|
FluentProvider.GetMessage(Complete, "percentage", p));
|
||||||
if (timer is LabelWithTooltipWidget timerTooltip)
|
if (timer is LabelWithTooltipWidget timerTooltip)
|
||||||
{
|
{
|
||||||
var connection = orderManager.Connection as ReplayConnection;
|
var connection = orderManager.Connection as ReplayConnection;
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
displayResources = playerResources.GetCashAndResources();
|
displayResources = playerResources.GetCashAndResources();
|
||||||
|
|
||||||
siloUsageTooltipCache = new CachedTransform<(int Resources, int Capacity), string>(x =>
|
siloUsageTooltipCache = new CachedTransform<(int Resources, int Capacity), string>(x =>
|
||||||
FluentProvider.GetString(SiloUsage, "usage", x.Resources, "capacity", x.Capacity));
|
FluentProvider.GetMessage(SiloUsage, "usage", x.Resources, "capacity", x.Capacity));
|
||||||
cashLabel = widget.Get<LabelWithTooltipWidget>("CASH");
|
cashLabel = widget.Get<LabelWithTooltipWidget>("CASH");
|
||||||
cashLabel.GetTooltipText = () => siloUsageTooltip;
|
cashLabel.GetTooltipText = () => siloUsageTooltip;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,10 +70,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var disableTeamChat = alwaysDisabled || (world.LocalPlayer != null && !players.Any(p => p.IsAlliedWith(world.LocalPlayer)));
|
var disableTeamChat = alwaysDisabled || (world.LocalPlayer != null && !players.Any(p => p.IsAlliedWith(world.LocalPlayer)));
|
||||||
var teamChat = !disableTeamChat;
|
var teamChat = !disableTeamChat;
|
||||||
|
|
||||||
var teamMessage = FluentProvider.GetString(TeamChat);
|
var teamMessage = FluentProvider.GetMessage(TeamChat);
|
||||||
var allMessage = FluentProvider.GetString(GeneralChat);
|
var allMessage = FluentProvider.GetMessage(GeneralChat);
|
||||||
|
|
||||||
chatDisabled = FluentProvider.GetString(ChatDisabled);
|
chatDisabled = FluentProvider.GetMessage(ChatDisabled);
|
||||||
|
|
||||||
// Only execute this once, the first time this widget is loaded
|
// Only execute this once, the first time this widget is loaded
|
||||||
if (TextNotificationsManager.MutedPlayers.Count == 0)
|
if (TextNotificationsManager.MutedPlayers.Count == 0)
|
||||||
@@ -194,7 +194,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
chatAvailableIn = new CachedTransform<int, string>(x => FluentProvider.GetString(ChatAvailability, "seconds", x));
|
chatAvailableIn = new CachedTransform<int, string>(x => FluentProvider.GetMessage(ChatAvailability, "seconds", x));
|
||||||
|
|
||||||
if (!isMenuChat)
|
if (!isMenuChat)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -305,7 +305,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
|
|
||||||
button.Id = id;
|
button.Id = id;
|
||||||
button.IsDisabled = () => leaving;
|
button.IsDisabled = () => leaving;
|
||||||
var text = FluentProvider.GetString(label);
|
var text = FluentProvider.GetMessage(label);
|
||||||
button.GetText = () => text;
|
button.GetText = () => text;
|
||||||
buttonContainer.AddChild(button);
|
buttonContainer.AddChild(button);
|
||||||
buttons.Add(button);
|
buttons.Add(button);
|
||||||
@@ -319,8 +319,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
var button = AddButton("ABORT_MISSION", world.IsGameOver
|
var button = AddButton("ABORT_MISSION", world.IsGameOver
|
||||||
? FluentProvider.GetString(Leave)
|
? FluentProvider.GetMessage(Leave)
|
||||||
: FluentProvider.GetString(AbortMission));
|
: FluentProvider.GetMessage(AbortMission));
|
||||||
|
|
||||||
button.OnClick = () =>
|
button.OnClick = () =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -36,10 +36,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
powerBar.TooltipTextCached = new CachedTransform<(float Current, float Capacity), string>(usage =>
|
powerBar.TooltipTextCached = new CachedTransform<(float Current, float Capacity), string>(usage =>
|
||||||
{
|
{
|
||||||
var capacity = developerMode.UnlimitedPower ?
|
var capacity = developerMode.UnlimitedPower ?
|
||||||
FluentProvider.GetString(Infinite) :
|
FluentProvider.GetMessage(Infinite) :
|
||||||
powerManager.PowerProvided.ToString(NumberFormatInfo.CurrentInfo);
|
powerManager.PowerProvided.ToString(NumberFormatInfo.CurrentInfo);
|
||||||
|
|
||||||
return FluentProvider.GetString(PowerUsage, "usage", usage.Current, "capacity", capacity);
|
return FluentProvider.GetMessage(PowerUsage, "usage", usage.Current, "capacity", capacity);
|
||||||
});
|
});
|
||||||
|
|
||||||
powerBar.GetBarColor = () =>
|
powerBar.GetBarColor = () =>
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var powerManager = world.LocalPlayer.PlayerActor.Trait<PowerManager>();
|
var powerManager = world.LocalPlayer.PlayerActor.Trait<PowerManager>();
|
||||||
var power = widget.Get<LabelWithTooltipWidget>("POWER");
|
var power = widget.Get<LabelWithTooltipWidget>("POWER");
|
||||||
var powerIcon = widget.Get<ImageWidget>("POWER_ICON");
|
var powerIcon = widget.Get<ImageWidget>("POWER_ICON");
|
||||||
var unlimitedCapacity = FluentProvider.GetString(Infinite);
|
var unlimitedCapacity = FluentProvider.GetMessage(Infinite);
|
||||||
|
|
||||||
powerIcon.GetImageName = () => powerManager.ExcessPower < 0 ? "power-critical" : "power-normal";
|
powerIcon.GetImageName = () => powerManager.ExcessPower < 0 ? "power-critical" : "power-normal";
|
||||||
power.GetColor = () => powerManager.ExcessPower < 0 ? Color.Red : Color.White;
|
power.GetColor = () => powerManager.ExcessPower < 0 ? Color.Red : Color.White;
|
||||||
@@ -41,7 +41,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var tooltipTextCached = new CachedTransform<(int, int?), string>(((int Usage, int? Capacity) args) =>
|
var tooltipTextCached = new CachedTransform<(int, int?), string>(((int Usage, int? Capacity) args) =>
|
||||||
{
|
{
|
||||||
var capacity = args.Capacity == null ? unlimitedCapacity : args.Capacity.Value.ToString(NumberFormatInfo.CurrentInfo);
|
var capacity = args.Capacity == null ? unlimitedCapacity : args.Capacity.Value.ToString(NumberFormatInfo.CurrentInfo);
|
||||||
return FluentProvider.GetString(PowerUsage,
|
return FluentProvider.GetMessage(PowerUsage,
|
||||||
"usage", args.Usage.ToString(NumberFormatInfo.CurrentInfo),
|
"usage", args.Usage.ToString(NumberFormatInfo.CurrentInfo),
|
||||||
"capacity", capacity);
|
"capacity", capacity);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
siloBar.GetProvided = () => playerResources.ResourceCapacity;
|
siloBar.GetProvided = () => playerResources.ResourceCapacity;
|
||||||
siloBar.GetUsed = () => playerResources.Resources;
|
siloBar.GetUsed = () => playerResources.Resources;
|
||||||
siloBar.TooltipTextCached = new CachedTransform<(float Current, float Capacity), string>(
|
siloBar.TooltipTextCached = new CachedTransform<(float Current, float Capacity), string>(
|
||||||
usage => FluentProvider.GetString(SiloUsage, "usage", usage.Current, "capacity", usage.Capacity));
|
usage => FluentProvider.GetMessage(SiloUsage, "usage", usage.Current, "capacity", usage.Capacity));
|
||||||
siloBar.GetBarColor = () =>
|
siloBar.GetBarColor = () =>
|
||||||
{
|
{
|
||||||
if (playerResources.Resources == playerResources.ResourceCapacity)
|
if (playerResources.Resources == playerResources.ResourceCapacity)
|
||||||
|
|||||||
@@ -104,10 +104,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
|
|
||||||
var groups = new Dictionary<string, IEnumerable<CameraOption>>();
|
var groups = new Dictionary<string, IEnumerable<CameraOption>>();
|
||||||
|
|
||||||
combined = new CameraOption(this, world, FluentProvider.GetString(CameraOptionAllPlayers), world.Players.First(p => p.InternalName == "Everyone"));
|
combined = new CameraOption(this, world, FluentProvider.GetMessage(CameraOptionAllPlayers), world.Players.First(p => p.InternalName == "Everyone"));
|
||||||
disableShroud = new CameraOption(this, world, FluentProvider.GetString(CameraOptionDisableShroud), null);
|
disableShroud = new CameraOption(this, world, FluentProvider.GetMessage(CameraOptionDisableShroud), null);
|
||||||
if (!limitViews)
|
if (!limitViews)
|
||||||
groups.Add(FluentProvider.GetString(CameraOptionOther), new List<CameraOption>() { combined, disableShroud });
|
groups.Add(FluentProvider.GetMessage(CameraOptionOther), new List<CameraOption>() { combined, disableShroud });
|
||||||
|
|
||||||
teams = world.Players.Where(p => !p.NonCombatant && p.Playable)
|
teams = world.Players.Where(p => !p.NonCombatant && p.Playable)
|
||||||
.Select(p => new CameraOption(this, p))
|
.Select(p => new CameraOption(this, p))
|
||||||
@@ -120,9 +120,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
foreach (var t in teams)
|
foreach (var t in teams)
|
||||||
{
|
{
|
||||||
totalPlayers += t.Count();
|
totalPlayers += t.Count();
|
||||||
var label = noTeams ? FluentProvider.GetString(Players) : t.Key > 0
|
var label = noTeams ? FluentProvider.GetMessage(Players) : t.Key > 0
|
||||||
? FluentProvider.GetString(TeamNumber, "team", t.Key)
|
? FluentProvider.GetMessage(TeamNumber, "team", t.Key)
|
||||||
: FluentProvider.GetString(NoTeam);
|
: FluentProvider.GetMessage(NoTeam);
|
||||||
|
|
||||||
groups.Add(label, t);
|
groups.Add(label, t);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -155,10 +155,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var statsDropDown = widget.Get<DropDownButtonWidget>("STATS_DROPDOWN");
|
var statsDropDown = widget.Get<DropDownButtonWidget>("STATS_DROPDOWN");
|
||||||
StatsDropDownOption CreateStatsOption(string title, ObserverStatsPanel panel, ScrollItemWidget template, Action a)
|
StatsDropDownOption CreateStatsOption(string title, ObserverStatsPanel panel, ScrollItemWidget template, Action a)
|
||||||
{
|
{
|
||||||
title = FluentProvider.GetString(title);
|
title = FluentProvider.GetMessage(title);
|
||||||
return new StatsDropDownOption
|
return new StatsDropDownOption
|
||||||
{
|
{
|
||||||
Title = FluentProvider.GetString(title),
|
Title = FluentProvider.GetMessage(title),
|
||||||
IsSelected = () => activePanel == panel,
|
IsSelected = () => activePanel == panel,
|
||||||
OnClick = () =>
|
OnClick = () =>
|
||||||
{
|
{
|
||||||
@@ -179,11 +179,11 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
{
|
{
|
||||||
new()
|
new()
|
||||||
{
|
{
|
||||||
Title = FluentProvider.GetString(InformationNone),
|
Title = FluentProvider.GetMessage(InformationNone),
|
||||||
IsSelected = () => activePanel == ObserverStatsPanel.None,
|
IsSelected = () => activePanel == ObserverStatsPanel.None,
|
||||||
OnClick = () =>
|
OnClick = () =>
|
||||||
{
|
{
|
||||||
var informationNone = FluentProvider.GetString(InformationNone);
|
var informationNone = FluentProvider.GetMessage(InformationNone);
|
||||||
statsDropDown.GetText = () => informationNone;
|
statsDropDown.GetText = () => informationNone;
|
||||||
playerStatsPanel.Visible = false;
|
playerStatsPanel.Visible = false;
|
||||||
ClearStats();
|
ClearStats();
|
||||||
@@ -286,8 +286,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
tt.IgnoreMouseOver = true;
|
tt.IgnoreMouseOver = true;
|
||||||
|
|
||||||
var teamLabel = tt.Get<LabelWidget>("TEAM");
|
var teamLabel = tt.Get<LabelWidget>("TEAM");
|
||||||
var teamText = team.Key > 0 ? FluentProvider.GetString(TeamNumber, "team", team.Key)
|
var teamText = team.Key > 0 ? FluentProvider.GetMessage(TeamNumber, "team", team.Key)
|
||||||
: FluentProvider.GetString(NoTeam);
|
: FluentProvider.GetMessage(NoTeam);
|
||||||
teamLabel.GetText = () => teamText;
|
teamLabel.GetText = () => teamText;
|
||||||
tt.Bounds.Width = teamLabel.Bounds.Width = Game.Renderer.Fonts[tt.Font].Measure(teamText).X;
|
tt.Bounds.Width = teamLabel.Bounds.Width = Game.Renderer.Fonts[tt.Font].Measure(teamText).X;
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
var tooltip = actor.TraitInfos<TooltipInfo>().FirstOrDefault(info => info.EnabledByDefault);
|
var tooltip = actor.TraitInfos<TooltipInfo>().FirstOrDefault(info => info.EnabledByDefault);
|
||||||
var name = tooltip != null ? FluentProvider.GetString(tooltip.Name) : actor.Name;
|
var name = tooltip != null ? FluentProvider.GetMessage(tooltip.Name) : actor.Name;
|
||||||
var buildable = actor.TraitInfo<BuildableInfo>();
|
var buildable = actor.TraitInfo<BuildableInfo>();
|
||||||
|
|
||||||
var cost = 0;
|
var cost = 0;
|
||||||
@@ -105,7 +105,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var requiresSize = int2.Zero;
|
var requiresSize = int2.Zero;
|
||||||
if (prereqs.Count > 0)
|
if (prereqs.Count > 0)
|
||||||
{
|
{
|
||||||
var requiresText = FluentProvider.GetString(Requires, "prerequisites", prereqs.JoinWith(", "));
|
var requiresText = FluentProvider.GetMessage(Requires, "prerequisites", prereqs.JoinWith(", "));
|
||||||
requiresLabel.GetText = () => requiresText;
|
requiresLabel.GetText = () => requiresText;
|
||||||
requiresSize = requiresFont.Measure(requiresText);
|
requiresSize = requiresFont.Measure(requiresText);
|
||||||
requiresLabel.Visible = true;
|
requiresLabel.Visible = true;
|
||||||
@@ -146,7 +146,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
costLabel.GetColor = () => pr.GetCashAndResources() >= cost ? Color.White : Color.Red;
|
costLabel.GetColor = () => pr.GetCashAndResources() >= cost ? Color.White : Color.Red;
|
||||||
var costSize = font.Measure(costText);
|
var costSize = font.Measure(costText);
|
||||||
|
|
||||||
var desc = string.IsNullOrEmpty(buildable.Description) ? "" : FluentProvider.GetString(buildable.Description);
|
var desc = string.IsNullOrEmpty(buildable.Description) ? "" : FluentProvider.GetMessage(buildable.Description);
|
||||||
descLabel.GetText = () => desc;
|
descLabel.GetText = () => desc;
|
||||||
var descSize = descFont.Measure(desc);
|
var descSize = descFont.Measure(desc);
|
||||||
descLabel.Bounds.Width = descSize.X;
|
descLabel.Bounds.Width = descSize.X;
|
||||||
@@ -180,7 +180,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
{
|
{
|
||||||
var actorTooltip = ai.TraitInfos<TooltipInfo>().FirstOrDefault(info => info.EnabledByDefault);
|
var actorTooltip = ai.TraitInfos<TooltipInfo>().FirstOrDefault(info => info.EnabledByDefault);
|
||||||
if (actorTooltip != null)
|
if (actorTooltip != null)
|
||||||
return FluentProvider.GetString(actorTooltip.Name);
|
return FluentProvider.GetMessage(actorTooltip.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
return a;
|
return a;
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var extraHeightOnDouble = extras.Bounds.Y;
|
var extraHeightOnDouble = extras.Bounds.Y;
|
||||||
var extraHeightOnSingle = extraHeightOnDouble - (doubleHeight - singleHeight);
|
var extraHeightOnSingle = extraHeightOnDouble - (doubleHeight - singleHeight);
|
||||||
|
|
||||||
var unrevealedTerrain = FluentProvider.GetString(UnrevealedTerrain);
|
var unrevealedTerrain = FluentProvider.GetMessage(UnrevealedTerrain);
|
||||||
|
|
||||||
tooltipContainer.BeforeRender = () =>
|
tooltipContainer.BeforeRender = () =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var status = new CachedTransform<string, string>(s => WidgetUtils.TruncateText(s, statusLabel.Bounds.Width, statusFont));
|
var status = new CachedTransform<string, string>(s => WidgetUtils.TruncateText(s, statusLabel.Bounds.Width, statusFont));
|
||||||
statusLabel.GetText = () => status.Update(getStatusText());
|
statusLabel.GetText = () => status.Update(getStatusText());
|
||||||
|
|
||||||
var text = FluentProvider.GetString(Downloading, "title", download.Title);
|
var text = FluentProvider.GetMessage(Downloading, "title", download.Title);
|
||||||
panel.Get<LabelWidget>("TITLE").GetText = () => text;
|
panel.Get<LabelWidget>("TITLE").GetText = () => text;
|
||||||
|
|
||||||
ShowDownloadDialog();
|
ShowDownloadDialog();
|
||||||
@@ -98,7 +98,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
|
|
||||||
void ShowDownloadDialog()
|
void ShowDownloadDialog()
|
||||||
{
|
{
|
||||||
getStatusText = () => FluentProvider.GetString(FetchingMirrorList);
|
getStatusText = () => FluentProvider.GetMessage(FetchingMirrorList);
|
||||||
progressBar.Indeterminate = true;
|
progressBar.Indeterminate = true;
|
||||||
|
|
||||||
var retryButton = panel.Get<ButtonWidget>("RETRY_BUTTON");
|
var retryButton = panel.Get<ButtonWidget>("RETRY_BUTTON");
|
||||||
@@ -112,7 +112,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var dataTotal = 0.0f;
|
var dataTotal = 0.0f;
|
||||||
var mag = 0;
|
var mag = 0;
|
||||||
var dataSuffix = "";
|
var dataSuffix = "";
|
||||||
var host = downloadHost ?? FluentProvider.GetString(UnknownHost);
|
var host = downloadHost ?? FluentProvider.GetMessage(UnknownHost);
|
||||||
|
|
||||||
if (total < 0)
|
if (total < 0)
|
||||||
{
|
{
|
||||||
@@ -120,7 +120,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
dataReceived = read / (float)(1L << (mag * 10));
|
dataReceived = read / (float)(1L << (mag * 10));
|
||||||
dataSuffix = SizeSuffixes[mag];
|
dataSuffix = SizeSuffixes[mag];
|
||||||
|
|
||||||
getStatusText = () => FluentProvider.GetString(DownloadingFrom,
|
getStatusText = () => FluentProvider.GetMessage(DownloadingFrom,
|
||||||
"host", host,
|
"host", host,
|
||||||
"received", $"{dataReceived:0.00}",
|
"received", $"{dataReceived:0.00}",
|
||||||
"suffix", dataSuffix);
|
"suffix", dataSuffix);
|
||||||
@@ -133,7 +133,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
dataReceived = read / (float)(1L << (mag * 10));
|
dataReceived = read / (float)(1L << (mag * 10));
|
||||||
dataSuffix = SizeSuffixes[mag];
|
dataSuffix = SizeSuffixes[mag];
|
||||||
|
|
||||||
getStatusText = () => FluentProvider.GetString(DownloadingFromProgress,
|
getStatusText = () => FluentProvider.GetMessage(DownloadingFromProgress,
|
||||||
"host", host,
|
"host", host,
|
||||||
"received", $"{dataReceived:0.00}",
|
"received", $"{dataReceived:0.00}",
|
||||||
"total", $"{dataTotal:0.00}",
|
"total", $"{dataTotal:0.00}",
|
||||||
@@ -149,7 +149,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
|
|
||||||
void OnError(string s) => Game.RunAfterTick(() =>
|
void OnError(string s) => Game.RunAfterTick(() =>
|
||||||
{
|
{
|
||||||
var host = downloadHost ?? FluentProvider.GetString(UnknownHost);
|
var host = downloadHost ?? FluentProvider.GetMessage(UnknownHost);
|
||||||
Log.Write("install", $"Download from {host} failed: " + s);
|
Log.Write("install", $"Download from {host} failed: " + s);
|
||||||
|
|
||||||
progressBar.Indeterminate = false;
|
progressBar.Indeterminate = false;
|
||||||
@@ -187,7 +187,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
|
|
||||||
if (response.StatusCode != HttpStatusCode.OK)
|
if (response.StatusCode != HttpStatusCode.OK)
|
||||||
{
|
{
|
||||||
OnError(FluentProvider.GetString(DownloadFailed));
|
OnError(FluentProvider.GetMessage(DownloadFailed));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -199,7 +199,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
// Validate integrity
|
// Validate integrity
|
||||||
if (!string.IsNullOrEmpty(download.SHA1))
|
if (!string.IsNullOrEmpty(download.SHA1))
|
||||||
{
|
{
|
||||||
getStatusText = () => FluentProvider.GetString(VerifyingArchive);
|
getStatusText = () => FluentProvider.GetMessage(VerifyingArchive);
|
||||||
progressBar.Indeterminate = true;
|
progressBar.Indeterminate = true;
|
||||||
|
|
||||||
var archiveValid = false;
|
var archiveValid = false;
|
||||||
@@ -221,13 +221,13 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
|
|
||||||
if (!archiveValid)
|
if (!archiveValid)
|
||||||
{
|
{
|
||||||
OnError(FluentProvider.GetString(ArchiveValidationFailed));
|
OnError(FluentProvider.GetMessage(ArchiveValidationFailed));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Automatically extract
|
// Automatically extract
|
||||||
getStatusText = () => FluentProvider.GetString(Extracting);
|
getStatusText = () => FluentProvider.GetMessage(Extracting);
|
||||||
progressBar.Indeterminate = true;
|
progressBar.Indeterminate = true;
|
||||||
|
|
||||||
var extracted = new List<string>();
|
var extracted = new List<string>();
|
||||||
@@ -247,7 +247,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
OnExtractProgress(FluentProvider.GetString(ExtractingEntry, "entry", kv.Value));
|
OnExtractProgress(FluentProvider.GetMessage(ExtractingEntry, "entry", kv.Value));
|
||||||
Log.Write("install", "Extracting " + kv.Value);
|
Log.Write("install", "Extracting " + kv.Value);
|
||||||
var targetPath = Platform.ResolvePath(kv.Key);
|
var targetPath = Platform.ResolvePath(kv.Key);
|
||||||
Directory.CreateDirectory(Path.GetDirectoryName(targetPath));
|
Directory.CreateDirectory(Path.GetDirectoryName(targetPath));
|
||||||
@@ -278,7 +278,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
File.Delete(f);
|
File.Delete(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
OnError(FluentProvider.GetString(ArchiveExtractionFailed));
|
OnError(FluentProvider.GetMessage(ArchiveExtractionFailed));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -311,7 +311,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
{
|
{
|
||||||
Log.Write("install", "Mirror selection failed with error:");
|
Log.Write("install", "Mirror selection failed with error:");
|
||||||
Log.Write("install", e.ToString());
|
Log.Write("install", e.ToString());
|
||||||
OnError(FluentProvider.GetString(MirrorSelectionFailed));
|
OnError(FluentProvider.GetMessage(MirrorSelectionFailed));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -161,15 +161,15 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
|
|
||||||
void DetectContentSources()
|
void DetectContentSources()
|
||||||
{
|
{
|
||||||
var message = FluentProvider.GetString(DetectingSources);
|
var message = FluentProvider.GetMessage(DetectingSources);
|
||||||
ShowProgressbar(FluentProvider.GetString(CheckingSources), () => message);
|
ShowProgressbar(FluentProvider.GetMessage(CheckingSources), () => message);
|
||||||
ShowBackRetry(DetectContentSources);
|
ShowBackRetry(DetectContentSources);
|
||||||
|
|
||||||
new Task(() =>
|
new Task(() =>
|
||||||
{
|
{
|
||||||
foreach (var kv in sources)
|
foreach (var kv in sources)
|
||||||
{
|
{
|
||||||
message = FluentProvider.GetString(SearchingSourceFor, "title", kv.Value.Title);
|
message = FluentProvider.GetMessage(SearchingSourceFor, "title", kv.Value.Title);
|
||||||
|
|
||||||
var sourceResolver = modData.ObjectCreator.CreateObject<ISourceResolver>($"{kv.Value.Type.Value}SourceResolver");
|
var sourceResolver = modData.ObjectCreator.CreateObject<ISourceResolver>($"{kv.Value.Type.Value}SourceResolver");
|
||||||
|
|
||||||
@@ -189,7 +189,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
{
|
{
|
||||||
Game.RunAfterTick(() =>
|
Game.RunAfterTick(() =>
|
||||||
{
|
{
|
||||||
ShowList(kv.Value, FluentProvider.GetString(ContentPackageInstallation));
|
ShowList(kv.Value, FluentProvider.GetMessage(ContentPackageInstallation));
|
||||||
ShowContinueCancel(() => InstallFromSource(path, kv.Value));
|
ShowContinueCancel(() => InstallFromSource(path, kv.Value));
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -221,14 +221,14 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var options = new Dictionary<string, IEnumerable<string>>();
|
var options = new Dictionary<string, IEnumerable<string>>();
|
||||||
|
|
||||||
if (gameSources.Count != 0)
|
if (gameSources.Count != 0)
|
||||||
options.Add(FluentProvider.GetString(GameSources), gameSources);
|
options.Add(FluentProvider.GetMessage(GameSources), gameSources);
|
||||||
|
|
||||||
if (digitalInstalls.Count != 0)
|
if (digitalInstalls.Count != 0)
|
||||||
options.Add(FluentProvider.GetString(DigitalInstalls), digitalInstalls);
|
options.Add(FluentProvider.GetMessage(DigitalInstalls), digitalInstalls);
|
||||||
|
|
||||||
Game.RunAfterTick(() =>
|
Game.RunAfterTick(() =>
|
||||||
{
|
{
|
||||||
ShowList(FluentProvider.GetString(GameContentNotFound), FluentProvider.GetString(AlternativeContentSources), options);
|
ShowList(FluentProvider.GetMessage(GameContentNotFound), FluentProvider.GetMessage(AlternativeContentSources), options);
|
||||||
ShowBackRetry(DetectContentSources);
|
ShowBackRetry(DetectContentSources);
|
||||||
});
|
});
|
||||||
}).Start();
|
}).Start();
|
||||||
@@ -237,7 +237,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
void InstallFromSource(string path, ModContent.ModSource modSource)
|
void InstallFromSource(string path, ModContent.ModSource modSource)
|
||||||
{
|
{
|
||||||
var message = "";
|
var message = "";
|
||||||
ShowProgressbar(FluentProvider.GetString(InstallingContent), () => message);
|
ShowProgressbar(FluentProvider.GetMessage(InstallingContent), () => message);
|
||||||
ShowDisabledCancel();
|
ShowDisabledCancel();
|
||||||
|
|
||||||
new Task(() =>
|
new Task(() =>
|
||||||
@@ -293,7 +293,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
|
|
||||||
Game.RunAfterTick(() =>
|
Game.RunAfterTick(() =>
|
||||||
{
|
{
|
||||||
ShowMessage(FluentProvider.GetString(InstallationFailed), FluentProvider.GetString(CheckInstallLog));
|
ShowMessage(FluentProvider.GetMessage(InstallationFailed), FluentProvider.GetMessage(CheckInstallLog));
|
||||||
ShowBackRetry(() => InstallFromSource(path, modSource));
|
ShowBackRetry(() => InstallFromSource(path, modSource));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -340,7 +340,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
{
|
{
|
||||||
var containerWidget = (ContainerWidget)checkboxListTemplate.Clone();
|
var containerWidget = (ContainerWidget)checkboxListTemplate.Clone();
|
||||||
var checkboxWidget = containerWidget.Get<CheckboxWidget>("PACKAGE_CHECKBOX");
|
var checkboxWidget = containerWidget.Get<CheckboxWidget>("PACKAGE_CHECKBOX");
|
||||||
var title = FluentProvider.GetString(package.Title);
|
var title = FluentProvider.GetMessage(package.Title);
|
||||||
checkboxWidget.GetText = () => title;
|
checkboxWidget.GetText = () => title;
|
||||||
checkboxWidget.IsDisabled = () => package.Required;
|
checkboxWidget.IsDisabled = () => package.Required;
|
||||||
checkboxWidget.IsChecked = () => selectedPackages[package.Identifier];
|
checkboxWidget.IsChecked = () => selectedPackages[package.Identifier];
|
||||||
@@ -400,12 +400,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
void ShowContinueCancel(Action continueAction)
|
void ShowContinueCancel(Action continueAction)
|
||||||
{
|
{
|
||||||
primaryButton.OnClick = continueAction;
|
primaryButton.OnClick = continueAction;
|
||||||
var primaryButtonText = FluentProvider.GetString(Continue);
|
var primaryButtonText = FluentProvider.GetMessage(Continue);
|
||||||
primaryButton.GetText = () => primaryButtonText;
|
primaryButton.GetText = () => primaryButtonText;
|
||||||
primaryButton.Visible = true;
|
primaryButton.Visible = true;
|
||||||
|
|
||||||
secondaryButton.OnClick = Ui.CloseWindow;
|
secondaryButton.OnClick = Ui.CloseWindow;
|
||||||
var secondaryButtonText = FluentProvider.GetString(Cancel);
|
var secondaryButtonText = FluentProvider.GetMessage(Cancel);
|
||||||
secondaryButton.GetText = () => secondaryButtonText;
|
secondaryButton.GetText = () => secondaryButtonText;
|
||||||
secondaryButton.Visible = true;
|
secondaryButton.Visible = true;
|
||||||
secondaryButton.Disabled = false;
|
secondaryButton.Disabled = false;
|
||||||
@@ -415,12 +415,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
void ShowBackRetry(Action retryAction)
|
void ShowBackRetry(Action retryAction)
|
||||||
{
|
{
|
||||||
primaryButton.OnClick = retryAction;
|
primaryButton.OnClick = retryAction;
|
||||||
var primaryButtonText = FluentProvider.GetString(Retry);
|
var primaryButtonText = FluentProvider.GetMessage(Retry);
|
||||||
primaryButton.GetText = () => primaryButtonText;
|
primaryButton.GetText = () => primaryButtonText;
|
||||||
primaryButton.Visible = true;
|
primaryButton.Visible = true;
|
||||||
|
|
||||||
secondaryButton.OnClick = Ui.CloseWindow;
|
secondaryButton.OnClick = Ui.CloseWindow;
|
||||||
var secondaryButtonText = FluentProvider.GetString(Back);
|
var secondaryButtonText = FluentProvider.GetMessage(Back);
|
||||||
secondaryButton.GetText = () => secondaryButtonText;
|
secondaryButton.GetText = () => secondaryButtonText;
|
||||||
secondaryButton.Visible = true;
|
secondaryButton.Visible = true;
|
||||||
secondaryButton.Disabled = false;
|
secondaryButton.Disabled = false;
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
{
|
{
|
||||||
var container = template.Clone();
|
var container = template.Clone();
|
||||||
var titleWidget = container.Get<LabelWidget>("TITLE");
|
var titleWidget = container.Get<LabelWidget>("TITLE");
|
||||||
var title = FluentProvider.GetString(p.Value.Title);
|
var title = FluentProvider.GetMessage(p.Value.Title);
|
||||||
titleWidget.GetText = () => title;
|
titleWidget.GetText = () => title;
|
||||||
|
|
||||||
var requiredWidget = container.Get<LabelWidget>("REQUIRED");
|
var requiredWidget = container.Get<LabelWidget>("REQUIRED");
|
||||||
@@ -158,7 +158,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
requiresSourceWidget.IsVisible = () => !installed && !downloadEnabled;
|
requiresSourceWidget.IsVisible = () => !installed && !downloadEnabled;
|
||||||
if (!isSourceAvailable)
|
if (!isSourceAvailable)
|
||||||
{
|
{
|
||||||
var manualInstall = FluentProvider.GetString(ManualInstall);
|
var manualInstall = FluentProvider.GetMessage(ManualInstall);
|
||||||
requiresSourceWidget.GetText = () => manualInstall;
|
requiresSourceWidget.GetText = () => manualInstall;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
this.content = content;
|
this.content = content;
|
||||||
CheckRequiredContentInstalled();
|
CheckRequiredContentInstalled();
|
||||||
|
|
||||||
var continueMessage = FluentProvider.GetString(Continue);
|
var continueMessage = FluentProvider.GetMessage(Continue);
|
||||||
var quitMessage = FluentProvider.GetString(Quit);
|
var quitMessage = FluentProvider.GetMessage(Quit);
|
||||||
|
|
||||||
var panel = widget.Get("CONTENT_PROMPT_PANEL");
|
var panel = widget.Get("CONTENT_PROMPT_PANEL");
|
||||||
var headerLabel = panel.Get<LabelWidget>("HEADER_LABEL");
|
var headerLabel = panel.Get<LabelWidget>("HEADER_LABEL");
|
||||||
|
|||||||
@@ -43,8 +43,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var ds = Game.Settings.Graphics;
|
var ds = Game.Settings.Graphics;
|
||||||
var gs = Game.Settings.Game;
|
var gs = Game.Settings.Game;
|
||||||
|
|
||||||
classic = FluentProvider.GetString(Classic);
|
classic = FluentProvider.GetMessage(Classic);
|
||||||
modern = FluentProvider.GetString(Modern);
|
modern = FluentProvider.GetMessage(Modern);
|
||||||
|
|
||||||
var escPressed = false;
|
var escPressed = false;
|
||||||
var nameTextfield = widget.Get<TextFieldWidget>("PLAYERNAME");
|
var nameTextfield = widget.Get<TextFieldWidget>("PLAYERNAME");
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
[ObjectCreator.UseCtor]
|
[ObjectCreator.UseCtor]
|
||||||
public KickClientLogic(Widget widget, string clientName, Action<bool> okPressed, Action cancelPressed)
|
public KickClientLogic(Widget widget, string clientName, Action<bool> okPressed, Action cancelPressed)
|
||||||
{
|
{
|
||||||
var kickMessage = FluentProvider.GetString(KickClient, "player", clientName);
|
var kickMessage = FluentProvider.GetMessage(KickClient, "player", clientName);
|
||||||
widget.Get<LabelWidget>("TITLE").GetText = () => kickMessage;
|
widget.Get<LabelWidget>("TITLE").GetText = () => kickMessage;
|
||||||
|
|
||||||
var tempBan = false;
|
var tempBan = false;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
[ObjectCreator.UseCtor]
|
[ObjectCreator.UseCtor]
|
||||||
public KickSpectatorsLogic(Widget widget, int clientCount, Action okPressed, Action cancelPressed)
|
public KickSpectatorsLogic(Widget widget, int clientCount, Action okPressed, Action cancelPressed)
|
||||||
{
|
{
|
||||||
var kickMessage = FluentProvider.GetString(KickSpectators, "count", clientCount);
|
var kickMessage = FluentProvider.GetMessage(KickSpectators, "count", clientCount);
|
||||||
widget.Get<LabelWidget>("TEXT").GetText = () => kickMessage;
|
widget.Get<LabelWidget>("TEXT").GetText = () => kickMessage;
|
||||||
|
|
||||||
widget.Get<ButtonWidget>("OK_BUTTON").OnClick = () =>
|
widget.Get<ButtonWidget>("OK_BUTTON").OnClick = () =>
|
||||||
|
|||||||
@@ -282,7 +282,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
{
|
{
|
||||||
new()
|
new()
|
||||||
{
|
{
|
||||||
Title = FluentProvider.GetString(Add),
|
Title = FluentProvider.GetMessage(Add),
|
||||||
IsSelected = () => false,
|
IsSelected = () => false,
|
||||||
OnClick = () =>
|
OnClick = () =>
|
||||||
{
|
{
|
||||||
@@ -301,7 +301,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
{
|
{
|
||||||
botOptions.Add(new DropDownOption()
|
botOptions.Add(new DropDownOption()
|
||||||
{
|
{
|
||||||
Title = FluentProvider.GetString(Remove),
|
Title = FluentProvider.GetMessage(Remove),
|
||||||
IsSelected = () => false,
|
IsSelected = () => false,
|
||||||
OnClick = () =>
|
OnClick = () =>
|
||||||
{
|
{
|
||||||
@@ -315,7 +315,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
options.Add(FluentProvider.GetString(ConfigureBots), botOptions);
|
options.Add(FluentProvider.GetMessage(ConfigureBots), botOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
var teamCount = (orderManager.LobbyInfo.Slots.Count(s => !s.Value.LockTeam && orderManager.LobbyInfo.ClientInSlot(s.Key) != null) + 1) / 2;
|
var teamCount = (orderManager.LobbyInfo.Slots.Count(s => !s.Value.LockTeam && orderManager.LobbyInfo.ClientInSlot(s.Key) != null) + 1) / 2;
|
||||||
@@ -323,7 +323,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
{
|
{
|
||||||
var teamOptions = Enumerable.Range(2, teamCount - 1).Reverse().Select(d => new DropDownOption
|
var teamOptions = Enumerable.Range(2, teamCount - 1).Reverse().Select(d => new DropDownOption
|
||||||
{
|
{
|
||||||
Title = FluentProvider.GetString(NumberTeams, "count", d),
|
Title = FluentProvider.GetMessage(NumberTeams, "count", d),
|
||||||
IsSelected = () => false,
|
IsSelected = () => false,
|
||||||
OnClick = () => orderManager.IssueOrder(Order.Command($"assignteams {d}"))
|
OnClick = () => orderManager.IssueOrder(Order.Command($"assignteams {d}"))
|
||||||
}).ToList();
|
}).ToList();
|
||||||
@@ -332,7 +332,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
{
|
{
|
||||||
teamOptions.Add(new DropDownOption
|
teamOptions.Add(new DropDownOption
|
||||||
{
|
{
|
||||||
Title = FluentProvider.GetString(HumanVsBots),
|
Title = FluentProvider.GetMessage(HumanVsBots),
|
||||||
IsSelected = () => false,
|
IsSelected = () => false,
|
||||||
OnClick = () => orderManager.IssueOrder(Order.Command("assignteams 1"))
|
OnClick = () => orderManager.IssueOrder(Order.Command("assignteams 1"))
|
||||||
});
|
});
|
||||||
@@ -340,12 +340,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
|
|
||||||
teamOptions.Add(new DropDownOption
|
teamOptions.Add(new DropDownOption
|
||||||
{
|
{
|
||||||
Title = FluentProvider.GetString(FreeForAll),
|
Title = FluentProvider.GetMessage(FreeForAll),
|
||||||
IsSelected = () => false,
|
IsSelected = () => false,
|
||||||
OnClick = () => orderManager.IssueOrder(Order.Command("assignteams 0"))
|
OnClick = () => orderManager.IssueOrder(Order.Command("assignteams 0"))
|
||||||
});
|
});
|
||||||
|
|
||||||
options.Add(FluentProvider.GetString(ConfigureTeams), teamOptions);
|
options.Add(FluentProvider.GetMessage(ConfigureTeams), teamOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
ScrollItemWidget SetupItem(DropDownOption option, ScrollItemWidget template)
|
ScrollItemWidget SetupItem(DropDownOption option, ScrollItemWidget template)
|
||||||
@@ -483,7 +483,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
|
|
||||||
if (skirmishMode)
|
if (skirmishMode)
|
||||||
{
|
{
|
||||||
var disconnectButtonText = FluentProvider.GetString(Back);
|
var disconnectButtonText = FluentProvider.GetMessage(Back);
|
||||||
disconnectButton.GetText = () => disconnectButtonText;
|
disconnectButton.GetText = () => disconnectButtonText;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -497,8 +497,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
}
|
}
|
||||||
|
|
||||||
var chatMode = lobby.Get<ButtonWidget>("CHAT_MODE");
|
var chatMode = lobby.Get<ButtonWidget>("CHAT_MODE");
|
||||||
var team = FluentProvider.GetString(TeamChat);
|
var team = FluentProvider.GetMessage(TeamChat);
|
||||||
var all = FluentProvider.GetString(GeneralChat);
|
var all = FluentProvider.GetMessage(GeneralChat);
|
||||||
chatMode.GetText = () => teamChat ? team : all;
|
chatMode.GetText = () => teamChat ? team : all;
|
||||||
chatMode.OnClick = () => teamChat ^= true;
|
chatMode.OnClick = () => teamChat ^= true;
|
||||||
chatMode.IsDisabled = () => disableTeamChat || !chatEnabled;
|
chatMode.IsDisabled = () => disableTeamChat || !chatEnabled;
|
||||||
@@ -539,8 +539,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
|
|
||||||
chatTextField.OnEscKey = _ => chatTextField.YieldKeyboardFocus();
|
chatTextField.OnEscKey = _ => chatTextField.YieldKeyboardFocus();
|
||||||
|
|
||||||
chatAvailableIn = new CachedTransform<int, string>(x => FluentProvider.GetString(ChatAvailability, "seconds", x));
|
chatAvailableIn = new CachedTransform<int, string>(x => FluentProvider.GetMessage(ChatAvailability, "seconds", x));
|
||||||
chatDisabled = FluentProvider.GetString(ChatDisabled);
|
chatDisabled = FluentProvider.GetMessage(ChatDisabled);
|
||||||
|
|
||||||
lobbyChatPanel = lobby.Get<ScrollPanelWidget>("CHAT_DISPLAY");
|
lobbyChatPanel = lobby.Get<ScrollPanelWidget>("CHAT_DISPLAY");
|
||||||
lobbyChatPanel.RemoveChildren();
|
lobbyChatPanel.RemoveChildren();
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var getOptionLabel = new CachedTransform<string, string>(id =>
|
var getOptionLabel = new CachedTransform<string, string>(id =>
|
||||||
{
|
{
|
||||||
if (id == null || !option.Values.TryGetValue(id, out var value))
|
if (id == null || !option.Values.TryGetValue(id, out var value))
|
||||||
return FluentProvider.GetString(NotAvailable);
|
return FluentProvider.GetMessage(NotAvailable);
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -56,12 +56,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
public static void ShowSlotDropDown(DropDownButtonWidget dropdown, Session.Slot slot,
|
public static void ShowSlotDropDown(DropDownButtonWidget dropdown, Session.Slot slot,
|
||||||
Session.Client client, OrderManager orderManager, MapPreview map, ModData modData)
|
Session.Client client, OrderManager orderManager, MapPreview map, ModData modData)
|
||||||
{
|
{
|
||||||
var open = FluentProvider.GetString(Open);
|
var open = FluentProvider.GetMessage(Open);
|
||||||
var closed = FluentProvider.GetString(Closed);
|
var closed = FluentProvider.GetMessage(Closed);
|
||||||
var options = new Dictionary<string, IEnumerable<SlotDropDownOption>>
|
var options = new Dictionary<string, IEnumerable<SlotDropDownOption>>
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
FluentProvider.GetString(Slot), new List<SlotDropDownOption>
|
FluentProvider.GetMessage(Slot), new List<SlotDropDownOption>
|
||||||
{
|
{
|
||||||
new(open, "slot_open " + slot.PlayerReference, () => !slot.Closed && client == null),
|
new(open, "slot_open " + slot.PlayerReference, () => !slot.Closed && client == null),
|
||||||
new(closed, "slot_close " + slot.PlayerReference, () => slot.Closed)
|
new(closed, "slot_close " + slot.PlayerReference, () => slot.Closed)
|
||||||
@@ -75,13 +75,13 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
foreach (var b in map.PlayerActorInfo.TraitInfos<IBotInfo>())
|
foreach (var b in map.PlayerActorInfo.TraitInfos<IBotInfo>())
|
||||||
{
|
{
|
||||||
var botController = orderManager.LobbyInfo.Clients.FirstOrDefault(c => c.IsAdmin);
|
var botController = orderManager.LobbyInfo.Clients.FirstOrDefault(c => c.IsAdmin);
|
||||||
bots.Add(new SlotDropDownOption(FluentProvider.GetString(b.Name),
|
bots.Add(new SlotDropDownOption(FluentProvider.GetMessage(b.Name),
|
||||||
$"slot_bot {slot.PlayerReference} {botController.Index} {b.Type}",
|
$"slot_bot {slot.PlayerReference} {botController.Index} {b.Type}",
|
||||||
() => client != null && client.Bot == b.Type));
|
() => client != null && client.Bot == b.Type));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
options.Add(bots.Count > 0 ? FluentProvider.GetString(Bots) : FluentProvider.GetString(BotsDisabled), bots);
|
options.Add(bots.Count > 0 ? FluentProvider.GetMessage(Bots) : FluentProvider.GetMessage(BotsDisabled), bots);
|
||||||
|
|
||||||
ScrollItemWidget SetupItem(SlotDropDownOption o, ScrollItemWidget itemTemplate)
|
ScrollItemWidget SetupItem(SlotDropDownOption o, ScrollItemWidget itemTemplate)
|
||||||
{
|
{
|
||||||
@@ -222,14 +222,14 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var faction = factions[factionId];
|
var faction = factions[factionId];
|
||||||
|
|
||||||
var label = item.Get<LabelWidget>("LABEL");
|
var label = item.Get<LabelWidget>("LABEL");
|
||||||
var labelText = WidgetUtils.TruncateText(FluentProvider.GetString(faction.Name), label.Bounds.Width, Game.Renderer.Fonts[label.Font]);
|
var labelText = WidgetUtils.TruncateText(FluentProvider.GetMessage(faction.Name), label.Bounds.Width, Game.Renderer.Fonts[label.Font]);
|
||||||
label.GetText = () => labelText;
|
label.GetText = () => labelText;
|
||||||
|
|
||||||
var flag = item.Get<ImageWidget>("FLAG");
|
var flag = item.Get<ImageWidget>("FLAG");
|
||||||
flag.GetImageCollection = () => "flags";
|
flag.GetImageCollection = () => "flags";
|
||||||
flag.GetImageName = () => factionId;
|
flag.GetImageName = () => factionId;
|
||||||
|
|
||||||
var description = faction.Description != null ? FluentProvider.GetString(faction.Description) : null;
|
var description = faction.Description != null ? FluentProvider.GetMessage(faction.Description) : null;
|
||||||
var (text, desc) = SplitOnFirstToken(description);
|
var (text, desc) = SplitOnFirstToken(description);
|
||||||
item.GetTooltipText = () => text;
|
item.GetTooltipText = () => text;
|
||||||
item.GetTooltipDesc = () => desc;
|
item.GetTooltipDesc = () => desc;
|
||||||
@@ -238,7 +238,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
}
|
}
|
||||||
|
|
||||||
var options = factions.Where(f => f.Value.Selectable).GroupBy(f => f.Value.Side)
|
var options = factions.Where(f => f.Value.Selectable).GroupBy(f => f.Value.Side)
|
||||||
.ToDictionary(g => g.Key != null ? FluentProvider.GetString(g.Key) : "", g => g.Select(f => FluentProvider.GetString(f.Key)));
|
.ToDictionary(g => g.Key != null ? FluentProvider.GetMessage(g.Key) : "", g => g.Select(f => FluentProvider.GetMessage(f.Key)));
|
||||||
|
|
||||||
dropdown.ShowDropDown("FACTION_DROPDOWN_TEMPLATE", 154, options, SetupItem);
|
dropdown.ShowDropDown("FACTION_DROPDOWN_TEMPLATE", 154, options, SetupItem);
|
||||||
}
|
}
|
||||||
@@ -430,7 +430,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var label = parent.Get<LabelWidget>("NAME");
|
var label = parent.Get<LabelWidget>("NAME");
|
||||||
label.IsVisible = () => true;
|
label.IsVisible = () => true;
|
||||||
var font = Game.Renderer.Fonts[label.Font];
|
var font = Game.Renderer.Fonts[label.Font];
|
||||||
var name = c.IsBot ? FluentProvider.GetString(c.Name) : c.Name;
|
var name = c.IsBot ? FluentProvider.GetMessage(c.Name) : c.Name;
|
||||||
var text = WidgetUtils.TruncateText(name, label.Bounds.Width, font);
|
var text = WidgetUtils.TruncateText(name, label.Bounds.Width, font);
|
||||||
label.GetText = () => text;
|
label.GetText = () => text;
|
||||||
|
|
||||||
@@ -448,10 +448,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
WidgetUtils.TruncateText(name, slot.Bounds.Width - slot.Bounds.Height - slot.LeftMargin - slot.RightMargin,
|
WidgetUtils.TruncateText(name, slot.Bounds.Width - slot.Bounds.Height - slot.LeftMargin - slot.RightMargin,
|
||||||
Game.Renderer.Fonts[slot.Font]));
|
Game.Renderer.Fonts[slot.Font]));
|
||||||
|
|
||||||
var closed = FluentProvider.GetString(Closed);
|
var closed = FluentProvider.GetMessage(Closed);
|
||||||
var open = FluentProvider.GetString(Open);
|
var open = FluentProvider.GetMessage(Open);
|
||||||
slot.GetText = () => truncated.Update(c != null ?
|
slot.GetText = () => truncated.Update(c != null ?
|
||||||
c.IsBot ? FluentProvider.GetString(c.Name) : c.Name
|
c.IsBot ? FluentProvider.GetMessage(c.Name) : c.Name
|
||||||
: s.Closed ? closed : open);
|
: s.Closed ? closed : open);
|
||||||
|
|
||||||
slot.OnMouseDown = _ => ShowSlotDropDown(slot, s, c, orderManager, map, modData);
|
slot.OnMouseDown = _ => ShowSlotDropDown(slot, s, c, orderManager, map, modData);
|
||||||
@@ -465,8 +465,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var name = parent.Get<LabelWidget>("NAME");
|
var name = parent.Get<LabelWidget>("NAME");
|
||||||
name.IsVisible = () => true;
|
name.IsVisible = () => true;
|
||||||
name.GetText = () => c != null ? c.Name : s.Closed
|
name.GetText = () => c != null ? c.Name : s.Closed
|
||||||
? FluentProvider.GetString(Closed)
|
? FluentProvider.GetMessage(Closed)
|
||||||
: FluentProvider.GetString(Open);
|
: FluentProvider.GetMessage(Open);
|
||||||
|
|
||||||
// Ensure Slot selector (if present) is hidden
|
// Ensure Slot selector (if present) is hidden
|
||||||
HideChildWidget(parent, "SLOT_OPTIONS");
|
HideChildWidget(parent, "SLOT_OPTIONS");
|
||||||
@@ -564,7 +564,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
dropdown.IsDisabled = () => s.LockFaction || orderManager.LocalClient.IsReady;
|
dropdown.IsDisabled = () => s.LockFaction || orderManager.LocalClient.IsReady;
|
||||||
dropdown.OnMouseDown = _ => ShowFactionDropDown(dropdown, c, orderManager, factions);
|
dropdown.OnMouseDown = _ => ShowFactionDropDown(dropdown, c, orderManager, factions);
|
||||||
|
|
||||||
var description = factions[c.Faction].Description != null ? FluentProvider.GetString(factions[c.Faction].Description) : null;
|
var description = factions[c.Faction].Description != null ? FluentProvider.GetMessage(factions[c.Faction].Description) : null;
|
||||||
var (text, desc) = SplitOnFirstToken(description);
|
var (text, desc) = SplitOnFirstToken(description);
|
||||||
dropdown.GetTooltipText = () => text;
|
dropdown.GetTooltipText = () => text;
|
||||||
dropdown.GetTooltipDesc = () => desc;
|
dropdown.GetTooltipDesc = () => desc;
|
||||||
@@ -577,7 +577,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var factionName = parent.Get<LabelWidget>("FACTIONNAME");
|
var factionName = parent.Get<LabelWidget>("FACTIONNAME");
|
||||||
var font = Game.Renderer.Fonts[factionName.Font];
|
var font = Game.Renderer.Fonts[factionName.Font];
|
||||||
var truncated = new CachedTransform<string, string>(clientFaction =>
|
var truncated = new CachedTransform<string, string>(clientFaction =>
|
||||||
WidgetUtils.TruncateText(FluentProvider.GetString(factions[clientFaction].Name), factionName.Bounds.Width, font));
|
WidgetUtils.TruncateText(FluentProvider.GetMessage(factions[clientFaction].Name), factionName.Bounds.Width, font));
|
||||||
factionName.GetText = () => truncated.Update(c.Faction);
|
factionName.GetText = () => truncated.Update(c.Faction);
|
||||||
|
|
||||||
var factionFlag = parent.Get<ImageWidget>("FACTIONFLAG");
|
var factionFlag = parent.Get<ImageWidget>("FACTIONFLAG");
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
}
|
}
|
||||||
|
|
||||||
var authorCache = new CachedTransform<string, string>(
|
var authorCache = new CachedTransform<string, string>(
|
||||||
text => FluentProvider.GetString(CreatedBy, "author", text));
|
text => FluentProvider.GetMessage(CreatedBy, "author", text));
|
||||||
|
|
||||||
Widget SetupAuthorAndMapType(Widget parent)
|
Widget SetupAuthorAndMapType(Widget parent)
|
||||||
{
|
{
|
||||||
@@ -165,13 +165,13 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
{
|
{
|
||||||
var (map, _) = getMap();
|
var (map, _) = getMap();
|
||||||
if (map.DownloadBytes == 0)
|
if (map.DownloadBytes == 0)
|
||||||
return FluentProvider.GetString(Connecting);
|
return FluentProvider.GetMessage(Connecting);
|
||||||
|
|
||||||
// Server does not provide the total file length.
|
// Server does not provide the total file length.
|
||||||
if (map.DownloadPercentage == 0)
|
if (map.DownloadPercentage == 0)
|
||||||
return FluentProvider.GetString(Downloading, "size", map.DownloadBytes / 1024);
|
return FluentProvider.GetMessage(Downloading, "size", map.DownloadBytes / 1024);
|
||||||
|
|
||||||
return FluentProvider.GetString(DownloadingPercentage, "size", map.DownloadBytes / 1024, "progress", map.DownloadPercentage);
|
return FluentProvider.GetMessage(DownloadingPercentage, "size", map.DownloadBytes / 1024, "progress", map.DownloadPercentage);
|
||||||
};
|
};
|
||||||
|
|
||||||
return parent;
|
return parent;
|
||||||
@@ -198,8 +198,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
modData.MapCache.QueryRemoteMapDetails(mapRepository, new[] { map.Uid });
|
modData.MapCache.QueryRemoteMapDetails(mapRepository, new[] { map.Uid });
|
||||||
};
|
};
|
||||||
|
|
||||||
var retryInstall = FluentProvider.GetString(RetryInstall);
|
var retryInstall = FluentProvider.GetMessage(RetryInstall);
|
||||||
var retrySearch = FluentProvider.GetString(RetrySearch);
|
var retrySearch = FluentProvider.GetMessage(RetrySearch);
|
||||||
retryButton.GetText = () => getMap().Map.Status == MapStatus.DownloadError ? retryInstall : retrySearch;
|
retryButton.GetText = () => getMap().Map.Status == MapStatus.DownloadError ? retryInstall : retrySearch;
|
||||||
|
|
||||||
var previewLarge = SetupMapPreview(widget.Get("MAP_LARGE"));
|
var previewLarge = SetupMapPreview(widget.Get("MAP_LARGE"));
|
||||||
|
|||||||
@@ -49,9 +49,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var labelText = "";
|
var labelText = "";
|
||||||
string playerFaction = null;
|
string playerFaction = null;
|
||||||
var playerTeam = -1;
|
var playerTeam = -1;
|
||||||
teamMessage = new CachedTransform<int, string>(t => FluentProvider.GetString(TeamNumber, "team", t));
|
teamMessage = new CachedTransform<int, string>(t => FluentProvider.GetMessage(TeamNumber, "team", t));
|
||||||
var disabledSpawn = FluentProvider.GetString(DisabledSpawn);
|
var disabledSpawn = FluentProvider.GetMessage(DisabledSpawn);
|
||||||
var availableSpawn = FluentProvider.GetString(AvailableSpawn);
|
var availableSpawn = FluentProvider.GetMessage(AvailableSpawn);
|
||||||
|
|
||||||
tooltipContainer.BeforeRender = () =>
|
tooltipContainer.BeforeRender = () =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -232,7 +232,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
newsPanel.RemoveChild(newsTemplate);
|
newsPanel.RemoveChild(newsTemplate);
|
||||||
|
|
||||||
newsStatus = newsPanel.Get<LabelWidget>("NEWS_STATUS");
|
newsStatus = newsPanel.Get<LabelWidget>("NEWS_STATUS");
|
||||||
SetNewsStatus(FluentProvider.GetString(LoadingNews));
|
SetNewsStatus(FluentProvider.GetMessage(LoadingNews));
|
||||||
}
|
}
|
||||||
|
|
||||||
Game.OnRemoteDirectConnect += OnRemoteDirectConnect;
|
Game.OnRemoteDirectConnect += OnRemoteDirectConnect;
|
||||||
@@ -334,7 +334,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Game.RunAfterTick(() => // run on the main thread
|
Game.RunAfterTick(() => // run on the main thread
|
||||||
SetNewsStatus(FluentProvider.GetString(NewsRetrivalFailed, "message", e.Message)));
|
SetNewsStatus(FluentProvider.GetMessage(NewsRetrivalFailed, "message", e.Message)));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -405,7 +405,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
SetNewsStatus(FluentProvider.GetString(NewsParsingFailed, "message", ex.Message));
|
SetNewsStatus(FluentProvider.GetMessage(NewsParsingFailed, "message", ex.Message));
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
@@ -426,7 +426,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
titleLabel.GetText = () => item.Title;
|
titleLabel.GetText = () => item.Title;
|
||||||
|
|
||||||
var authorDateTimeLabel = newsItem.Get<LabelWidget>("AUTHOR_DATETIME");
|
var authorDateTimeLabel = newsItem.Get<LabelWidget>("AUTHOR_DATETIME");
|
||||||
var authorDateTime = FluentProvider.GetString(AuthorDateTime,
|
var authorDateTime = FluentProvider.GetMessage(AuthorDateTime,
|
||||||
"author", item.Author,
|
"author", item.Author,
|
||||||
"datetime", item.DateTime.ToLocalTime().ToString(CultureInfo.CurrentCulture));
|
"datetime", item.DateTime.ToLocalTime().ToString(CultureInfo.CurrentCulture));
|
||||||
|
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
this.onSelect = onSelect;
|
this.onSelect = onSelect;
|
||||||
this.remoteMapPool = remoteMapPool;
|
this.remoteMapPool = remoteMapPool;
|
||||||
|
|
||||||
allMaps = FluentProvider.GetString(AllMaps);
|
allMaps = FluentProvider.GetMessage(AllMaps);
|
||||||
|
|
||||||
var approving = new Action(() =>
|
var approving = new Action(() =>
|
||||||
{
|
{
|
||||||
@@ -205,9 +205,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var remoteMapText = new CachedTransform<(int Searching, int Unavailable), string>(counts =>
|
var remoteMapText = new CachedTransform<(int Searching, int Unavailable), string>(counts =>
|
||||||
{
|
{
|
||||||
if (counts.Searching > 0)
|
if (counts.Searching > 0)
|
||||||
return FluentProvider.GetString(MapSearchingCount, "count", counts.Searching);
|
return FluentProvider.GetMessage(MapSearchingCount, "count", counts.Searching);
|
||||||
|
|
||||||
return FluentProvider.GetString(MapUnavailableCount, "count", counts.Unavailable);
|
return FluentProvider.GetMessage(MapUnavailableCount, "count", counts.Unavailable);
|
||||||
});
|
});
|
||||||
|
|
||||||
remoteMapLabel.IsVisible = () => remoteMapPool != null && (remoteSearching > 0 || remoteUnavailable > 0);
|
remoteMapLabel.IsVisible = () => remoteMapPool != null && (remoteSearching > 0 || remoteUnavailable > 0);
|
||||||
@@ -359,7 +359,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
{
|
{
|
||||||
var item = categories.FirstOrDefault(m => m.Category == category);
|
var item = categories.FirstOrDefault(m => m.Category == category);
|
||||||
if (item == default((string, int)))
|
if (item == default((string, int)))
|
||||||
item.Category = FluentProvider.GetString(NoMatches);
|
item.Category = FluentProvider.GetMessage(NoMatches);
|
||||||
|
|
||||||
return ShowItem(item);
|
return ShowItem(item);
|
||||||
};
|
};
|
||||||
@@ -372,14 +372,14 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
if (orderByDropdown == null)
|
if (orderByDropdown == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var orderByPlayer = FluentProvider.GetString(OrderMapsByPlayers);
|
var orderByPlayer = FluentProvider.GetMessage(OrderMapsByPlayers);
|
||||||
|
|
||||||
var orderByDict = new Dictionary<string, Func<MapPreview, long>>()
|
var orderByDict = new Dictionary<string, Func<MapPreview, long>>()
|
||||||
{
|
{
|
||||||
{ orderByPlayer, m => m.PlayerCount },
|
{ orderByPlayer, m => m.PlayerCount },
|
||||||
{ FluentProvider.GetString(OrderMapsByTitle), null },
|
{ FluentProvider.GetMessage(OrderMapsByTitle), null },
|
||||||
{ FluentProvider.GetString(OrderMapsByDate), m => -m.ModifiedDate.Ticks },
|
{ FluentProvider.GetMessage(OrderMapsByDate), m => -m.ModifiedDate.Ticks },
|
||||||
{ FluentProvider.GetString(OrderMapsBySize), m => m.Bounds.Width * m.Bounds.Height },
|
{ FluentProvider.GetMessage(OrderMapsBySize), m => m.Bounds.Width * m.Bounds.Height },
|
||||||
};
|
};
|
||||||
|
|
||||||
orderByFunc = orderByDict[orderByPlayer];
|
orderByFunc = orderByDict[orderByPlayer];
|
||||||
@@ -458,23 +458,23 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
if (type != null)
|
if (type != null)
|
||||||
details = type + " ";
|
details = type + " ";
|
||||||
|
|
||||||
details += FluentProvider.GetString(Players, "players", preview.PlayerCount);
|
details += FluentProvider.GetMessage(Players, "players", preview.PlayerCount);
|
||||||
detailsWidget.GetText = () => details;
|
detailsWidget.GetText = () => details;
|
||||||
}
|
}
|
||||||
|
|
||||||
var authorWidget = item.GetOrNull<LabelWithTooltipWidget>("AUTHOR");
|
var authorWidget = item.GetOrNull<LabelWithTooltipWidget>("AUTHOR");
|
||||||
if (authorWidget != null && !string.IsNullOrEmpty(preview.Author))
|
if (authorWidget != null && !string.IsNullOrEmpty(preview.Author))
|
||||||
WidgetUtils.TruncateLabelToTooltip(authorWidget, FluentProvider.GetString(CreatedBy, "author", preview.Author));
|
WidgetUtils.TruncateLabelToTooltip(authorWidget, FluentProvider.GetMessage(CreatedBy, "author", preview.Author));
|
||||||
|
|
||||||
var sizeWidget = item.GetOrNull<LabelWidget>("SIZE");
|
var sizeWidget = item.GetOrNull<LabelWidget>("SIZE");
|
||||||
if (sizeWidget != null)
|
if (sizeWidget != null)
|
||||||
{
|
{
|
||||||
var size = preview.Bounds.Width + "x" + preview.Bounds.Height;
|
var size = preview.Bounds.Width + "x" + preview.Bounds.Height;
|
||||||
var numberPlayableCells = preview.Bounds.Width * preview.Bounds.Height;
|
var numberPlayableCells = preview.Bounds.Width * preview.Bounds.Height;
|
||||||
if (numberPlayableCells >= 120 * 120) size += " " + FluentProvider.GetString(MapSizeHuge);
|
if (numberPlayableCells >= 120 * 120) size += " " + FluentProvider.GetMessage(MapSizeHuge);
|
||||||
else if (numberPlayableCells >= 90 * 90) size += " " + FluentProvider.GetString(MapSizeLarge);
|
else if (numberPlayableCells >= 90 * 90) size += " " + FluentProvider.GetMessage(MapSizeLarge);
|
||||||
else if (numberPlayableCells >= 60 * 60) size += " " + FluentProvider.GetString(MapSizeMedium);
|
else if (numberPlayableCells >= 60 * 60) size += " " + FluentProvider.GetMessage(MapSizeMedium);
|
||||||
else size += " " + FluentProvider.GetString(MapSizeSmall);
|
else size += " " + FluentProvider.GetMessage(MapSizeSmall);
|
||||||
sizeWidget.GetText = () => size;
|
sizeWidget.GetText = () => size;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -502,7 +502,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
TextNotificationsManager.Debug(FluentProvider.GetString(MapDeletionFailed, "map", map));
|
TextNotificationsManager.Debug(FluentProvider.GetMessage(MapDeletionFailed, "map", map));
|
||||||
Log.Write("debug", ex.ToString());
|
Log.Write("debug", ex.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -385,7 +385,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
if (option.Values.TryGetValue(missionOptions[option.Id], out var value))
|
if (option.Values.TryGetValue(missionOptions[option.Id], out var value))
|
||||||
return value;
|
return value;
|
||||||
|
|
||||||
return FluentProvider.GetString(NotAvailable);
|
return FluentProvider.GetMessage(NotAvailable);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (option.Description != null)
|
if (option.Description != null)
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
panel.Get<LabelWidget>("MUTE_LABEL").GetText = () =>
|
panel.Get<LabelWidget>("MUTE_LABEL").GetText = () =>
|
||||||
{
|
{
|
||||||
if (Game.Settings.Sound.Mute)
|
if (Game.Settings.Sound.Mute)
|
||||||
return FluentProvider.GetString(SoundMuted);
|
return FluentProvider.GetMessage(SoundMuted);
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
};
|
};
|
||||||
@@ -101,7 +101,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
return $"{minutes:D2}:{seconds:D2} / {totalMinutes:D2}:{totalSeconds:D2}";
|
return $"{minutes:D2}:{seconds:D2} / {totalMinutes:D2}:{totalSeconds:D2}";
|
||||||
};
|
};
|
||||||
|
|
||||||
var noSongPlaying = FluentProvider.GetString(NoSongPlaying);
|
var noSongPlaying = FluentProvider.GetMessage(NoSongPlaying);
|
||||||
var musicTitle = panel.GetOrNull<LabelWidget>("TITLE_LABEL");
|
var musicTitle = panel.GetOrNull<LabelWidget>("TITLE_LABEL");
|
||||||
if (musicTitle != null)
|
if (musicTitle != null)
|
||||||
musicTitle.GetText = () => currentSong != null ? currentSong.Title : noSongPlaying;
|
musicTitle.GetText = () => currentSong != null ? currentSong.Title : noSongPlaying;
|
||||||
|
|||||||
@@ -35,12 +35,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
if (Game.Settings.Sound.Mute)
|
if (Game.Settings.Sound.Mute)
|
||||||
{
|
{
|
||||||
Game.Sound.MuteAudio();
|
Game.Sound.MuteAudio();
|
||||||
TextNotificationsManager.AddFeedbackLine(FluentProvider.GetString(AudioMuted));
|
TextNotificationsManager.AddFeedbackLine(FluentProvider.GetMessage(AudioMuted));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Game.Sound.UnmuteAudio();
|
Game.Sound.UnmuteAudio();
|
||||||
TextNotificationsManager.AddFeedbackLine(FluentProvider.GetString(AudioUnmuted));
|
TextNotificationsManager.AddFeedbackLine(FluentProvider.GetMessage(AudioUnmuted));
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
|
|
||||||
var profileWidth = 0;
|
var profileWidth = 0;
|
||||||
var maxProfileWidth = widget.Bounds.Width;
|
var maxProfileWidth = widget.Bounds.Width;
|
||||||
var messageText = FluentProvider.GetString(LoadingPlayerProfile);
|
var messageText = FluentProvider.GetMessage(LoadingPlayerProfile);
|
||||||
var messageWidth = messageFont.Measure(messageText).X + 2 * message.Bounds.Left;
|
var messageWidth = messageFont.Measure(messageText).X + 2 * message.Bounds.Left;
|
||||||
|
|
||||||
Task.Run(async () =>
|
Task.Run(async () =>
|
||||||
@@ -140,7 +140,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
{
|
{
|
||||||
if (profile == null)
|
if (profile == null)
|
||||||
{
|
{
|
||||||
messageText = FluentProvider.GetString(LoadingPlayerProfileFailed);
|
messageText = FluentProvider.GetMessage(LoadingPlayerProfileFailed);
|
||||||
messageWidth = messageFont.Measure(messageText).X + 2 * message.Bounds.Left;
|
messageWidth = messageFont.Measure(messageText).X + 2 * message.Bounds.Left;
|
||||||
header.Bounds.Width = widget.Bounds.Width = messageWidth;
|
header.Bounds.Width = widget.Bounds.Width = messageWidth;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
});
|
});
|
||||||
|
|
||||||
var replayDuration = new CachedTransform<ReplayMetadata, string>(r =>
|
var replayDuration = new CachedTransform<ReplayMetadata, string>(r =>
|
||||||
FluentProvider.GetString(Duration, "time", WidgetUtils.FormatTimeSeconds((int)selectedReplay.GameInfo.Duration.TotalSeconds)));
|
FluentProvider.GetMessage(Duration, "time", WidgetUtils.FormatTimeSeconds((int)selectedReplay.GameInfo.Duration.TotalSeconds)));
|
||||||
panel.Get<LabelWidget>("DURATION").GetText = () => replayDuration.Update(selectedReplay);
|
panel.Get<LabelWidget>("DURATION").GetText = () => replayDuration.Update(selectedReplay);
|
||||||
|
|
||||||
SetupFilters();
|
SetupFilters();
|
||||||
@@ -234,8 +234,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var options = new List<(GameType GameType, string Text)>
|
var options = new List<(GameType GameType, string Text)>
|
||||||
{
|
{
|
||||||
(GameType.Any, ddb.GetText()),
|
(GameType.Any, ddb.GetText()),
|
||||||
(GameType.Singleplayer, FluentProvider.GetString(Singleplayer)),
|
(GameType.Singleplayer, FluentProvider.GetMessage(Singleplayer)),
|
||||||
(GameType.Multiplayer, FluentProvider.GetString(Multiplayer))
|
(GameType.Multiplayer, FluentProvider.GetMessage(Multiplayer))
|
||||||
};
|
};
|
||||||
|
|
||||||
var lookup = options.ToDictionary(kvp => kvp.GameType, kvp => kvp.Text);
|
var lookup = options.ToDictionary(kvp => kvp.GameType, kvp => kvp.Text);
|
||||||
@@ -267,10 +267,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var options = new List<(DateType DateType, string Text)>
|
var options = new List<(DateType DateType, string Text)>
|
||||||
{
|
{
|
||||||
(DateType.Any, ddb.GetText()),
|
(DateType.Any, ddb.GetText()),
|
||||||
(DateType.Today, FluentProvider.GetString(Today)),
|
(DateType.Today, FluentProvider.GetMessage(Today)),
|
||||||
(DateType.LastWeek, FluentProvider.GetString(LastWeek)),
|
(DateType.LastWeek, FluentProvider.GetMessage(LastWeek)),
|
||||||
(DateType.LastFortnight, FluentProvider.GetString(LastFortnight)),
|
(DateType.LastFortnight, FluentProvider.GetMessage(LastFortnight)),
|
||||||
(DateType.LastMonth, FluentProvider.GetString(LastMonth))
|
(DateType.LastMonth, FluentProvider.GetMessage(LastMonth))
|
||||||
};
|
};
|
||||||
|
|
||||||
var lookup = options.ToDictionary(kvp => kvp.DateType, kvp => kvp.Text);
|
var lookup = options.ToDictionary(kvp => kvp.DateType, kvp => kvp.Text);
|
||||||
@@ -303,10 +303,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var options = new List<(DurationType DurationType, string Text)>
|
var options = new List<(DurationType DurationType, string Text)>
|
||||||
{
|
{
|
||||||
(DurationType.Any, ddb.GetText()),
|
(DurationType.Any, ddb.GetText()),
|
||||||
(DurationType.VeryShort, FluentProvider.GetString(ReplayDurationVeryShort)),
|
(DurationType.VeryShort, FluentProvider.GetMessage(ReplayDurationVeryShort)),
|
||||||
(DurationType.Short, FluentProvider.GetString(ReplayDurationShort)),
|
(DurationType.Short, FluentProvider.GetMessage(ReplayDurationShort)),
|
||||||
(DurationType.Medium, FluentProvider.GetString(ReplayDurationMedium)),
|
(DurationType.Medium, FluentProvider.GetMessage(ReplayDurationMedium)),
|
||||||
(DurationType.Long, FluentProvider.GetString(ReplayDurationLong))
|
(DurationType.Long, FluentProvider.GetMessage(ReplayDurationLong))
|
||||||
};
|
};
|
||||||
|
|
||||||
var lookup = options.ToDictionary(kvp => kvp.DurationType, kvp => kvp.Text);
|
var lookup = options.ToDictionary(kvp => kvp.DurationType, kvp => kvp.Text);
|
||||||
@@ -340,8 +340,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var options = new List<(WinState WinState, string Text)>
|
var options = new List<(WinState WinState, string Text)>
|
||||||
{
|
{
|
||||||
(WinState.Undefined, ddb.GetText()),
|
(WinState.Undefined, ddb.GetText()),
|
||||||
(WinState.Lost, FluentProvider.GetString(Defeat)),
|
(WinState.Lost, FluentProvider.GetMessage(Defeat)),
|
||||||
(WinState.Won, FluentProvider.GetString(Victory))
|
(WinState.Won, FluentProvider.GetMessage(Victory))
|
||||||
};
|
};
|
||||||
|
|
||||||
var lookup = options.ToDictionary(kvp => kvp.WinState, kvp => kvp.Text);
|
var lookup = options.ToDictionary(kvp => kvp.WinState, kvp => kvp.Text);
|
||||||
@@ -446,7 +446,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
options.Insert(0, null); // no filter
|
options.Insert(0, null); // no filter
|
||||||
|
|
||||||
var anyText = ddb.GetText();
|
var anyText = ddb.GetText();
|
||||||
ddb.GetText = () => string.IsNullOrEmpty(filter.Faction) ? anyText : FluentProvider.GetString(filter.Faction);
|
ddb.GetText = () => string.IsNullOrEmpty(filter.Faction) ? anyText : FluentProvider.GetMessage(filter.Faction);
|
||||||
ddb.OnMouseDown = _ =>
|
ddb.OnMouseDown = _ =>
|
||||||
{
|
{
|
||||||
ScrollItemWidget SetupItem(string option, ScrollItemWidget tpl)
|
ScrollItemWidget SetupItem(string option, ScrollItemWidget tpl)
|
||||||
@@ -455,7 +455,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
tpl,
|
tpl,
|
||||||
() => string.Equals(filter.Faction, option, StringComparison.CurrentCultureIgnoreCase),
|
() => string.Equals(filter.Faction, option, StringComparison.CurrentCultureIgnoreCase),
|
||||||
() => { filter.Faction = option; ApplyFilter(); });
|
() => { filter.Faction = option; ApplyFilter(); });
|
||||||
item.Get<LabelWidget>("LABEL").GetText = () => option != null ? FluentProvider.GetString(option) : anyText;
|
item.Get<LabelWidget>("LABEL").GetText = () => option != null ? FluentProvider.GetMessage(option) : anyText;
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -584,7 +584,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
TextNotificationsManager.Debug(FluentProvider.GetString(ReplayDeletionFailed, "file", replay.FilePath));
|
TextNotificationsManager.Debug(FluentProvider.GetMessage(ReplayDeletionFailed, "file", replay.FilePath));
|
||||||
Log.Write("debug", ex.ToString());
|
Log.Write("debug", ex.ToString());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -724,9 +724,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var noTeams = players.Count == 1;
|
var noTeams = players.Count == 1;
|
||||||
foreach (var p in players)
|
foreach (var p in players)
|
||||||
{
|
{
|
||||||
var label = noTeams ? FluentProvider.GetString(Players) : p.Key > 0
|
var label = noTeams ? FluentProvider.GetMessage(Players) : p.Key > 0
|
||||||
? FluentProvider.GetString(TeamNumber, "team", p.Key)
|
? FluentProvider.GetMessage(TeamNumber, "team", p.Key)
|
||||||
: FluentProvider.GetString(NoTeam);
|
: FluentProvider.GetMessage(NoTeam);
|
||||||
|
|
||||||
teams.Add(label, p);
|
teams.Add(label, p);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -170,15 +170,15 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
|
|
||||||
if (advertiseOnline)
|
if (advertiseOnline)
|
||||||
{
|
{
|
||||||
var noticesLabelAText = FluentProvider.GetString(InternetServerNatA) + " ";
|
var noticesLabelAText = FluentProvider.GetMessage(InternetServerNatA) + " ";
|
||||||
noticesLabelA.GetText = () => noticesLabelAText;
|
noticesLabelA.GetText = () => noticesLabelAText;
|
||||||
var aWidth = Game.Renderer.Fonts[noticesLabelA.Font].Measure(noticesLabelAText).X;
|
var aWidth = Game.Renderer.Fonts[noticesLabelA.Font].Measure(noticesLabelAText).X;
|
||||||
noticesLabelA.Bounds.Width = aWidth;
|
noticesLabelA.Bounds.Width = aWidth;
|
||||||
|
|
||||||
var noticesLabelBText =
|
var noticesLabelBText =
|
||||||
Nat.Status == NatStatus.Enabled ? FluentProvider.GetString(InternetServerNatBenabled) :
|
Nat.Status == NatStatus.Enabled ? FluentProvider.GetMessage(InternetServerNatBenabled) :
|
||||||
Nat.Status == NatStatus.NotSupported ? FluentProvider.GetString(InternetServerNatBnotSupported) :
|
Nat.Status == NatStatus.NotSupported ? FluentProvider.GetMessage(InternetServerNatBnotSupported) :
|
||||||
FluentProvider.GetString(InternetServerNatBdisabled);
|
FluentProvider.GetMessage(InternetServerNatBdisabled);
|
||||||
noticesLabelB.GetText = () => noticesLabelBText;
|
noticesLabelB.GetText = () => noticesLabelBText;
|
||||||
|
|
||||||
noticesLabelB.TextColor =
|
noticesLabelB.TextColor =
|
||||||
@@ -191,14 +191,14 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
noticesLabelB.Bounds.Width = bWidth;
|
noticesLabelB.Bounds.Width = bWidth;
|
||||||
noticesLabelB.Visible = true;
|
noticesLabelB.Visible = true;
|
||||||
|
|
||||||
var noticesLabelCText = FluentProvider.GetString(InternetServerNatC);
|
var noticesLabelCText = FluentProvider.GetMessage(InternetServerNatC);
|
||||||
noticesLabelC.GetText = () => noticesLabelCText;
|
noticesLabelC.GetText = () => noticesLabelCText;
|
||||||
noticesLabelC.Bounds.X = noticesLabelB.Bounds.Right;
|
noticesLabelC.Bounds.X = noticesLabelB.Bounds.Right;
|
||||||
noticesLabelC.Visible = true;
|
noticesLabelC.Visible = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var noticesLabelAText = FluentProvider.GetString(LocalServer);
|
var noticesLabelAText = FluentProvider.GetMessage(LocalServer);
|
||||||
noticesLabelA.GetText = () => noticesLabelAText;
|
noticesLabelA.GetText = () => noticesLabelAText;
|
||||||
noticesLabelB.Visible = false;
|
noticesLabelB.Visible = false;
|
||||||
noticesLabelC.Visible = false;
|
noticesLabelC.Visible = false;
|
||||||
@@ -239,13 +239,13 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
}
|
}
|
||||||
catch (System.Net.Sockets.SocketException e)
|
catch (System.Net.Sockets.SocketException e)
|
||||||
{
|
{
|
||||||
var message = FluentProvider.GetString(ServerCreationFailedPrompt, "port", Game.Settings.Server.ListenPort);
|
var message = FluentProvider.GetMessage(ServerCreationFailedPrompt, "port", Game.Settings.Server.ListenPort);
|
||||||
|
|
||||||
// AddressAlreadyInUse (WSAEADDRINUSE)
|
// AddressAlreadyInUse (WSAEADDRINUSE)
|
||||||
if (e.ErrorCode == 10048)
|
if (e.ErrorCode == 10048)
|
||||||
message += "\n" + FluentProvider.GetString(ServerCreationFailedPortUsed);
|
message += "\n" + FluentProvider.GetMessage(ServerCreationFailedPortUsed);
|
||||||
else
|
else
|
||||||
message += "\n" + FluentProvider.GetString(ServerCreationFailedError, "message", e.Message, "code", e.ErrorCode);
|
message += "\n" + FluentProvider.GetMessage(ServerCreationFailedError, "message", e.Message, "code", e.ErrorCode);
|
||||||
|
|
||||||
ConfirmationDialogs.ButtonPrompt(modData, ServerCreationFailedTitle, message,
|
ConfirmationDialogs.ButtonPrompt(modData, ServerCreationFailedTitle, message,
|
||||||
onCancel: () => { }, cancelText: ServerCreationFailedCancel);
|
onCancel: () => { }, cancelText: ServerCreationFailedCancel);
|
||||||
|
|||||||
@@ -145,8 +145,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
{
|
{
|
||||||
switch (searchStatus)
|
switch (searchStatus)
|
||||||
{
|
{
|
||||||
case SearchStatus.Failed: return FluentProvider.GetString(SearchStatusFailed);
|
case SearchStatus.Failed: return FluentProvider.GetMessage(SearchStatusFailed);
|
||||||
case SearchStatus.NoGames: return FluentProvider.GetString(SearchStatusNoGames);
|
case SearchStatus.NoGames: return FluentProvider.GetMessage(SearchStatusNoGames);
|
||||||
default: return "";
|
default: return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -157,22 +157,22 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
this.modData = modData;
|
this.modData = modData;
|
||||||
this.onJoin = onJoin;
|
this.onJoin = onJoin;
|
||||||
|
|
||||||
playing = FluentProvider.GetString(Playing);
|
playing = FluentProvider.GetMessage(Playing);
|
||||||
waiting = FluentProvider.GetString(Waiting);
|
waiting = FluentProvider.GetMessage(Waiting);
|
||||||
|
|
||||||
noServerSelected = FluentProvider.GetString(NoServerSelected);
|
noServerSelected = FluentProvider.GetMessage(NoServerSelected);
|
||||||
mapStatusSearching = FluentProvider.GetString(MapStatusSearching);
|
mapStatusSearching = FluentProvider.GetMessage(MapStatusSearching);
|
||||||
mapClassificationUnknown = FluentProvider.GetString(MapClassificationUnknown);
|
mapClassificationUnknown = FluentProvider.GetMessage(MapClassificationUnknown);
|
||||||
|
|
||||||
players = new CachedTransform<int, string>(i => FluentProvider.GetString(PlayersLabel, "players", i));
|
players = new CachedTransform<int, string>(i => FluentProvider.GetMessage(PlayersLabel, "players", i));
|
||||||
bots = new CachedTransform<int, string>(i => FluentProvider.GetString(BotsLabel, "bots", i));
|
bots = new CachedTransform<int, string>(i => FluentProvider.GetMessage(BotsLabel, "bots", i));
|
||||||
spectators = new CachedTransform<int, string>(i => FluentProvider.GetString(SpectatorsLabel, "spectators", i));
|
spectators = new CachedTransform<int, string>(i => FluentProvider.GetMessage(SpectatorsLabel, "spectators", i));
|
||||||
|
|
||||||
minutes = new CachedTransform<double, string>(i => FluentProvider.GetString(InProgress, "minutes", i));
|
minutes = new CachedTransform<double, string>(i => FluentProvider.GetMessage(InProgress, "minutes", i));
|
||||||
passwordProtected = FluentProvider.GetString(PasswordProtected);
|
passwordProtected = FluentProvider.GetMessage(PasswordProtected);
|
||||||
waitingForPlayers = FluentProvider.GetString(WaitingForPlayers);
|
waitingForPlayers = FluentProvider.GetMessage(WaitingForPlayers);
|
||||||
serverShuttingDown = FluentProvider.GetString(ServerShuttingDown);
|
serverShuttingDown = FluentProvider.GetMessage(ServerShuttingDown);
|
||||||
unknownServerState = FluentProvider.GetString(UnknownServerState);
|
unknownServerState = FluentProvider.GetMessage(UnknownServerState);
|
||||||
|
|
||||||
services = modData.Manifest.Get<WebServices>();
|
services = modData.Manifest.Get<WebServices>();
|
||||||
|
|
||||||
@@ -318,7 +318,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var playersLabel = widget.GetOrNull<LabelWidget>("PLAYER_COUNT");
|
var playersLabel = widget.GetOrNull<LabelWidget>("PLAYER_COUNT");
|
||||||
if (playersLabel != null)
|
if (playersLabel != null)
|
||||||
{
|
{
|
||||||
var playersText = new CachedTransform<int, string>(p => FluentProvider.GetString(PlayersOnline, "players", p));
|
var playersText = new CachedTransform<int, string>(p => FluentProvider.GetMessage(PlayersOnline, "players", p));
|
||||||
playersLabel.IsVisible = () => playerCount != 0;
|
playersLabel.IsVisible = () => playerCount != 0;
|
||||||
playersLabel.GetText = () => playersText.Update(playerCount);
|
playersLabel.GetText = () => playersText.Update(playerCount);
|
||||||
}
|
}
|
||||||
@@ -581,14 +581,14 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var noTeams = players.Count == 1;
|
var noTeams = players.Count == 1;
|
||||||
foreach (var p in players)
|
foreach (var p in players)
|
||||||
{
|
{
|
||||||
var label = noTeams ? FluentProvider.GetString(Players) : p.Key > 0
|
var label = noTeams ? FluentProvider.GetMessage(Players) : p.Key > 0
|
||||||
? FluentProvider.GetString(TeamNumber, "team", p.Key)
|
? FluentProvider.GetMessage(TeamNumber, "team", p.Key)
|
||||||
: FluentProvider.GetString(NoTeam);
|
: FluentProvider.GetMessage(NoTeam);
|
||||||
teams.Add(label, p);
|
teams.Add(label, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (server.Clients.Any(c => c.IsSpectator))
|
if (server.Clients.Any(c => c.IsSpectator))
|
||||||
teams.Add(FluentProvider.GetString(Spectators), server.Clients.Where(c => c.IsSpectator));
|
teams.Add(FluentProvider.GetMessage(Spectators), server.Clients.Where(c => c.IsSpectator));
|
||||||
|
|
||||||
var factionInfo = modData.DefaultRules.Actors[SystemActors.World].TraitInfos<FactionInfo>();
|
var factionInfo = modData.DefaultRules.Actors[SystemActors.World].TraitInfos<FactionInfo>();
|
||||||
foreach (var kv in teams)
|
foreach (var kv in teams)
|
||||||
@@ -765,7 +765,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
if (game.Clients.Length > 10)
|
if (game.Clients.Length > 10)
|
||||||
displayClients = displayClients
|
displayClients = displayClients
|
||||||
.Take(9)
|
.Take(9)
|
||||||
.Append(FluentProvider.GetString(OtherPlayers, "players", game.Clients.Length - 9));
|
.Append(FluentProvider.GetMessage(OtherPlayers, "players", game.Clients.Length - 9));
|
||||||
|
|
||||||
var tooltip = displayClients.JoinWith("\n");
|
var tooltip = displayClients.JoinWith("\n");
|
||||||
players.GetTooltipText = () => tooltip;
|
players.GetTooltipText = () => tooltip;
|
||||||
|
|||||||
@@ -106,17 +106,17 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
this.modData = modData;
|
this.modData = modData;
|
||||||
viewportSizes = modData.Manifest.Get<WorldViewportSizes>();
|
viewportSizes = modData.Manifest.Get<WorldViewportSizes>();
|
||||||
|
|
||||||
legacyFullscreen = FluentProvider.GetString(LegacyFullscreen);
|
legacyFullscreen = FluentProvider.GetMessage(LegacyFullscreen);
|
||||||
fullscreen = FluentProvider.GetString(Fullscreen);
|
fullscreen = FluentProvider.GetMessage(Fullscreen);
|
||||||
|
|
||||||
registerPanel(panelID, label, InitPanel, ResetPanel);
|
registerPanel(panelID, label, InitPanel, ResetPanel);
|
||||||
|
|
||||||
showOnDamage = FluentProvider.GetString(ShowOnDamage);
|
showOnDamage = FluentProvider.GetMessage(ShowOnDamage);
|
||||||
alwaysShow = FluentProvider.GetString(AlwaysShow);
|
alwaysShow = FluentProvider.GetMessage(AlwaysShow);
|
||||||
|
|
||||||
automatic = FluentProvider.GetString(Automatic);
|
automatic = FluentProvider.GetMessage(Automatic);
|
||||||
manual = FluentProvider.GetString(Manual);
|
manual = FluentProvider.GetMessage(Manual);
|
||||||
disabled = FluentProvider.GetString(Disabled);
|
disabled = FluentProvider.GetMessage(Disabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetViewportSizeName(ModData modData, WorldViewport worldViewport)
|
public static string GetViewportSizeName(ModData modData, WorldViewport worldViewport)
|
||||||
@@ -124,13 +124,13 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
switch (worldViewport)
|
switch (worldViewport)
|
||||||
{
|
{
|
||||||
case WorldViewport.Close:
|
case WorldViewport.Close:
|
||||||
return FluentProvider.GetString(Close);
|
return FluentProvider.GetMessage(Close);
|
||||||
case WorldViewport.Medium:
|
case WorldViewport.Medium:
|
||||||
return FluentProvider.GetString(Medium);
|
return FluentProvider.GetMessage(Medium);
|
||||||
case WorldViewport.Far:
|
case WorldViewport.Far:
|
||||||
return FluentProvider.GetString(Far);
|
return FluentProvider.GetMessage(Far);
|
||||||
case WorldViewport.Native:
|
case WorldViewport.Native:
|
||||||
return FluentProvider.GetString(Furthest);
|
return FluentProvider.GetMessage(Furthest);
|
||||||
default:
|
default:
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
@@ -166,12 +166,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var windowModeDropdown = panel.Get<DropDownButtonWidget>("MODE_DROPDOWN");
|
var windowModeDropdown = panel.Get<DropDownButtonWidget>("MODE_DROPDOWN");
|
||||||
windowModeDropdown.OnMouseDown = _ => ShowWindowModeDropdown(windowModeDropdown, ds, scrollPanel);
|
windowModeDropdown.OnMouseDown = _ => ShowWindowModeDropdown(windowModeDropdown, ds, scrollPanel);
|
||||||
windowModeDropdown.GetText = () => ds.Mode == WindowMode.Windowed
|
windowModeDropdown.GetText = () => ds.Mode == WindowMode.Windowed
|
||||||
? FluentProvider.GetString(Windowed)
|
? FluentProvider.GetMessage(Windowed)
|
||||||
: ds.Mode == WindowMode.Fullscreen ? legacyFullscreen : fullscreen;
|
: ds.Mode == WindowMode.Fullscreen ? legacyFullscreen : fullscreen;
|
||||||
|
|
||||||
var displaySelectionDropDown = panel.Get<DropDownButtonWidget>("DISPLAY_SELECTION_DROPDOWN");
|
var displaySelectionDropDown = panel.Get<DropDownButtonWidget>("DISPLAY_SELECTION_DROPDOWN");
|
||||||
displaySelectionDropDown.OnMouseDown = _ => ShowDisplaySelectionDropdown(displaySelectionDropDown, ds);
|
displaySelectionDropDown.OnMouseDown = _ => ShowDisplaySelectionDropdown(displaySelectionDropDown, ds);
|
||||||
var displaySelectionLabel = new CachedTransform<int, string>(i => FluentProvider.GetString(Display, "number", i + 1));
|
var displaySelectionLabel = new CachedTransform<int, string>(i => FluentProvider.GetMessage(Display, "number", i + 1));
|
||||||
displaySelectionDropDown.GetText = () => displaySelectionLabel.Update(ds.VideoDisplay);
|
displaySelectionDropDown.GetText = () => displaySelectionLabel.Update(ds.VideoDisplay);
|
||||||
displaySelectionDropDown.IsDisabled = () => Game.Renderer.DisplayCount < 2;
|
displaySelectionDropDown.IsDisabled = () => Game.Renderer.DisplayCount < 2;
|
||||||
|
|
||||||
@@ -185,7 +185,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var statusBarsDropDown = panel.Get<DropDownButtonWidget>("STATUS_BAR_DROPDOWN");
|
var statusBarsDropDown = panel.Get<DropDownButtonWidget>("STATUS_BAR_DROPDOWN");
|
||||||
statusBarsDropDown.OnMouseDown = _ => ShowStatusBarsDropdown(statusBarsDropDown, gs);
|
statusBarsDropDown.OnMouseDown = _ => ShowStatusBarsDropdown(statusBarsDropDown, gs);
|
||||||
statusBarsDropDown.GetText = () => gs.StatusBars == StatusBarsType.Standard
|
statusBarsDropDown.GetText = () => gs.StatusBars == StatusBarsType.Standard
|
||||||
? FluentProvider.GetString(Standard)
|
? FluentProvider.GetMessage(Standard)
|
||||||
: gs.StatusBars == StatusBarsType.DamageShow
|
: gs.StatusBars == StatusBarsType.DamageShow
|
||||||
? showOnDamage
|
? showOnDamage
|
||||||
: alwaysShow;
|
: alwaysShow;
|
||||||
@@ -242,7 +242,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
|
|
||||||
var frameLimitGamespeedCheckbox = panel.Get<CheckboxWidget>("FRAME_LIMIT_GAMESPEED_CHECKBOX");
|
var frameLimitGamespeedCheckbox = panel.Get<CheckboxWidget>("FRAME_LIMIT_GAMESPEED_CHECKBOX");
|
||||||
var frameLimitCheckbox = panel.Get<CheckboxWidget>("FRAME_LIMIT_CHECKBOX");
|
var frameLimitCheckbox = panel.Get<CheckboxWidget>("FRAME_LIMIT_CHECKBOX");
|
||||||
var frameLimitLabel = new CachedTransform<int, string>(fps => FluentProvider.GetString(FrameLimiter, "fps", fps));
|
var frameLimitLabel = new CachedTransform<int, string>(fps => FluentProvider.GetMessage(FrameLimiter, "fps", fps));
|
||||||
frameLimitCheckbox.GetText = () => frameLimitLabel.Update(ds.MaxFramerate);
|
frameLimitCheckbox.GetText = () => frameLimitLabel.Update(ds.MaxFramerate);
|
||||||
frameLimitCheckbox.IsDisabled = () => ds.CapFramerateToGameFps;
|
frameLimitCheckbox.IsDisabled = () => ds.CapFramerateToGameFps;
|
||||||
|
|
||||||
@@ -350,9 +350,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
{
|
{
|
||||||
var options = new Dictionary<string, WindowMode>()
|
var options = new Dictionary<string, WindowMode>()
|
||||||
{
|
{
|
||||||
{ FluentProvider.GetString(Fullscreen), WindowMode.PseudoFullscreen },
|
{ FluentProvider.GetMessage(Fullscreen), WindowMode.PseudoFullscreen },
|
||||||
{ FluentProvider.GetString(LegacyFullscreen), WindowMode.Fullscreen },
|
{ FluentProvider.GetMessage(LegacyFullscreen), WindowMode.Fullscreen },
|
||||||
{ FluentProvider.GetString(Windowed), WindowMode.Windowed },
|
{ FluentProvider.GetMessage(Windowed), WindowMode.Windowed },
|
||||||
};
|
};
|
||||||
|
|
||||||
ScrollItemWidget SetupItem(string o, ScrollItemWidget itemTemplate)
|
ScrollItemWidget SetupItem(string o, ScrollItemWidget itemTemplate)
|
||||||
@@ -399,9 +399,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
{
|
{
|
||||||
var options = new Dictionary<string, StatusBarsType>()
|
var options = new Dictionary<string, StatusBarsType>()
|
||||||
{
|
{
|
||||||
{ FluentProvider.GetString(Standard), StatusBarsType.Standard },
|
{ FluentProvider.GetMessage(Standard), StatusBarsType.Standard },
|
||||||
{ FluentProvider.GetString(ShowOnDamage), StatusBarsType.DamageShow },
|
{ FluentProvider.GetMessage(ShowOnDamage), StatusBarsType.DamageShow },
|
||||||
{ FluentProvider.GetString(AlwaysShow), StatusBarsType.AlwaysShow },
|
{ FluentProvider.GetMessage(AlwaysShow), StatusBarsType.AlwaysShow },
|
||||||
};
|
};
|
||||||
|
|
||||||
ScrollItemWidget SetupItem(string o, ScrollItemWidget itemTemplate)
|
ScrollItemWidget SetupItem(string o, ScrollItemWidget itemTemplate)
|
||||||
@@ -454,9 +454,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
{
|
{
|
||||||
var options = new Dictionary<string, TargetLinesType>()
|
var options = new Dictionary<string, TargetLinesType>()
|
||||||
{
|
{
|
||||||
{ FluentProvider.GetString(Automatic), TargetLinesType.Automatic },
|
{ FluentProvider.GetMessage(Automatic), TargetLinesType.Automatic },
|
||||||
{ FluentProvider.GetString(Manual), TargetLinesType.Manual },
|
{ FluentProvider.GetMessage(Manual), TargetLinesType.Manual },
|
||||||
{ FluentProvider.GetString(Disabled), TargetLinesType.Disabled },
|
{ FluentProvider.GetMessage(Disabled), TargetLinesType.Disabled },
|
||||||
};
|
};
|
||||||
|
|
||||||
ScrollItemWidget SetupItem(string o, ScrollItemWidget itemTemplate)
|
ScrollItemWidget SetupItem(string o, ScrollItemWidget itemTemplate)
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
key.Id = hd.Name;
|
key.Id = hd.Name;
|
||||||
key.IsVisible = () => true;
|
key.IsVisible = () => true;
|
||||||
|
|
||||||
var desc = FluentProvider.GetString(hd.Description) + ":";
|
var desc = FluentProvider.GetMessage(hd.Description) + ":";
|
||||||
key.Get<LabelWidget>("FUNCTION").GetText = () => desc;
|
key.Get<LabelWidget>("FUNCTION").GetText = () => desc;
|
||||||
|
|
||||||
var remapButton = key.Get<ButtonWidget>("HOTKEY");
|
var remapButton = key.Get<ButtonWidget>("HOTKEY");
|
||||||
@@ -196,7 +196,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
var header = headerTemplate.Clone();
|
var header = headerTemplate.Clone();
|
||||||
var groupName = FluentProvider.GetString(hg.Key);
|
var groupName = FluentProvider.GetMessage(hg.Key);
|
||||||
header.Get<LabelWidget>("LABEL").GetText = () => groupName;
|
header.Get<LabelWidget>("LABEL").GetText = () => groupName;
|
||||||
hotkeyList.AddChild(header);
|
hotkeyList.AddChild(header);
|
||||||
|
|
||||||
@@ -226,7 +226,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
{
|
{
|
||||||
var label = panel.Get<LabelWidget>("HOTKEY_LABEL");
|
var label = panel.Get<LabelWidget>("HOTKEY_LABEL");
|
||||||
var labelText = new CachedTransform<HotkeyDefinition, string>(
|
var labelText = new CachedTransform<HotkeyDefinition, string>(
|
||||||
hd => (hd != null ? FluentProvider.GetString(hd.Description) : "") + ":");
|
hd => (hd != null ? FluentProvider.GetMessage(hd.Description) : "") + ":");
|
||||||
label.IsVisible = () => selectedHotkeyDefinition != null;
|
label.IsVisible = () => selectedHotkeyDefinition != null;
|
||||||
label.GetText = () => labelText.Update(selectedHotkeyDefinition);
|
label.GetText = () => labelText.Update(selectedHotkeyDefinition);
|
||||||
|
|
||||||
@@ -235,10 +235,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
duplicateNotice.IsVisible = () => !isHotkeyValid;
|
duplicateNotice.IsVisible = () => !isHotkeyValid;
|
||||||
var duplicateNoticeText = new CachedTransform<HotkeyDefinition, string>(hd =>
|
var duplicateNoticeText = new CachedTransform<HotkeyDefinition, string>(hd =>
|
||||||
hd != null
|
hd != null
|
||||||
? FluentProvider.GetString(
|
? FluentProvider.GetMessage(
|
||||||
DuplicateNotice,
|
DuplicateNotice,
|
||||||
"key", FluentProvider.GetString(hd.Description),
|
"key", FluentProvider.GetMessage(hd.Description),
|
||||||
"context", FluentProvider.GetString(hd.Contexts.First(c => selectedHotkeyDefinition.Contexts.Contains(c))))
|
"context", FluentProvider.GetMessage(hd.Contexts.First(c => selectedHotkeyDefinition.Contexts.Contains(c))))
|
||||||
: "");
|
: "");
|
||||||
duplicateNotice.GetText = () => duplicateNoticeText.Update(duplicateHotkeyDefinition);
|
duplicateNotice.GetText = () => duplicateNoticeText.Update(duplicateHotkeyDefinition);
|
||||||
|
|
||||||
@@ -246,7 +246,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
originalNotice.TextColor = ChromeMetrics.Get<Color>("NoticeInfoColor");
|
originalNotice.TextColor = ChromeMetrics.Get<Color>("NoticeInfoColor");
|
||||||
originalNotice.IsVisible = () => isHotkeyValid && !isHotkeyDefault;
|
originalNotice.IsVisible = () => isHotkeyValid && !isHotkeyDefault;
|
||||||
var originalNoticeText = new CachedTransform<HotkeyDefinition, string>(hd =>
|
var originalNoticeText = new CachedTransform<HotkeyDefinition, string>(hd =>
|
||||||
FluentProvider.GetString(OriginalNotice, "key", hd?.Default.DisplayString()));
|
FluentProvider.GetMessage(OriginalNotice, "key", hd?.Default.DisplayString()));
|
||||||
originalNotice.GetText = () => originalNoticeText.Update(selectedHotkeyDefinition);
|
originalNotice.GetText = () => originalNoticeText.Update(selectedHotkeyDefinition);
|
||||||
|
|
||||||
var readonlyNotice = panel.Get<LabelWidget>("READONLY_NOTICE");
|
var readonlyNotice = panel.Get<LabelWidget>("READONLY_NOTICE");
|
||||||
@@ -336,7 +336,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
{
|
{
|
||||||
var filter = filterInput.Text;
|
var filter = filterInput.Text;
|
||||||
var isFilteredByName = string.IsNullOrWhiteSpace(filter) ||
|
var isFilteredByName = string.IsNullOrWhiteSpace(filter) ||
|
||||||
FluentProvider.GetString(hd.Description).Contains(filter, StringComparison.CurrentCultureIgnoreCase);
|
FluentProvider.GetMessage(hd.Description).Contains(filter, StringComparison.CurrentCultureIgnoreCase);
|
||||||
var isFilteredByContext = currentContext == AnyContext || hd.Contexts.Contains(currentContext);
|
var isFilteredByContext = currentContext == AnyContext || hd.Contexts.Contains(currentContext);
|
||||||
|
|
||||||
return isFilteredByName && isFilteredByContext;
|
return isFilteredByName && isFilteredByContext;
|
||||||
@@ -367,7 +367,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
if (string.IsNullOrEmpty(context))
|
if (string.IsNullOrEmpty(context))
|
||||||
context = AnyContext;
|
context = AnyContext;
|
||||||
|
|
||||||
return FluentProvider.GetString(context);
|
return FluentProvider.GetMessage(context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,8 +44,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
[ObjectCreator.UseCtor]
|
[ObjectCreator.UseCtor]
|
||||||
public InputSettingsLogic(Action<string, string, Func<Widget, Func<bool>>, Func<Widget, Action>> registerPanel, string panelID, string label)
|
public InputSettingsLogic(Action<string, string, Func<Widget, Func<bool>>, Func<Widget, Action>> registerPanel, string panelID, string label)
|
||||||
{
|
{
|
||||||
classic = FluentProvider.GetString(Classic);
|
classic = FluentProvider.GetMessage(Classic);
|
||||||
modern = FluentProvider.GetString(Modern);
|
modern = FluentProvider.GetMessage(Modern);
|
||||||
|
|
||||||
registerPanel(panelID, label, InitPanel, ResetPanel);
|
registerPanel(panelID, label, InitPanel, ResetPanel);
|
||||||
}
|
}
|
||||||
@@ -148,8 +148,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
{
|
{
|
||||||
var options = new Dictionary<string, bool>()
|
var options = new Dictionary<string, bool>()
|
||||||
{
|
{
|
||||||
{ FluentProvider.GetString(Classic), true },
|
{ FluentProvider.GetMessage(Classic), true },
|
||||||
{ FluentProvider.GetString(Modern), false },
|
{ FluentProvider.GetMessage(Modern), false },
|
||||||
};
|
};
|
||||||
|
|
||||||
ScrollItemWidget SetupItem(string o, ScrollItemWidget itemTemplate)
|
ScrollItemWidget SetupItem(string o, ScrollItemWidget itemTemplate)
|
||||||
@@ -168,10 +168,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
{
|
{
|
||||||
var options = new Dictionary<string, MouseScrollType>()
|
var options = new Dictionary<string, MouseScrollType>()
|
||||||
{
|
{
|
||||||
{ FluentProvider.GetString(Disabled), MouseScrollType.Disabled },
|
{ FluentProvider.GetMessage(Disabled), MouseScrollType.Disabled },
|
||||||
{ FluentProvider.GetString(Standard), MouseScrollType.Standard },
|
{ FluentProvider.GetMessage(Standard), MouseScrollType.Standard },
|
||||||
{ FluentProvider.GetString(Inverted), MouseScrollType.Inverted },
|
{ FluentProvider.GetMessage(Inverted), MouseScrollType.Inverted },
|
||||||
{ FluentProvider.GetString(Joystick), MouseScrollType.Joystick },
|
{ FluentProvider.GetMessage(Joystick), MouseScrollType.Joystick },
|
||||||
};
|
};
|
||||||
|
|
||||||
ScrollItemWidget SetupItem(string o, ScrollItemWidget itemTemplate)
|
ScrollItemWidget SetupItem(string o, ScrollItemWidget itemTemplate)
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
public SpawnOccupant(Session.Client client)
|
public SpawnOccupant(Session.Client client)
|
||||||
{
|
{
|
||||||
Color = client.Color;
|
Color = client.Color;
|
||||||
PlayerName = client.IsBot ? FluentProvider.GetString(client.Name) : client.Name;
|
PlayerName = client.IsBot ? FluentProvider.GetMessage(client.Name) : client.Name;
|
||||||
Team = client.Team;
|
Team = client.Team;
|
||||||
Faction = client.Faction;
|
Faction = client.Faction;
|
||||||
SpawnPoint = client.SpawnPoint;
|
SpawnPoint = client.SpawnPoint;
|
||||||
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
public SpawnOccupant(GameInformation.Player player)
|
public SpawnOccupant(GameInformation.Player player)
|
||||||
{
|
{
|
||||||
Color = player.Color;
|
Color = player.Color;
|
||||||
PlayerName = player.IsBot ? FluentProvider.GetString(player.Name) : player.Name;
|
PlayerName = player.IsBot ? FluentProvider.GetMessage(player.Name) : player.Name;
|
||||||
Team = player.Team;
|
Team = player.Team;
|
||||||
Faction = player.FactionId;
|
Faction = player.FactionId;
|
||||||
SpawnPoint = player.SpawnPoint;
|
SpawnPoint = player.SpawnPoint;
|
||||||
@@ -48,7 +48,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
public SpawnOccupant(GameClient player, bool suppressFaction)
|
public SpawnOccupant(GameClient player, bool suppressFaction)
|
||||||
{
|
{
|
||||||
Color = player.Color;
|
Color = player.Color;
|
||||||
PlayerName = player.IsBot ? FluentProvider.GetString(player.Name) : player.Name;
|
PlayerName = player.IsBot ? FluentProvider.GetMessage(player.Name) : player.Name;
|
||||||
Team = player.Team;
|
Team = player.Team;
|
||||||
Faction = !suppressFaction ? player.Faction : null;
|
Faction = !suppressFaction ? player.Faction : null;
|
||||||
SpawnPoint = player.SpawnPoint;
|
SpawnPoint = player.SpawnPoint;
|
||||||
|
|||||||
@@ -178,9 +178,9 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
Game.Renderer.Fonts.TryGetValue(SymbolsFont, out symbolFont);
|
Game.Renderer.Fonts.TryGetValue(SymbolsFont, out symbolFont);
|
||||||
|
|
||||||
iconOffset = 0.5f * IconSize.ToFloat2() + IconSpriteOffset;
|
iconOffset = 0.5f * IconSize.ToFloat2() + IconSpriteOffset;
|
||||||
HoldText = FluentProvider.GetString(HoldText);
|
HoldText = FluentProvider.GetMessage(HoldText);
|
||||||
holdOffset = iconOffset - overlayFont.Measure(HoldText) / 2;
|
holdOffset = iconOffset - overlayFont.Measure(HoldText) / 2;
|
||||||
ReadyText = FluentProvider.GetString(ReadyText);
|
ReadyText = FluentProvider.GetMessage(ReadyText);
|
||||||
readyOffset = iconOffset - overlayFont.Measure(ReadyText) / 2;
|
readyOffset = iconOffset - overlayFont.Measure(ReadyText) / 2;
|
||||||
|
|
||||||
if (ChromeMetrics.TryGet("InfiniteOffset", out infiniteOffset))
|
if (ChromeMetrics.TryGet("InfiniteOffset", out infiniteOffset))
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user