Racer/TechRacer: Show best times next to team bars
authorWuzzy <Wuzzy2@mail.ru>
Sat, 17 Feb 2018 11:25:43 +0100
changeset 13027 625d5a45f267
parent 13026 ca7fdb431b34
child 13028 8b6d8418d580
Racer/TechRacer: Show best times next to team bars
ChangeLog.txt
share/hedgewars/Data/Scripts/Multiplayer/Racer.lua
share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua
--- a/ChangeLog.txt	Sat Feb 17 00:34:00 2018 +0100
+++ b/ChangeLog.txt	Sat Feb 17 11:25:43 2018 +0100
@@ -23,6 +23,7 @@
  + New voice: Default_pl (Polish)
 
 Styles and game modes:
+ + Various styles: Add current score/time next to team bars (where applicable)
  + Construction Mode: Add a few shortcuts
  + Construction Mode: Show selected object at cursor and a crate preview icon
  + Construction Mode: Remember all selections
--- a/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua	Sat Feb 17 00:34:00 2018 +0100
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua	Sat Feb 17 11:25:43 2018 +0100
@@ -461,6 +461,11 @@
                 PlaySound(sndHellish)
         end
 
+        for i = 0, (TeamsCount-1) do
+                if teamNameArr[i] ~= " " and teamScore[i] ~= 1000000 then
+                        SetTeamLabel(teamNameArr[i], string.format(loc("%.1fs"), teamScore[i]/1000))
+                end
+        end
 
         if bestTime == trackTime then
 
--- a/share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua	Sat Feb 17 00:34:00 2018 +0100
+++ b/share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua	Sat Feb 17 11:25:43 2018 +0100
@@ -429,6 +429,11 @@
                 PlaySound(sndHellish)
         end
 
+        for i = 0, (TeamsCount-1) do
+                if teamNameArr[i] ~= " " and teamScore[i] ~= 1000000 then
+                        SetTeamLabel(teamNameArr[i], string.format(loc("%.1fs"), teamScore[i]/1000))
+                end
+        end
 
         --------
         --new
@@ -1156,7 +1161,7 @@
 			-- Move camera to first waypoint.
 			-- We use a dummy gear to feed FollowGear. It does not affect the race.
 			cameraGear = AddGear(wpX[0], wpY[0], gtGenericFaller, 0, 0, 0, 5000)
-			SetState(cameraGear, bor(GetState(cameraGear), gstNoGravity+gstInvisiblee))
+			SetState(cameraGear, bor(GetState(cameraGear), gstNoGravity+gstInvisible))
 			FollowGear(cameraGear)
                 end