From 76eb876df5a8bb12f9088253586ce2d600407562 Mon Sep 17 00:00:00 2001 From: CMDR-Bill-Doors Date: Thu, 12 Oct 2023 13:58:14 +0100 Subject: [PATCH] tr key for armor durability and bipod stat --- Languages/English/Keyed/ArmorDurability.xml | 10 ++++ Languages/English/Keyed/BipodStatWorker.xml | 12 +++++ .../Comps/CompArmorDurability.cs | 8 ++-- .../StatWorkers/StatWorker_BipodDisplay.cs | 46 +++++++++---------- 4 files changed, 49 insertions(+), 27 deletions(-) create mode 100644 Languages/English/Keyed/ArmorDurability.xml create mode 100644 Languages/English/Keyed/BipodStatWorker.xml diff --git a/Languages/English/Keyed/ArmorDurability.xml b/Languages/English/Keyed/ArmorDurability.xml new file mode 100644 index 0000000000..0bbdac949a --- /dev/null +++ b/Languages/English/Keyed/ArmorDurability.xml @@ -0,0 +1,10 @@ + + + + + Armor durability: + Repair armor + Can't repair natural armor, armor is undamaged + Can't repair natural armor, no resources + + \ No newline at end of file diff --git a/Languages/English/Keyed/BipodStatWorker.xml b/Languages/English/Keyed/BipodStatWorker.xml new file mode 100644 index 0000000000..7b50ccc48f --- /dev/null +++ b/Languages/English/Keyed/BipodStatWorker.xml @@ -0,0 +1,12 @@ + + + + Time to set up bipod: + Auto sets up in firemode: + Stats when set up: + Stats when NOT set up: + Range + Warm up + Hover over to display + + \ No newline at end of file diff --git a/Source/CombatExtended/CombatExtended/Comps/CompArmorDurability.cs b/Source/CombatExtended/CombatExtended/Comps/CompArmorDurability.cs index a4d5416047..d25833db2a 100644 --- a/Source/CombatExtended/CombatExtended/Comps/CompArmorDurability.cs +++ b/Source/CombatExtended/CombatExtended/Comps/CompArmorDurability.cs @@ -151,7 +151,7 @@ public override void PostExposeData() public override string CompInspectStringExtra() { - return "Armor durability: " + curDurability.ToString() + "/" + maxDurability.ToString() + " (" + curDurabilityPercent.ToStringPercent() + ")"; + return "CE_ArmorDurability".Translate() + curDurability.ToString() + "/" + maxDurability.ToString() + " (" + curDurabilityPercent.ToStringPercent() + ")"; } public override void PostPreApplyDamage(DamageInfo dinfo, out bool absorbed) @@ -193,7 +193,7 @@ public override IEnumerable CompFloatMenuOptions(Pawn selPawn) if (curDurability < maxDurability + durabilityProps.MaxOverHeal && firstIngredientProvidedOrNotNeeded && secondIngredientProvidedOrNotNeeded) { - yield return new FloatMenuOption("Fix natural armor", delegate + yield return new FloatMenuOption("CE_RepairArmorDurability".Translate(), delegate { Thing firstIngredient = null; Thing secondIngredient = null; @@ -213,11 +213,11 @@ public override IEnumerable CompFloatMenuOptions(Pawn selPawn) } else if (this.curDurability >= maxDurability + durabilityProps.MaxOverHeal) { - yield return new FloatMenuOption("Can't repair natural armor, armor is undamaged", null); + yield return new FloatMenuOption("CE_ArmorDurability_CannotRepairUndamaged".Translate(), null); } else { - yield return new FloatMenuOption("Can't repair natural armor, no resources", null); + yield return new FloatMenuOption("CE_ArmorDurability_CannonRepairNoResource".Translate(), null); } } } diff --git a/Source/CombatExtended/CombatExtended/StatWorkers/StatWorker_BipodDisplay.cs b/Source/CombatExtended/CombatExtended/StatWorkers/StatWorker_BipodDisplay.cs index e64c661055..2e77bf605f 100644 --- a/Source/CombatExtended/CombatExtended/StatWorkers/StatWorker_BipodDisplay.cs +++ b/Source/CombatExtended/CombatExtended/StatWorkers/StatWorker_BipodDisplay.cs @@ -72,11 +72,11 @@ public override string GetExplanationFinalizePart(StatRequest req, ToStringNumbe { var BipodCompProps = bipodComp(req); var VerbPropsCE = verbPropsCE(req); - string result = "Time to set up bipod: " + BipodCompProps.ticksToSetUp + " ticks (" + (BipodCompProps.ticksToSetUp / 60) + "s)"; + string result = "CE_BipodSetupTime".Translate() + BipodCompProps.ticksToSetUp + " ticks (" + (BipodCompProps.ticksToSetUp / 60) + "s)"; if (Controller.settings.AutoSetUp) { - result += "\n" + "Auto sets up in firemode: " + "\n"; + result += "\n" + "CE_BipodAutoSetupMode".Translate() + "\n"; if (BipodCompProps.catDef.useAutoSetMode) { result += "- " + BipodCompProps.catDef.autosetMode.ToString() + "\n"; @@ -89,35 +89,35 @@ public override string GetExplanationFinalizePart(StatRequest req, ToStringNumbe } - result += "\n" + "Stats when set up: ".Colorize(Color.green) + "\n"; + result += "\n" + "CE_BipodStatWhenSetUp".Translate().Colorize(Color.green) + "\n"; - result += "Recoil: " + Math.Round((VerbPropsCE.recoilAmount * BipodCompProps.recoilMulton), 2); + result += CE_StatDefOf.Recoil.label + ": " + Math.Round((VerbPropsCE.recoilAmount * BipodCompProps.recoilMulton), 2); result += "\n"; - result += "Sway: " + Math.Round((req.Thing.def.statBases.Find(x => x.stat == CE_StatDefOf.SwayFactor).value * BipodCompProps.swayMult), 2); + result += CE_StatDefOf.SwayFactor.label + ": " + Math.Round((req.Thing.def.statBases.Find(x => x.stat == CE_StatDefOf.SwayFactor).value * BipodCompProps.swayMult), 2); result += "\n"; - result += "Range: " + (BipodCompProps.additionalrange + VerbPropsCE.range); + result += "CE_BipodStatRange".Translate() + ": " + (BipodCompProps.additionalrange + VerbPropsCE.range); result += "\n"; - result += "Warmup Time: " + (BipodCompProps.warmupMult * VerbPropsCE.warmupTime); + result += "CE_BipodStatWarmUp".Translate() + ": " + (BipodCompProps.warmupMult * VerbPropsCE.warmupTime); result += "\n" + "\n"; - result += "Stats when NOT set up: ".Colorize(Color.red) + "\n"; + result += "CE_BipodStatWhenNotSetUp".Translate().Colorize(Color.red) + "\n"; - result += "Recoil: " + Math.Round((VerbPropsCE.recoilAmount * BipodCompProps.recoilMultoff), 2); + result += CE_StatDefOf.Recoil.label + ": " + Math.Round((VerbPropsCE.recoilAmount * BipodCompProps.recoilMultoff), 2); result += "\n"; - result += "Sway: " + Math.Round((req.Thing.def.statBases.Find(x => x.stat == CE_StatDefOf.SwayFactor).value * BipodCompProps.swayPenalty), 2); + result += CE_StatDefOf.SwayFactor.label + ": " + Math.Round((req.Thing.def.statBases.Find(x => x.stat == CE_StatDefOf.SwayFactor).value * BipodCompProps.swayPenalty), 2); result += "\n"; - result += "Range: " + (VerbPropsCE.range); + result += "CE_BipodStatRange".Translate() + ": " + (VerbPropsCE.range); result += "\n"; - result += "Warmup Time: " + (BipodCompProps.warmupPenalty * VerbPropsCE.warmupTime); + result += "CE_BipodStatWarmUp".Translate() + ": " + (BipodCompProps.warmupPenalty * VerbPropsCE.warmupTime); return result; } @@ -132,39 +132,39 @@ public override string GetExplanationFinalizePart(StatRequest req, ToStringNumbe return base.GetExplanationFinalizePart(req, numberSense, finalVal); } - string result = "Time to set up bipod: " + BipodCompProps.ticksToSetUp + " ticks (" + (BipodCompProps.ticksToSetUp / 60) + "s)" + "\n" + "Stats when set up: ".Colorize(Color.green) + "\n"; + string result = "CE_BipodSetupTime".Translate() + BipodCompProps.ticksToSetUp + " ticks (" + (BipodCompProps.ticksToSetUp / 60) + "s)" + "\n" + "Stats when set up: ".Colorize(Color.green) + "\n"; - result += "Recoil: " + (VerbPropsCE.recoilAmount * BipodCompProps.recoilMulton); + result += CE_StatDefOf.Recoil.label + ": " + (VerbPropsCE.recoilAmount * BipodCompProps.recoilMulton); result += "\n"; - result += "Sway: " + (((ThingDef)(req.Def)).statBases.Find(x => x.stat == CE_StatDefOf.SwayFactor).value * BipodCompProps.swayPenalty); + result += CE_StatDefOf.SwayFactor.label + ": " + (((ThingDef)(req.Def)).statBases.Find(x => x.stat == CE_StatDefOf.SwayFactor).value * BipodCompProps.swayPenalty); result += "\n"; - result += "Range: " + (BipodCompProps.additionalrange + VerbPropsCE.range); + result += "CE_BipodStatRange".Translate() + ": " + (BipodCompProps.additionalrange + VerbPropsCE.range); result += "\n"; - result += "Warmup Time: " + (BipodCompProps.warmupMult * VerbPropsCE.warmupTime); + result += "CE_BipodStatWarmUp".Translate() + ": " + (BipodCompProps.warmupMult * VerbPropsCE.warmupTime); result += "\n" + "\n"; - result += "Stats when NOT set up: ".Colorize(Color.red) + "\n"; + result += "CE_BipodStatWhenNotSetUp".Translate().Colorize(Color.red) + "\n"; - result += "Recoil: " + (VerbPropsCE.recoilAmount * BipodCompProps.recoilMultoff); + result += CE_StatDefOf.Recoil.label + ": " + (VerbPropsCE.recoilAmount * BipodCompProps.recoilMultoff); result += "\n"; - result += "Sway: " + (((ThingDef)(req.Def)).statBases.Find(x => x.stat == CE_StatDefOf.SwayFactor).value * BipodCompProps.swayPenalty); + result += CE_StatDefOf.SwayFactor.label + ": " + (((ThingDef)(req.Def)).statBases.Find(x => x.stat == CE_StatDefOf.SwayFactor).value * BipodCompProps.swayPenalty); result += "\n"; - result += "Range: " + (VerbPropsCE.range); + result += "CE_BipodStatRange".Translate() + ": " + (VerbPropsCE.range); result += "\n"; - result += "Warmup Time: " + (BipodCompProps.warmupPenalty * VerbPropsCE.warmupTime); + result += "CE_BipodStatWarmUp".Translate() + ": " + (BipodCompProps.warmupPenalty * VerbPropsCE.warmupTime); return result; } @@ -178,7 +178,7 @@ public override string ValueToString(float val, bool finalized, ToStringNumberSe { if (finalized) { - return "Hover over"; + return "CE_BipodHoverOverStat".Translate(); } else {