Make health gain message translatable
authorWuzzy <almikes@aol.com>
Thu, 20 Apr 2017 02:38:45 +0200 (2017-04-20)
changeset 12293 6383323fdd2c
parent 12292 93434ab299a0
child 12294 0deabf747b8f
Make health gain message translatable
hedgewars/uGearsHedgehog.pas
hedgewars/uGearsUtils.pas
hedgewars/uTypes.pas
share/hedgewars/Data/Locale/en.txt
--- a/hedgewars/uGearsHedgehog.pas	Thu Apr 20 00:04:35 2017 +0200
+++ b/hedgewars/uGearsHedgehog.pas	Thu Apr 20 02:38:45 2017 +0200
@@ -703,7 +703,7 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 procedure PickUp(HH, Gear: PGear);
-var s: shortstring;
+var s: ansistring;
     i: LongInt;
     vga: PVisualGear;
     ag, gi: PGear;
@@ -755,8 +755,8 @@
                     PlaySound(sndShotgunReload);
                     inc(HH^.Health, Gear^.Health);
                     HH^.Hedgehog^.Effects[hePoisoned] := 0;
-                    s:= '+' + IntToStr(Gear^.Health);
-                    AddCaption(ansistring(s), HH^.Hedgehog^.Team^.Clan^.Color, capgrpAmmoinfo);
+                    s:= IntToStr(Gear^.Health);
+                    AddCaption(FormatA(trmsg[sidHealthGain], s), HH^.Hedgehog^.Team^.Clan^.Color, capgrpAmmoinfo);
                     RenderHealth(HH^.Hedgehog^);
                     RecountTeamHealth(HH^.Hedgehog^.Team);
 
--- a/hedgewars/uGearsUtils.pas	Thu Apr 20 00:04:35 2017 +0200
+++ b/hedgewars/uGearsUtils.pas	Thu Apr 20 02:38:45 2017 +0200
@@ -261,7 +261,7 @@
 end;
 
 procedure ApplyDamage(Gear: PGear; AttackerHog: PHedgehog; Damage: Longword; Source: TDamageSource);
-var s: shortstring;
+var s: ansistring;
     vampDmg, tmpDmg, i: Longword;
     vg: PVisualGear;
 begin
@@ -286,8 +286,8 @@
                     // was considering pulsing on attack, Tiy thinks it should be permanent while in play
                     //CurrentHedgehog^.Gear^.State:= CurrentHedgehog^.Gear^.State or gstVampiric;
                     inc(CurrentHedgehog^.Gear^.Health,vampDmg);
-                    s:= '+' + IntToStr(vampDmg);
-                    AddCaption(ansistring(s), CurrentHedgehog^.Team^.Clan^.Color, capgrpAmmoinfo);
+                    s:= IntToStr(vampDmg);
+                    AddCaption(FormatA(trmsg[sidHealthGain], s), CurrentHedgehog^.Team^.Clan^.Color, capgrpAmmoinfo);
                     RenderHealth(CurrentHedgehog^);
                     RecountTeamHealth(CurrentHedgehog^.Team);
                     i:= 0;
--- a/hedgewars/uTypes.pas	Thu Apr 20 00:04:35 2017 +0200
+++ b/hedgewars/uTypes.pas	Thu Apr 20 02:38:45 2017 +0200
@@ -464,7 +464,7 @@
             sidNoEndTurn, sidNotYetAvailable, sidRoundSD, sidRoundsSD, sidReady,
             sidBounce1, sidBounce2, sidBounce3, sidBounce4, sidBounce5, sidBounce,
             sidMute, sidAFK, sidAutoCameraOff, sidAutoCameraOn, sidPressTarget,
-            sidNotAvailableInSD);
+            sidNotAvailableInSD, sidHealthGain);
 
     // Events that are important for the course of the game or at least interesting for other reasons
     TEventId = (eidDied, eidDrowned, eidRoundStart, eidRoundWin, eidRoundDraw,
--- a/share/hedgewars/Data/Locale/en.txt	Thu Apr 20 00:04:35 2017 +0200
+++ b/share/hedgewars/Data/Locale/en.txt	Thu Apr 20 02:38:45 2017 +0200
@@ -89,6 +89,8 @@
 01:24=Auto Camera On
 01:25=Press the target button to mark the target
 01:26=The utility is unavailable in Sudden Death
+; E.g. “+25” when gaining health from crate or vampirism
+01:27=+%1
 
 ; Event messages
 ; Normal hog (%1) died (0 health)