From 8246b2f35f5f02e6f7de87711b68da6f076eb5c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sat, 22 Dec 2012 17:42:57 +0100 Subject: [PATCH] don't hardcode custom prerequisites anymore to make those strings translatable --- .../Widgets/Logic/ProductionTooltipLogic.cs | 10 --------- OpenRA.Mods.RA/Widgets/BuildPaletteWidget.cs | 10 --------- mods/cnc/rules/structures.yaml | 16 ++++++++++++++ mods/ra/rules/structures.yaml | 21 +++++++++++++++++++ 4 files changed, 37 insertions(+), 20 deletions(-) diff --git a/OpenRA.Mods.Cnc/Widgets/Logic/ProductionTooltipLogic.cs b/OpenRA.Mods.Cnc/Widgets/Logic/ProductionTooltipLogic.cs index 75bc3009f2..3c1a22b236 100644 --- a/OpenRA.Mods.Cnc/Widgets/Logic/ProductionTooltipLogic.cs +++ b/OpenRA.Mods.Cnc/Widgets/Logic/ProductionTooltipLogic.cs @@ -90,16 +90,6 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic static string ActorName( string a ) { - // hack hack hack - going to die soon anyway - if (a == "barracks") - return "Infantry Production"; - if (a == "vehicleproduction") - return "Vehicle Production"; - if (a == "techcenter") - return "Tech Center"; - if (a == "anypower") - return "Power Plant"; - ActorInfo ai; Rules.Info.TryGetValue(a.ToLowerInvariant(), out ai); if (ai != null && ai.Traits.Contains()) diff --git a/OpenRA.Mods.RA/Widgets/BuildPaletteWidget.cs b/OpenRA.Mods.RA/Widgets/BuildPaletteWidget.cs index ea4a28b562..c766afd221 100755 --- a/OpenRA.Mods.RA/Widgets/BuildPaletteWidget.cs +++ b/OpenRA.Mods.RA/Widgets/BuildPaletteWidget.cs @@ -323,16 +323,6 @@ namespace OpenRA.Mods.RA.Widgets static string Description( string a ) { - // hack hack hack - going to die soon anyway - if (a == "barracks") - return "Infantry production"; - if (a == "vehicleproduction") - return "Vehicle production"; - if (a == "techcenter") - return "Tech Center"; - if (a == "anypower") - return "Power Plant"; - ActorInfo ai; Rules.Info.TryGetValue(a.ToLowerInvariant(), out ai); if (ai != null && ai.Traits.Contains()) diff --git a/mods/cnc/rules/structures.yaml b/mods/cnc/rules/structures.yaml index 7a4be19e88..8d9cdef525 100644 --- a/mods/cnc/rules/structures.yaml +++ b/mods/cnc/rules/structures.yaml @@ -734,3 +734,19 @@ ATWR: DetectCloaked: Range: 6 RenderRangeCircle: + +# custom prerequisites: +BARRACKS: + Tooltip: + Name: Infantry Production + Description: Infantry Production + +VEHICLEPRODUCTION: + Tooltip: + Name: Vehicle Production + Description: Vehicle Production + +ANYPOWER: + Tooltip: + Name: Power Plant + Description: Power Plant \ No newline at end of file diff --git a/mods/ra/rules/structures.yaml b/mods/ra/rules/structures.yaml index 6e0f7cbbe6..4a03744de0 100644 --- a/mods/ra/rules/structures.yaml +++ b/mods/ra/rules/structures.yaml @@ -1464,3 +1464,24 @@ WOOD: HP: 100 Armor: Type: Wood + +# custom prerequisites: +BARRACKS: + Tooltip: + Name: Infantry Production + Description: Infantry Production + +VEHICLEPRODUCTION: + Tooltip: + Name: Vehicle Production + Description: Vehicle Production + +TECHCENTER: + Tooltip: + Name: Tech Center + Description: Tech Center + +ANYPOWER: + Tooltip: + Name: Power Plant + Description: Power Plant \ No newline at end of file