diff --git a/OpenRA.Mods.Common/Lint/CheckActorReferences.cs b/OpenRA.Mods.Common/Lint/CheckActorReferences.cs index e962e8a389..5d9c6d3e96 100644 --- a/OpenRA.Mods.Common/Lint/CheckActorReferences.cs +++ b/OpenRA.Mods.Common/Lint/CheckActorReferences.cs @@ -68,14 +68,14 @@ namespace OpenRA.Mods.Common.Lint if (!dict.ContainsKey(v)) { - emitError($"{actorInfo.Name}.{traitInfo.GetType().Name}.{fieldInfo.Name}: Missing actor `{value}`."); + emitError($"`{actorInfo.Name}.{traitInfo.GetType().Name}.{fieldInfo.Name}`: Missing actor `{value}`."); continue; } foreach (var requiredTrait in attribute.RequiredTraits) if (!dict[v].TraitsInConstructOrder().Any(t => t.GetType() == requiredTrait || t.GetType().IsSubclassOf(requiredTrait))) - emitError($"Actor type {value} does not have trait {requiredTrait.Name} which is required by {traitInfo.GetType().Name}.{fieldInfo.Name}."); + emitError($"Actor type `{value}` does not have trait `{requiredTrait.Name}` which is required by `{traitInfo.GetType().Name}.{fieldInfo.Name}`."); } } @@ -89,7 +89,7 @@ namespace OpenRA.Mods.Common.Lint continue; if (!dict.ContainsKey(value.ToLowerInvariant())) - emitError($"{actorInfo.Name}.{traitInfo.GetType().Name}.{fieldInfo.Name}: Missing weapon `{value}`."); + emitError($"`{actorInfo.Name}.{traitInfo.GetType().Name}.{fieldInfo.Name}`: Missing weapon `{value}`."); } } @@ -103,7 +103,7 @@ namespace OpenRA.Mods.Common.Lint continue; if (!dict.ContainsKey(value.ToLowerInvariant())) - emitError($"{actorInfo.Name}.{traitInfo.GetType().Name}.{fieldInfo.Name}: Missing voice `{value}`."); + emitError($"`{actorInfo.Name}.{traitInfo.GetType().Name}.{fieldInfo.Name}`: Missing voice `{value}`."); } } } diff --git a/OpenRA.Mods.Common/Lint/CheckActors.cs b/OpenRA.Mods.Common/Lint/CheckActors.cs index ee7d0e7205..f0cacd80ea 100644 --- a/OpenRA.Mods.Common/Lint/CheckActors.cs +++ b/OpenRA.Mods.Common/Lint/CheckActors.cs @@ -21,7 +21,7 @@ namespace OpenRA.Mods.Common.Lint var actorTypes = map.ActorDefinitions.Select(a => a.Value.Value); foreach (var actor in actorTypes) if (!map.Rules.Actors.Keys.Contains(actor.ToLowerInvariant())) - emitError($"Actor {actor} is not defined by any rule."); + emitError($"Actor `{actor}` is not defined by any rule."); } } } diff --git a/OpenRA.Mods.Common/Lint/CheckAngle.cs b/OpenRA.Mods.Common/Lint/CheckAngle.cs index 3373d44c90..112890e1e2 100644 --- a/OpenRA.Mods.Common/Lint/CheckAngle.cs +++ b/OpenRA.Mods.Common/Lint/CheckAngle.cs @@ -61,16 +61,16 @@ namespace OpenRA.Mods.Common.Lint static void CheckLaunchAngles(string weaponInfo, int minAngle, bool testMaxAngle, int maxAngle, Action emitError) { if (InvalidAngle(minAngle)) - emitError($"Weapon `{weaponInfo}`: Projectile minimum LaunchAngle must not exceed (-)255!"); + emitError($"Weapon `{weaponInfo}`: Projectile minimum LaunchAngle must not exceed (-)255."); if (testMaxAngle && InvalidAngle(maxAngle)) - emitError($"Weapon `{weaponInfo}`: Projectile maximum LaunchAngle must not exceed (-)255!"); + emitError($"Weapon `{weaponInfo}`: Projectile maximum LaunchAngle must not exceed (-)255."); if ((minAngle < 256) && (maxAngle < 256) && (minAngle > maxAngle)) - emitError($"Weapon `{weaponInfo}`: Projectile minimum LaunchAngle must not exceed maximum LaunchAngle!"); + emitError($"Weapon `{weaponInfo}`: Projectile minimum LaunchAngle must not exceed maximum LaunchAngle."); if ((minAngle > 768) && (maxAngle > 768) && (minAngle > maxAngle)) - emitError($"Weapon `{weaponInfo}`: Projectile minimum LaunchAngle must not exceed maximum LaunchAngle!"); + emitError($"Weapon `{weaponInfo}`: Projectile minimum LaunchAngle must not exceed maximum LaunchAngle."); if ((minAngle < 256) && (maxAngle > 768)) - emitError($"Weapon `{weaponInfo}`: Projectile minimum LaunchAngle must not exceed maximum LaunchAngle!"); + emitError($"Weapon `{weaponInfo}`: Projectile minimum LaunchAngle must not exceed maximum LaunchAngle."); } } } diff --git a/OpenRA.Mods.Common/Lint/CheckChromeHotkeys.cs b/OpenRA.Mods.Common/Lint/CheckChromeHotkeys.cs index 12e9ca8e50..f3d6df3f67 100644 --- a/OpenRA.Mods.Common/Lint/CheckChromeHotkeys.cs +++ b/OpenRA.Mods.Common/Lint/CheckChromeHotkeys.cs @@ -77,7 +77,7 @@ namespace OpenRA.Mods.Common.Lint { // Keys are valid if they refer to a named key or can be parsed as a regular Hotkey. if (!namedKeys.Contains(node.Value.Value) && !Hotkey.TryParse(node.Value.Value, out var unused)) - emitError($"{node.Location} refers to a Key named `{node.Value.Value}` that does not exist"); + emitError($"{node.Location} refers to a Key named `{node.Value.Value}` that does not exist."); } } @@ -90,7 +90,7 @@ namespace OpenRA.Mods.Common.Lint foreach (var name in keyNames) if (!namedKeys.Contains(name) && !Hotkey.TryParse(name, out var unused)) - emitError($"{node.Location} refers to a Key named `{name}` that does not exist"); + emitError($"{node.Location} refers to a Key named `{name}` that does not exist."); } // Logic classes can declare the data key names that specify hotkeys. @@ -110,7 +110,7 @@ namespace OpenRA.Mods.Common.Lint foreach (var n in node.Value.Nodes) if (checkArgKeys.Contains(n.Key)) if (!namedKeys.Contains(n.Value.Value) && !Hotkey.TryParse(n.Value.Value, out var unused)) - emitError($"{filename} {node.Value.Value}:{n.Key} refers to a Key named `{n.Value.Value}` that does not exist"); + emitError($"{filename} {node.Value.Value}:{n.Key} refers to a Key named `{n.Value.Value}` that does not exist."); } if (node.Value.Nodes != null) diff --git a/OpenRA.Mods.Common/Lint/CheckChromeLogic.cs b/OpenRA.Mods.Common/Lint/CheckChromeLogic.cs index 82999e44e4..4ecfdbcf59 100644 --- a/OpenRA.Mods.Common/Lint/CheckChromeLogic.cs +++ b/OpenRA.Mods.Common/Lint/CheckChromeLogic.cs @@ -37,9 +37,9 @@ namespace OpenRA.Mods.Common.Lint { var type = Game.ModData.ObjectCreator.FindType(typeName); if (type == null) - emitError($"{filename} refers to a logic object `{typeName}` that does not exist"); + emitError($"{filename} refers to a logic object `{typeName}` that does not exist."); else if (!typeof(ChromeLogic).IsAssignableFrom(type)) - emitError($"{filename} refers to a logic object `{typeName}` that does not inherit from ChromeLogic"); + emitError($"{filename} refers to a logic object `{typeName}` that does not inherit from ChromeLogic."); } } diff --git a/OpenRA.Mods.Common/Lint/CheckConditions.cs b/OpenRA.Mods.Common/Lint/CheckConditions.cs index 9cf7cb8f62..7c7aca4bb0 100644 --- a/OpenRA.Mods.Common/Lint/CheckConditions.cs +++ b/OpenRA.Mods.Common/Lint/CheckConditions.cs @@ -68,11 +68,11 @@ namespace OpenRA.Mods.Common.Lint var unconsumed = granted.Except(consumed); if (unconsumed.Any()) - emitWarning($"Actor type `{actorInfo.Key}` grants conditions that are not consumed: {unconsumed.JoinWith(", ")}"); + emitWarning($"Actor type `{actorInfo.Key}` grants conditions that are not consumed: {unconsumed.JoinWith(", ")}."); var ungranted = consumed.Except(granted); if (ungranted.Any()) - emitError($"Actor type `{actorInfo.Key}` consumes conditions that are not granted: {ungranted.JoinWith(", ")}"); + emitError($"Actor type `{actorInfo.Key}` consumes conditions that are not granted: {ungranted.JoinWith(", ")}."); } } } diff --git a/OpenRA.Mods.Common/Lint/CheckConflictingMouseBounds.cs b/OpenRA.Mods.Common/Lint/CheckConflictingMouseBounds.cs index 2764d80f08..1c441b78d3 100644 --- a/OpenRA.Mods.Common/Lint/CheckConflictingMouseBounds.cs +++ b/OpenRA.Mods.Common/Lint/CheckConflictingMouseBounds.cs @@ -24,7 +24,7 @@ namespace OpenRA.Mods.Common.Lint var selectable = actorInfo.Value.TraitInfos().Count(); var interactable = actorInfo.Value.TraitInfos().Count(); if (selectable > 0 && selectable != interactable) - emitWarning($"Actor {actorInfo.Value.Name} defines both Interactable and Selectable traits. This may cause unexpected results."); + emitWarning($"Actor `{actorInfo.Value.Name}` defines both Interactable and Selectable traits. This may cause unexpected results."); } } } diff --git a/OpenRA.Mods.Common/Lint/CheckCursors.cs b/OpenRA.Mods.Common/Lint/CheckCursors.cs index 4b070d32f1..035a5a249f 100644 --- a/OpenRA.Mods.Common/Lint/CheckCursors.cs +++ b/OpenRA.Mods.Common/Lint/CheckCursors.cs @@ -57,7 +57,7 @@ namespace OpenRA.Mods.Common.Lint continue; if (!cursors.Contains(cursor)) - emitError($"Undefined cursor {cursor} for actor {actorInfo.Value.Name} with trait {traitInfo}."); + emitError($"Undefined cursor `{cursor}` for actor `{actorInfo.Value.Name}` with trait `{traitInfo}`."); } } } diff --git a/OpenRA.Mods.Common/Lint/CheckDefaultVisibility.cs b/OpenRA.Mods.Common/Lint/CheckDefaultVisibility.cs index 33d0855f3c..1e92b91ece 100644 --- a/OpenRA.Mods.Common/Lint/CheckDefaultVisibility.cs +++ b/OpenRA.Mods.Common/Lint/CheckDefaultVisibility.cs @@ -39,9 +39,9 @@ namespace OpenRA.Mods.Common.Lint var count = actorInfo.Value.TraitInfos().Count(); if (count == 0) - emitError($"Actor type `{actorInfo.Key}` does not define a default visibility type!"); + emitError($"Actor type `{actorInfo.Key}` does not define a default visibility type."); else if (count > 1) - emitError($"Actor type `{actorInfo.Key}` defines multiple default visibility types!"); + emitError($"Actor type `{actorInfo.Key}` defines multiple default visibility types."); else { var vis = actorInfo.Value.TraitInfoOrDefault(); @@ -49,15 +49,15 @@ namespace OpenRA.Mods.Common.Lint { var ios = actorInfo.Value.TraitInfoOrDefault(); if (ios == null) - emitError($"Actor type `{actorInfo.Key}` defines VisibilityType.Footprint in `{vis.GetType()}` but has no IOccupySpace traits!"); + emitError($"Actor type `{actorInfo.Key}` defines VisibilityType.Footprint in `{vis.GetType()}` but has no IOccupySpace traits."); else if (ios.OccupiedCells(actorInfo.Value, CPos.Zero).Count == 0) - emitError($"Actor type `{actorInfo.Key}` defines VisibilityType.Footprint in `{vis.GetType()}` but does not have any footprint cells!"); + emitError($"Actor type `{actorInfo.Key}` defines VisibilityType.Footprint in `{vis.GetType()}` but does not have any footprint cells."); } } } catch (InvalidOperationException e) { - emitError($"{e.Message} (Actor type `{actorInfo.Key}`)"); + emitError($"{e.Message} (Actor type `{actorInfo.Key}`)."); } } } diff --git a/OpenRA.Mods.Common/Lint/CheckHitShapes.cs b/OpenRA.Mods.Common/Lint/CheckHitShapes.cs index 553b316a99..f3a830d205 100644 --- a/OpenRA.Mods.Common/Lint/CheckHitShapes.cs +++ b/OpenRA.Mods.Common/Lint/CheckHitShapes.cs @@ -42,11 +42,11 @@ namespace OpenRA.Mods.Common.Lint var hitShapes = actorInfo.Value.TraitInfos(); if (!hitShapes.Any()) - emitError($"Actor type `{actorInfo.Key}` has a Health trait but no HitShape trait!"); + emitError($"Actor type `{actorInfo.Key}` has a Health trait but no HitShape trait."); } catch (InvalidOperationException e) { - emitError($"{e.Message} (Actor type `{actorInfo.Key}`)"); + emitError($"{e.Message} (Actor type `{actorInfo.Key}`)."); } } } diff --git a/OpenRA.Mods.Common/Lint/CheckInteractable.cs b/OpenRA.Mods.Common/Lint/CheckInteractable.cs index 29356aeece..105f7b9cd6 100644 --- a/OpenRA.Mods.Common/Lint/CheckInteractable.cs +++ b/OpenRA.Mods.Common/Lint/CheckInteractable.cs @@ -42,14 +42,14 @@ namespace OpenRA.Mods.Common.Lint continue; if (HasInvalidBounds(interactable.Bounds, grid.TileSize, grid.TileScale)) - emitError($"{nameof(interactable.Bounds)} of actor {actorInfo.Key} are empty or negative."); + emitError($"{nameof(interactable.Bounds)} of actor `{actorInfo.Key}` are empty or negative."); if (HasInvalidBounds(interactable.DecorationBounds, grid.TileSize, grid.TileScale)) - emitError($"{nameof(interactable.DecorationBounds)} of actor {actorInfo.Key} are empty or negative."); + emitError($"{nameof(interactable.DecorationBounds)} of actor `{actorInfo.Key}` are empty or negative."); } catch (InvalidOperationException e) { - emitError($"{e.Message} (Actor type `{actorInfo.Key}`)"); + emitError($"{e.Message} (Actor type `{actorInfo.Key}`)."); } } } diff --git a/OpenRA.Mods.Common/Lint/CheckLocomotorReferences.cs b/OpenRA.Mods.Common/Lint/CheckLocomotorReferences.cs index b1293f453c..9d653d3412 100644 --- a/OpenRA.Mods.Common/Lint/CheckLocomotorReferences.cs +++ b/OpenRA.Mods.Common/Lint/CheckLocomotorReferences.cs @@ -36,7 +36,7 @@ namespace OpenRA.Mods.Common.Lint foreach (var li in locomotorInfos) foreach (var otherLocomotor in locomotorInfos) if (li != otherLocomotor && li.Name == otherLocomotor.Name) - emitError($"There is more than one Locomotor with name {li.Name}!"); + emitError($"There is more than one Locomotor with name `{li.Name}`."); foreach (var actorInfo in rules.Actors) { @@ -61,7 +61,7 @@ namespace OpenRA.Mods.Common.Lint void CheckLocomotors(ActorInfo actorInfo, Action emitError, LocomotorInfo[] locomotorInfos, string locomotor) { if (!locomotorInfos.Any(l => l.Name == locomotor)) - emitError($"Actor {actorInfo.Name} defines Locomotor {locomotor} not found on World actor."); + emitError($"Actor `{actorInfo.Name}` defines Locomotor `{locomotor}` not found on World actor."); } } } diff --git a/OpenRA.Mods.Common/Lint/CheckMapCordon.cs b/OpenRA.Mods.Common/Lint/CheckMapCordon.cs index 86c494ab41..dcb65fb7be 100644 --- a/OpenRA.Mods.Common/Lint/CheckMapCordon.cs +++ b/OpenRA.Mods.Common/Lint/CheckMapCordon.cs @@ -21,7 +21,7 @@ namespace OpenRA.Mods.Common.Lint || map.Bounds.Right == map.MapSize.X || map.Bounds.Bottom == map.MapSize.Y) emitError("This map does not define a valid cordon.\n" + "A one cell (or greater) border is required on all four sides " - + "between the playable bounds and the map edges"); + + "between the playable bounds and the map edges."); } } } diff --git a/OpenRA.Mods.Common/Lint/CheckMapMetadata.cs b/OpenRA.Mods.Common/Lint/CheckMapMetadata.cs index 3aee693c0c..6673b4ae44 100644 --- a/OpenRA.Mods.Common/Lint/CheckMapMetadata.cs +++ b/OpenRA.Mods.Common/Lint/CheckMapMetadata.cs @@ -29,7 +29,7 @@ namespace OpenRA.Mods.Common.Lint void Run(Action emitError, int mapFormat, string author, string title, string[] categories) { if (mapFormat < Map.SupportedMapFormat) - emitError($"Map format {mapFormat} does not match the supported version {Map.CurrentMapFormat}."); + emitError($"Map format `{mapFormat}` does not match the supported version `{Map.CurrentMapFormat}`."); if (author == null) emitError("Map does not define a valid author."); diff --git a/OpenRA.Mods.Common/Lint/CheckMapTiles.cs b/OpenRA.Mods.Common/Lint/CheckMapTiles.cs index b51b60068e..6f9ef06e7a 100644 --- a/OpenRA.Mods.Common/Lint/CheckMapTiles.cs +++ b/OpenRA.Mods.Common/Lint/CheckMapTiles.cs @@ -18,7 +18,7 @@ namespace OpenRA.Mods.Common.Lint public void Run(Action emitError, Action emitWarning, ModData modData, Map map) { foreach (var kv in map.ReplacedInvalidTerrainTiles) - emitError($"Cell {kv.Key} references invalid terrain tile {kv.Value}."); + emitError($"Cell `{kv.Key}` references invalid terrain tile `{kv.Value}`."); } } } diff --git a/OpenRA.Mods.Common/Lint/CheckNotifications.cs b/OpenRA.Mods.Common/Lint/CheckNotifications.cs index 486366a359..13deb47d62 100644 --- a/OpenRA.Mods.Common/Lint/CheckNotifications.cs +++ b/OpenRA.Mods.Common/Lint/CheckNotifications.cs @@ -56,7 +56,7 @@ namespace OpenRA.Mods.Common.Lint if (string.IsNullOrEmpty(type) || !rules.Notifications.TryGetValue(type.ToLowerInvariant(), out var soundInfo) || !soundInfo.Notifications.ContainsKey(notification)) - emitError($"Undefined notification reference {type ?? "(null)"}.{notification} detected at {traitInfo.GetType().Name} for {actorInfo.Key}"); + emitError($"Undefined notification reference `{type ?? "(null)"}.{notification}` detected at `{traitInfo.GetType().Name}` for `{actorInfo.Key}`."); } } } diff --git a/OpenRA.Mods.Common/Lint/CheckOwners.cs b/OpenRA.Mods.Common/Lint/CheckOwners.cs index 742acca580..2c0c2e23f6 100644 --- a/OpenRA.Mods.Common/Lint/CheckOwners.cs +++ b/OpenRA.Mods.Common/Lint/CheckOwners.cs @@ -33,16 +33,16 @@ namespace OpenRA.Mods.Common.Lint var actorReference = new ActorReference(kv.Value.Value, kv.Value.ToDictionary()); var ownerInit = actorReference.GetOrDefault(); if (ownerInit == null) - emitError($"Actor {kv.Key} is not owned by any player."); + emitError($"Actor `{kv.Key}` is not owned by any player."); else { var ownerName = ownerInit.InternalName; if (!playerNames.Contains(ownerName)) - emitError($"Actor {kv.Key} is owned by unknown player {ownerName}."); + emitError($"Actor `{kv.Key}` is owned by unknown player `{ownerName}`."); if (actorsWithRequiredOwner.TryGetValue(kv.Value.Value, out var info)) if (!info.ValidOwnerNames.Contains(ownerName)) - emitError($"Actor {kv.Key} owner {ownerName} is not one of ValidOwnerNames: {info.ValidOwnerNames.JoinWith(", ")}"); + emitError($"Actor `{kv.Key}` owner `{ownerName}` is not one of ValidOwnerNames: {info.ValidOwnerNames.JoinWith(", ")}"); } } } diff --git a/OpenRA.Mods.Common/Lint/CheckPalettes.cs b/OpenRA.Mods.Common/Lint/CheckPalettes.cs index bb2b8067e6..45a95407e5 100644 --- a/OpenRA.Mods.Common/Lint/CheckPalettes.cs +++ b/OpenRA.Mods.Common/Lint/CheckPalettes.cs @@ -64,12 +64,12 @@ namespace OpenRA.Mods.Common.Lint if (isPlayerPalette) { if (!playerPalettes.Contains(reference)) - emitError($"Undefined player palette reference {reference} detected at {traitInfo} for {actorInfo.Key}"); + emitError($"Undefined player palette reference `{reference}` detected at `{traitInfo}` for `{actorInfo.Key}`"); } else { if (!palettes.Contains(reference)) - emitError($"Undefined palette reference {reference} detected at {traitInfo} for {actorInfo.Key}"); + emitError($"Undefined palette reference `{reference}` detected at `{traitInfo}` for `{actorInfo.Key}`"); } } } @@ -107,12 +107,12 @@ namespace OpenRA.Mods.Common.Lint if (isPlayerPalette) { if (!playerPalettes.Contains(reference)) - emitError($"Undefined player palette reference {reference} detected at weapon {weaponInfo.Key}."); + emitError($"Undefined player palette reference `{reference}` detected at weapon `{weaponInfo.Key}`."); } else { if (!palettes.Contains(reference)) - emitError($"Undefined palette reference {reference} detected at weapon {weaponInfo.Key}."); + emitError($"Undefined palette reference `{reference}` detected at weapon `{weaponInfo.Key}`."); } } } @@ -121,7 +121,7 @@ namespace OpenRA.Mods.Common.Lint void GetPalettes(Ruleset rules, List palettes, List playerPalettes, Action emitError) { - // Palettes are only defined on the world actor + // Palettes are only defined on the world actor. var worldActorInfo = rules.Actors[SystemActors.World]; var tilesetPalettes = new List<(string Tileset, string PaletteName)>(); foreach (var traitInfo in worldActorInfo.TraitInfos()) @@ -139,7 +139,7 @@ namespace OpenRA.Mods.Common.Lint if (paletteDefinition.IsPlayerPalette) { if (playerPalettes.Contains(value)) - emitError($"Duplicate player palette definition for palette name {value}"); + emitError($"Duplicate player palette definition for palette name `{value}`."); playerPalettes.Add(value); } @@ -151,7 +151,7 @@ namespace OpenRA.Mods.Common.Lint { var tilesetPalette = (tilesetSpecificPaletteInfo.Tileset, value); if (tilesetPalettes.Contains(tilesetPalette)) - emitError($"Duplicate palette definition for palette name {value}"); + emitError($"Duplicate palette definition for palette name `{value}`."); else { tilesetPalettes.Add(tilesetPalette); @@ -164,7 +164,7 @@ namespace OpenRA.Mods.Common.Lint else { if (palettes.Contains(value)) - emitError($"Duplicate palette definition for palette name {value}"); + emitError($"Duplicate palette definition for palette name `{value}`."); palettes.Add(value); } diff --git a/OpenRA.Mods.Common/Lint/CheckPlayers.cs b/OpenRA.Mods.Common/Lint/CheckPlayers.cs index 1cf9776016..dab2ebd0e6 100644 --- a/OpenRA.Mods.Common/Lint/CheckPlayers.cs +++ b/OpenRA.Mods.Common/Lint/CheckPlayers.cs @@ -50,11 +50,11 @@ namespace OpenRA.Mods.Common.Lint { foreach (var ally in player.Allies) if (!playerNames.Contains(ally)) - emitError($"Allies contains player {ally} that is not in list."); + emitError($"Allies contains player `{ally}` that is not in list."); foreach (var enemy in player.Enemies) if (!playerNames.Contains(enemy)) - emitError($"Enemies contains player {enemy} that is not in list."); + emitError($"Enemies contains player `{enemy}` that is not in list."); if (player.Playable) playablePlayerFound = true; @@ -63,15 +63,15 @@ namespace OpenRA.Mods.Common.Lint { worldOwnerFound = true; if (player.Enemies.Length > 0 || player.Allies.Length > 0) - emitWarning($"The player {player.Name} owning the world should not have any allies or enemies."); + emitWarning($"The player `{player.Name}` owning the world should not have any allies or enemies."); if (player.Playable) - emitError($"The player {player.Name} owning the world can't be playable."); + emitError($"The player `{player.Name}` owning the world can't be playable."); } else if (visibility == MapVisibility.MissionSelector && player.Playable && !player.LockFaction) { // Missions must lock the faction of the player to force the server to override the default Random faction - emitError($"The player {player.Name} must specify LockFaction: True."); + emitError($"The player `{player.Name}` must specify LockFaction: True."); } } @@ -84,13 +84,13 @@ namespace OpenRA.Mods.Common.Lint var factions = worldActorInfo.TraitInfos().Select(f => f.InternalName).ToHashSet(); foreach (var player in players.Players.Values) if (!string.IsNullOrWhiteSpace(player.Faction) && !factions.Contains(player.Faction)) - emitError($"Invalid faction {player.Faction} chosen for player {player.Name}."); + emitError($"Invalid faction `{player.Faction}` chosen for player `{player.Name}`."); if (worldActorInfo.HasTraitInfo()) { var playerCount = players.Players.Count(p => p.Value.Playable); if (playerCount > spawnPoints.Length) - emitError($"The map allows {playerCount} possible players, but defines only {spawnPoints.Length} spawn points"); + emitError($"The map allows {playerCount} possible players, but defines only {spawnPoints.Length} spawn points."); if (spawnPoints.Distinct().Count() != spawnPoints.Length) emitError("Duplicate spawn point locations detected."); diff --git a/OpenRA.Mods.Common/Lint/CheckRangeLimit.cs b/OpenRA.Mods.Common/Lint/CheckRangeLimit.cs index a6b07ca8c7..e6535cb5a0 100644 --- a/OpenRA.Mods.Common/Lint/CheckRangeLimit.cs +++ b/OpenRA.Mods.Common/Lint/CheckRangeLimit.cs @@ -34,7 +34,7 @@ namespace OpenRA.Mods.Common.Lint var range = weaponInfo.Value.Range; if (weaponInfo.Value.Projectile is MissileInfo missile && missile.RangeLimit > WDist.Zero && missile.RangeLimit < range) - emitError($"Weapon `{weaponInfo.Key}`: projectile RangeLimit lower than weapon range!"); + emitError($"Weapon `{weaponInfo.Key}`: projectile RangeLimit lower than weapon range."); } } } diff --git a/OpenRA.Mods.Common/Lint/CheckRevealFootprint.cs b/OpenRA.Mods.Common/Lint/CheckRevealFootprint.cs index 77953c70f1..c11e77af9b 100644 --- a/OpenRA.Mods.Common/Lint/CheckRevealFootprint.cs +++ b/OpenRA.Mods.Common/Lint/CheckRevealFootprint.cs @@ -42,14 +42,14 @@ namespace OpenRA.Mods.Common.Lint continue; if (ios == null) - emitError($"Actor type `{actorInfo.Key}` defines VisibilityType.Footprint in `{rsi.GetType()}` but has no IOccupySpace traits!"); + emitError($"Actor type `{actorInfo.Key}` defines VisibilityType.Footprint in `{rsi.GetType()}` but has no IOccupySpace traits."); else if (ios.OccupiedCells(actorInfo.Value, CPos.Zero).Count == 0) - emitError($"Actor type `{actorInfo.Key}` defines VisibilityType.Footprint in `{rsi.GetType()}` but does not have any footprint cells!"); + emitError($"Actor type `{actorInfo.Key}` defines VisibilityType.Footprint in `{rsi.GetType()}` but does not have any footprint cells."); } } catch (InvalidOperationException e) { - emitError($"{e.Message} (Actor type `{actorInfo.Key}`)"); + emitError($"{e.Message} (Actor type `{actorInfo.Key}`)."); } } } diff --git a/OpenRA.Mods.Common/Lint/CheckSequences.cs b/OpenRA.Mods.Common/Lint/CheckSequences.cs index 26a200efb6..3cae0317b0 100644 --- a/OpenRA.Mods.Common/Lint/CheckSequences.cs +++ b/OpenRA.Mods.Common/Lint/CheckSequences.cs @@ -77,7 +77,7 @@ namespace OpenRA.Mods.Common.Lint if (string.IsNullOrEmpty(imageOverride)) { if (!sequenceReference.AllowNullImage) - emitError($"Actor type `{actorInfo.Value.Name}` trait `{traitName}` must define a value for `{sequenceReference.ImageReference}`"); + emitError($"Actor type `{actorInfo.Value.Name}` trait `{traitName}` must define a value for `{sequenceReference.ImageReference}`."); continue; } @@ -129,7 +129,7 @@ namespace OpenRA.Mods.Common.Lint if (string.IsNullOrEmpty(image)) { if (!sequenceReference.AllowNullImage) - emitError($"Weapon type `{weaponInfo.Key}` projectile field `{sequenceReference.ImageReference}` must define a value"); + emitError($"Weapon type `{weaponInfo.Key}` projectile field `{sequenceReference.ImageReference}` must define a value."); continue; } diff --git a/OpenRA.Mods.Common/Lint/CheckSpriteBodies.cs b/OpenRA.Mods.Common/Lint/CheckSpriteBodies.cs index 218b3c009b..f2f4b84560 100644 --- a/OpenRA.Mods.Common/Lint/CheckSpriteBodies.cs +++ b/OpenRA.Mods.Common/Lint/CheckSpriteBodies.cs @@ -35,7 +35,7 @@ namespace OpenRA.Mods.Common.Lint var wsbs = actorInfo.Value.TraitInfos(); foreach (var wsb in wsbs) if (wsbs.Any(w => w != wsb && w.Name == wsb.Name)) - emitError($"Actor type `{actorInfo.Key}` has more than one *SpriteBody with Name: {wsb.Name}!"); + emitError($"Actor type `{actorInfo.Key}` has more than one *SpriteBody with Name: {wsb.Name}."); } } } diff --git a/OpenRA.Mods.Common/Lint/CheckSyncAnnotations.cs b/OpenRA.Mods.Common/Lint/CheckSyncAnnotations.cs index 78431e0b14..42c571bcc5 100644 --- a/OpenRA.Mods.Common/Lint/CheckSyncAnnotations.cs +++ b/OpenRA.Mods.Common/Lint/CheckSyncAnnotations.cs @@ -49,7 +49,7 @@ namespace OpenRA.Mods.Common.Lint { foreach (var type in types) if (!TypeImplementsSync(type) && AnyTypeMemberIsSynced(type)) - emitWarning($"{type.FullName} has members with the Sync attribute but does not implement ISync"); + emitWarning($"{type.FullName} has members with the Sync attribute but does not implement ISync."); } static void CheckTypesImplementingSyncInterfaceHaveSyncableMembers(IEnumerable types, Action emitWarning) diff --git a/OpenRA.Mods.Common/Lint/CheckTooltips.cs b/OpenRA.Mods.Common/Lint/CheckTooltips.cs index 8004c50c22..24eb7fa76f 100644 --- a/OpenRA.Mods.Common/Lint/CheckTooltips.cs +++ b/OpenRA.Mods.Common/Lint/CheckTooltips.cs @@ -41,11 +41,11 @@ namespace OpenRA.Mods.Common.Lint var tooltip = actorInfo.Value.TraitInfos().FirstOrDefault(info => info.EnabledByDefault); if (tooltip == null) - emitError("The following buildable actor has no (enabled) Tooltip: " + actorInfo.Key); + emitError($"The following buildable actor has no (enabled) Tooltip: `{actorInfo.Key}`."); } catch (InvalidOperationException e) { - emitError($"{e.Message} (Actor type `{actorInfo.Key}`)"); + emitError($"{e.Message} (Actor type `{actorInfo.Key}`)."); } } } diff --git a/OpenRA.Mods.Common/Lint/CheckTraitLocation.cs b/OpenRA.Mods.Common/Lint/CheckTraitLocation.cs index f5ed751572..deb3e7487e 100644 --- a/OpenRA.Mods.Common/Lint/CheckTraitLocation.cs +++ b/OpenRA.Mods.Common/Lint/CheckTraitLocation.cs @@ -33,7 +33,7 @@ namespace OpenRA.Mods.Common.Lint var traitName = traitInfo.GetType().Name; traitName = traitName.Remove(traitName.Length - 4); var locations = traitLocation.SystemActors.ToString().Replace(", ", " or "); - emitError($"{traitName} does not belong on {actorInfo.Key}. It is a system trait meant for {locations}."); + emitError($"`{traitName}` does not belong on `{actorInfo.Key}`. It is a system trait meant for {locations}."); } } } diff --git a/OpenRA.Mods.Common/Lint/CheckTraitPrerequisites.cs b/OpenRA.Mods.Common/Lint/CheckTraitPrerequisites.cs index edb2b17384..9d4f044de4 100644 --- a/OpenRA.Mods.Common/Lint/CheckTraitPrerequisites.cs +++ b/OpenRA.Mods.Common/Lint/CheckTraitPrerequisites.cs @@ -35,11 +35,11 @@ namespace OpenRA.Mods.Common.Lint { var hasTraits = actorInfo.Value.TraitsInConstructOrder().Any(); if (!hasTraits) - emitWarning($"Actor {actorInfo.Key} has no traits. Is this intended?"); + emitWarning($"Actor `{actorInfo.Key}` has no traits. Is this intended?"); } catch (Exception e) { - emitError($"Actor {actorInfo.Key} is not constructible; failure: {e.Message}"); + emitError($"Actor `{actorInfo.Key}` is not constructible; failure: {e.Message}."); } } } diff --git a/OpenRA.Mods.Common/Lint/CheckTranslationReference.cs b/OpenRA.Mods.Common/Lint/CheckTranslationReference.cs index 4b6eda28ca..3d6ff62428 100644 --- a/OpenRA.Mods.Common/Lint/CheckTranslationReference.cs +++ b/OpenRA.Mods.Common/Lint/CheckTranslationReference.cs @@ -93,7 +93,7 @@ namespace OpenRA.Mods.Common.Lint TestTraits(modData.DefaultRules, emitError, key => { if (!translation.HasMessage(key)) - emitError($"{key} not present in `{language}` translation."); + emitError($"`{key}` not present in `{language}` translation."); }); var gameSpeeds = modData.Manifest.Get(); @@ -114,7 +114,7 @@ namespace OpenRA.Mods.Common.Lint if (fieldInfo.FieldType != typeof(string)) { - emitError($"Translation attribute on non string field {fieldInfo.Name}."); + emitError($"Translation attribute on non string field `{fieldInfo.Name}`."); continue; } diff --git a/OpenRA.Mods.Common/Lint/CheckTranslationSyntax.cs b/OpenRA.Mods.Common/Lint/CheckTranslationSyntax.cs index 51df4c1db1..814b65a770 100644 --- a/OpenRA.Mods.Common/Lint/CheckTranslationSyntax.cs +++ b/OpenRA.Mods.Common/Lint/CheckTranslationSyntax.cs @@ -32,7 +32,7 @@ namespace OpenRA.Mods.Common.Lint foreach (var entry in resource.Entries) { if (entry is Junk junk) - emitError($"{junk.GetId()}: {junk.AsStr()} in {file} {junk.Content}"); + emitError($"{junk.GetId()}: {junk.AsStr()} in {file} {junk.Content}."); if (entry is AstMessage message) { diff --git a/OpenRA.Mods.Common/Lint/CheckUnknownTraitFields.cs b/OpenRA.Mods.Common/Lint/CheckUnknownTraitFields.cs index 173449f7cb..3df676ddca 100644 --- a/OpenRA.Mods.Common/Lint/CheckUnknownTraitFields.cs +++ b/OpenRA.Mods.Common/Lint/CheckUnknownTraitFields.cs @@ -53,10 +53,10 @@ namespace OpenRA.Mods.Common.Lint if (t.Key.StartsWith("-", StringComparison.Ordinal)) { if (t.Value.Nodes.Count > 0) - emitError($"{t.Location} {t.Key} defines child nodes, which are not valid for removals."); + emitError($"{t.Location} `{t.Key}` defines child nodes, which are not valid for removals."); if (!string.IsNullOrEmpty(t.Value.Value)) - emitError($"{t.Location} {t.Key} defines a value, which is not valid for removals."); + emitError($"{t.Location} `{t.Key}` defines a value, which is not valid for removals."); continue; } diff --git a/OpenRA.Mods.Common/Lint/CheckUnknownWeaponFields.cs b/OpenRA.Mods.Common/Lint/CheckUnknownWeaponFields.cs index f0569d4ead..6ba61b5dc0 100644 --- a/OpenRA.Mods.Common/Lint/CheckUnknownWeaponFields.cs +++ b/OpenRA.Mods.Common/Lint/CheckUnknownWeaponFields.cs @@ -55,10 +55,10 @@ namespace OpenRA.Mods.Common.Lint if (field.Key.StartsWith("-", StringComparison.Ordinal)) { if (field.Value.Nodes.Count > 0) - emitError($"{field.Location} {field.Key} defines child nodes, which is not valid for removals."); + emitError($"{field.Location} `{field.Key}` defines child nodes, which is not valid for removals."); if (!string.IsNullOrEmpty(field.Value.Value)) - emitError($"{field.Location} {field.Key} defines a value, which is not valid for removals."); + emitError($"{field.Location} `{field.Key}` defines a value, which is not valid for removals."); continue; } diff --git a/OpenRA.Mods.Common/Lint/CheckVoiceReferences.cs b/OpenRA.Mods.Common/Lint/CheckVoiceReferences.cs index bf4f2f8e9d..c84b68ea95 100644 --- a/OpenRA.Mods.Common/Lint/CheckVoiceReferences.cs +++ b/OpenRA.Mods.Common/Lint/CheckVoiceReferences.cs @@ -67,7 +67,7 @@ namespace OpenRA.Mods.Common.Lint continue; if (!soundInfo.Voices.ContainsKey(voice)) - emitError($"Actor {actorInfo.Name} using voice set {voiceSet} does not define {voice} voice required by {traitInfo}."); + emitError($"Actor `{actorInfo.Name}` using voice set `{voiceSet}` does not define `{voice}` voice required by `{traitInfo}`."); } } } diff --git a/OpenRA.Mods.Common/Lint/CheckWorldAndPlayerInherits.cs b/OpenRA.Mods.Common/Lint/CheckWorldAndPlayerInherits.cs index deefc97f82..5476823b87 100644 --- a/OpenRA.Mods.Common/Lint/CheckWorldAndPlayerInherits.cs +++ b/OpenRA.Mods.Common/Lint/CheckWorldAndPlayerInherits.cs @@ -86,7 +86,7 @@ namespace OpenRA.Mods.Common.Lint foreach (var inherit in inherits) { if (inherit[0] != '^') - emitError($"{actor} definition inherits from {inherit}, which is not an abstract template."); + emitError($"`{actor}` definition inherits from `{inherit}`, which is not an abstract template."); toResolve.Enqueue(inherit); } diff --git a/OpenRA.Mods.Common/Lint/LintBuildablePrerequisites.cs b/OpenRA.Mods.Common/Lint/LintBuildablePrerequisites.cs index 129c28bcf7..c76f02f859 100644 --- a/OpenRA.Mods.Common/Lint/LintBuildablePrerequisites.cs +++ b/OpenRA.Mods.Common/Lint/LintBuildablePrerequisites.cs @@ -42,11 +42,11 @@ namespace OpenRA.Mods.Common.Lint if (bi != null) foreach (var prereq in bi.Prerequisites) if (!prereq.StartsWith("~disabled") && !providedPrereqs.Contains(prereq.Replace("!", "").Replace("~", ""))) - emitError($"Buildable actor {actorInfo.Key} has prereq {prereq} not provided by anything."); + emitError($"Buildable actor `{actorInfo.Key}` has prereq `{prereq}` not provided by anything."); } catch (InvalidOperationException e) { - emitError($"{e.Message} (Actor type `{actorInfo.Key}`)"); + emitError($"{e.Message} (Actor type `{actorInfo.Key}`)."); } } } diff --git a/OpenRA.Mods.Common/Lint/LintExts.cs b/OpenRA.Mods.Common/Lint/LintExts.cs index f27c5300e4..de50114419 100644 --- a/OpenRA.Mods.Common/Lint/LintExts.cs +++ b/OpenRA.Mods.Common/Lint/LintExts.cs @@ -63,7 +63,7 @@ namespace OpenRA.Mods.Common.Lint "BooleanExpression", "IntegerExpression" }; - throw new InvalidOperationException($"Bad type for reference on {ruleInfo.GetType().Name}.{fieldInfo.Name}. Supported types: {supportedTypes.JoinWith(", ")}"); + throw new InvalidOperationException($"Bad type for reference on `{ruleInfo.GetType().Name}.{fieldInfo.Name}`. Supported types: {supportedTypes.JoinWith(", ")}."); } public static IEnumerable GetPropertyValues(object ruleInfo, PropertyInfo propertyInfo, @@ -108,7 +108,7 @@ namespace OpenRA.Mods.Common.Lint "BooleanExpression", "IntegerExpression" }; - throw new InvalidOperationException($"Bad type for reference on {ruleInfo.GetType().Name}.{propertyInfo.Name}. Supported types: {supportedTypes.JoinWith(", ")}"); + throw new InvalidOperationException($"Bad type for reference on `{ruleInfo.GetType().Name}.{propertyInfo.Name}`. Supported types: {supportedTypes.JoinWith(", ")}."); } } } diff --git a/OpenRA.Mods.Common/UtilityCommands/CheckYaml.cs b/OpenRA.Mods.Common/UtilityCommands/CheckYaml.cs index 6f34e80432..ad1eacc909 100644 --- a/OpenRA.Mods.Common/UtilityCommands/CheckYaml.cs +++ b/OpenRA.Mods.Common/UtilityCommands/CheckYaml.cs @@ -53,8 +53,8 @@ namespace OpenRA.Mods.Common.UtilityCommands Log.AddChannel("perf", null); // bind some nonfatal error handling into FieldLoader, so we don't just *explode*. - ObjectCreator.MissingTypeAction = s => EmitError($"Missing Type: {s}"); - FieldLoader.UnknownFieldAction = (s, f) => EmitError($"FieldLoader: Missing field `{s}` on `{f.Name}`"); + ObjectCreator.MissingTypeAction = s => EmitError($"Missing Type: {s}."); + FieldLoader.UnknownFieldAction = (s, f) => EmitError($"FieldLoader: Missing field `{s}` on `{f.Name}`."); var maps = new List<(IReadWritePackage Package, string Map)>(); if (args.Length < 2)