# HG changeset patch # User Wuzzy # Date 1492648725 -7200 # Node ID 6383323fdd2c66db315b3e96945492e111e042e6 # Parent 93434ab299a09f3e5d5a65e347e3dd35ef87a717 Make health gain message translatable diff -r 93434ab299a0 -r 6383323fdd2c hedgewars/uGearsHedgehog.pas --- 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); diff -r 93434ab299a0 -r 6383323fdd2c hedgewars/uGearsUtils.pas --- 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; diff -r 93434ab299a0 -r 6383323fdd2c hedgewars/uTypes.pas --- 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, diff -r 93434ab299a0 -r 6383323fdd2c share/hedgewars/Data/Locale/en.txt --- 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)