# HG changeset patch # User Wuzzy # Date 1505956049 -7200 # Node ID 39d780f9bf3524054376a5630a99b2526d374247 # Parent 3223ae85fba387737c37eaaac687f28930a37d8d Show “Empty!” when collecting ammo crate with amNothing or 0 ammo diff -r 3223ae85fba3 -r 39d780f9bf35 hedgewars/uGearsHedgehog.pas --- a/hedgewars/uGearsHedgehog.pas Thu Sep 21 01:59:49 2017 +0200 +++ b/hedgewars/uGearsHedgehog.pas Thu Sep 21 03:07:29 2017 +0200 @@ -688,18 +688,27 @@ name:= trluaammo[Ammoz[ammo].NameId] else name:= trammo[Ammoz[ammo].NameId]; - if cnt >= AMMO_INFINITE then + + if cnt = 0 then + cnt:= Ammoz[ammo].NumberInCase; + + if (ammo = amNothing) or (cnt = 0) then + s:= ansistring(trmsg[sidEmptyCrate]) + else if cnt >= AMMO_INFINITE then s:= name + ansistring(' (+∞)') - else if cnt <> 0 then - s:= name + ansistring(' (+' + IntToStr(cnt) + ')') else - s:= name + ansistring(' (+' + IntToStr(Ammoz[ammo].NumberInCase) + ')'); + s:= name + ansistring(' (+' + IntToStr(cnt) + ')'); + AddCaption(s, HH.Team^.Clan^.Color, capgrpAmmoinfo); - // show ammo icon - vga:= AddVisualGear(X, Y, vgtAmmo); - if vga <> nil then - vga^.Frame:= Longword(ammo); + // show ammo icon (if not empty) + if (ammo <> amNothing) and (cnt <> 0) then + begin + vga:= AddVisualGear(X, Y, vgtAmmo); + if vga <> nil then + vga^.Frame:= Longword(ammo); + end + end; end; diff -r 3223ae85fba3 -r 39d780f9bf35 hedgewars/uTypes.pas --- a/hedgewars/uTypes.pas Thu Sep 21 01:59:49 2017 +0200 +++ b/hedgewars/uTypes.pas Thu Sep 21 03:07:29 2017 +0200 @@ -465,7 +465,7 @@ sidNoEndTurn, sidNotYetAvailable, sidRoundSD, sidRoundsSD, sidReady, sidBounce1, sidBounce2, sidBounce3, sidBounce4, sidBounce5, sidBounce, sidMute, sidAFK, sidAutoCameraOff, sidAutoCameraOn, sidPressTarget, - sidNotAvailableInSD, sidHealthGain); + sidNotAvailableInSD, sidHealthGain, sidEmptyCrate); // 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 3223ae85fba3 -r 39d780f9bf35 share/hedgewars/Data/Locale/de.txt --- a/share/hedgewars/Data/Locale/de.txt Thu Sep 21 01:59:49 2017 +0200 +++ b/share/hedgewars/Data/Locale/de.txt Thu Sep 21 03:07:29 2017 +0200 @@ -92,6 +92,7 @@ 01:25=Zieltaste drücken, um das Ziel zu markieren 01:26=Werkzeug nicht verfügbar im Sudden Death 01:27=+%1 +01:28=Leer! ; Event messages ; Hog (%1) died diff -r 3223ae85fba3 -r 39d780f9bf35 share/hedgewars/Data/Locale/en.txt --- a/share/hedgewars/Data/Locale/en.txt Thu Sep 21 01:59:49 2017 +0200 +++ b/share/hedgewars/Data/Locale/en.txt Thu Sep 21 03:07:29 2017 +0200 @@ -91,6 +91,7 @@ 01:26=The utility is unavailable in Sudden Death ; E.g. “+25” when gaining health from crate or vampirism 01:27=+%1 +01:28=Empty! ; Event messages ; Normal hog (%1) died (0 health)