Rename Fluent *GetString methods to GetMessage.

This commit is contained in:
Paul Chote
2024-10-19 13:09:40 +01:00
committed by Gustas
parent 09063d23da
commit 67254e0b39
104 changed files with 396 additions and 396 deletions

View File

@@ -275,7 +275,7 @@ namespace OpenRA.Mods.Common.Traits
return;
}
TextNotificationsManager.Debug(FluentProvider.GetString(CheatUsed,
TextNotificationsManager.Debug(FluentProvider.GetMessage(CheatUsed,
"cheat", order.OrderString,
"player", self.Owner.ResolvedPlayerName,
"suffix", debugSuffix));

View File

@@ -177,8 +177,8 @@ namespace OpenRA.Mods.Common.Traits
Key = key;
TotalTicks = info.ChargeInterval;
remainingSubTicks = info.StartFullyCharged ? 0 : TotalTicks * 100;
Name = info.Name == null ? string.Empty : FluentProvider.GetString(info.Name);
Description = info.Description == null ? string.Empty : FluentProvider.GetString(info.Description);
Name = info.Name == null ? string.Empty : FluentProvider.GetMessage(info.Name);
Description = info.Description == null ? string.Empty : FluentProvider.GetMessage(info.Description);
Manager = manager;
}

View File

@@ -60,19 +60,19 @@ namespace OpenRA.Mods.Common.Traits
public string TooltipForPlayerStance(PlayerRelationship 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 (!string.IsNullOrEmpty(AllyPrefix) && relationship == PlayerRelationship.Ally)
return FluentProvider.GetString(AllyPrefix) + " " + genericName;
return FluentProvider.GetMessage(AllyPrefix) + " " + genericName;
if (!string.IsNullOrEmpty(NeutralPrefix) && relationship == PlayerRelationship.Neutral)
return FluentProvider.GetString(NeutralPrefix) + " " + genericName;
return FluentProvider.GetMessage(NeutralPrefix) + " " + genericName;
if (!string.IsNullOrEmpty(EnemyPrefix) && relationship == PlayerRelationship.Enemy)
return FluentProvider.GetString(EnemyPrefix) + " " + genericName;
return FluentProvider.GetMessage(EnemyPrefix) + " " + genericName;
}
return genericName;

View File

@@ -37,7 +37,7 @@ namespace OpenRA.Mods.Common.Traits
: base(info)
{
this.self = self;
TooltipText = FluentProvider.GetString(info.Description);
TooltipText = FluentProvider.GetMessage(info.Description);
}
public bool IsTooltipVisible(Player forPlayer)

View File

@@ -151,7 +151,7 @@ namespace OpenRA.Mods.Common.Traits
public OpenMapAction()
{
Text = FluentProvider.GetString(Opened);
Text = FluentProvider.GetMessage(Opened);
}
public void Execute()

View File

@@ -27,7 +27,7 @@ namespace OpenRA.Mods.Common.Traits
public readonly ActorInfo Info;
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;
public string Type => reference.Type;

View File

@@ -86,7 +86,7 @@ namespace OpenRA.Mods.Common.Traits
ShortGameCheckboxVisible, ShortGameCheckboxDisplayOrder, ShortGameCheckboxEnabled, ShortGameCheckboxLocked);
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)
yield return new LobbyOption(map, "techlevel",
@@ -94,7 +94,7 @@ namespace OpenRA.Mods.Common.Traits
techLevels, TechLevel, TechLevelDropdownLocked);
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.
yield return new LobbyOption(map, "gamespeed",

View File

@@ -273,7 +273,7 @@ namespace OpenRA.Mods.Common.Traits
if (info == null)
return null;
return FluentProvider.GetString(info.Name);
return FluentProvider.GetMessage(info.Name);
}
IEnumerable<string> IResourceRenderer.ResourceTypes => Info.ResourceTypes.Keys;

View File

@@ -48,7 +48,7 @@ namespace OpenRA.Mods.Common.Traits
// Duplicate classes are defined for different race variants
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)
yield return new LobbyOption(map, "startingunits", DropdownLabel, DropdownDescription, DropdownVisible, DropdownDisplayOrder,

View File

@@ -88,9 +88,9 @@ namespace OpenRA.Mods.Common.Traits
var timelimits = TimeLimitOptions.ToDictionary(m => m.ToStringInvariant(), m =>
{
if (m == 0)
return FluentProvider.GetString(NoTimeLimit);
return FluentProvider.GetMessage(NoTimeLimit);
else
return FluentProvider.GetString(TimeLimitOption, "minutes", m);
return FluentProvider.GetMessage(TimeLimitOption, "minutes", m);
});
yield return new LobbyOption(map, "timelimit", TimeLimitLabel, TimeLimitDescription, TimeLimitDropdownVisible, TimeLimitDisplayOrder,
@@ -182,7 +182,7 @@ namespace OpenRA.Mods.Common.Traits
countdownLabel.GetText = () => null;
if (!info.SkipTimerExpiredNotification)
TextNotificationsManager.AddSystemLine(FluentProvider.GetString(TimeLimitExpired));
TextNotificationsManager.AddSystemLine(FluentProvider.GetMessage(TimeLimitExpired));
}
}
}