Construction Mode: Show mine timer in seconds
authorWuzzy <almikes@aol.com>
Tue, 12 Apr 2016 23:48:34 +0200
changeset 11714 8575b8b76373
parent 11713 106112bbacfa
child 11715 511d0f2aa9bf
Construction Mode: Show mine timer in seconds
share/hedgewars/Data/Scripts/Multiplayer/Construction_Mode.lua
--- a/share/hedgewars/Data/Scripts/Multiplayer/Construction_Mode.lua	Tue Apr 12 23:40:24 2016 +0200
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Construction_Mode.lua	Tue Apr 12 23:48:34 2016 +0200
@@ -1509,7 +1509,7 @@
 
 
 				AddCaption(loc(cat[cIndex]),0xffba00ff,capgrpMessage)
-				AddCaption(pMode[pIndex],0xffba00ff,capgrpMessage2)
+				showModeMessage()
 				wallsVisible = true
 			else
 				wallsVisible = false
@@ -1627,13 +1627,25 @@
 	end
 
 	if (curWep == amGirder) or (curWep == amAirAttack) or (curWep == amNapalm) or (curWep == amDrillStrike) then
-		AddCaption(pMode[pIndex],0xffba00ff,capgrpMessage2)
+		showModeMessage()
 		updateCost()
 	end
 
 
 end
 
+function showModeMessage()
+	local val = pMode[pIndex]
+	local str
+	if cat[cIndex] == "Mine Placement Mode" then
+		-- timer in seconds
+		str = string.format(loc("%d sec"), div(val, 1000))
+	else
+		str = tostring(val)
+	end
+	AddCaption(str,0xffba00ff,capgrpMessage2)
+end
+
 function onRight()
 
 	pIndex = pIndex + 1
@@ -1642,7 +1654,7 @@
 	end
 
 	if (curWep == amGirder) or (curWep == amAirAttack) or (curWep == amNapalm) or (curWep == amDrillStrike) then
-		AddCaption(pMode[pIndex],0xffba00ff,capgrpMessage2)
+		showModeMessage()
 		updateCost()
 	end