share/hedgewars/Data/Scripts/Multiplayer/Construction_Mode.lua
changeset 11714 8575b8b76373
parent 11713 106112bbacfa
child 11715 511d0f2aa9bf
equal deleted inserted replaced
11713:106112bbacfa 11714:8575b8b76373
  1507 					updateCost()
  1507 					updateCost()
  1508 				end
  1508 				end
  1509 
  1509 
  1510 
  1510 
  1511 				AddCaption(loc(cat[cIndex]),0xffba00ff,capgrpMessage)
  1511 				AddCaption(loc(cat[cIndex]),0xffba00ff,capgrpMessage)
  1512 				AddCaption(pMode[pIndex],0xffba00ff,capgrpMessage2)
  1512 				showModeMessage()
  1513 				wallsVisible = true
  1513 				wallsVisible = true
  1514 			else
  1514 			else
  1515 				wallsVisible = false
  1515 				wallsVisible = false
  1516 			end
  1516 			end
  1517 
  1517 
  1625 	if pIndex == 0 then
  1625 	if pIndex == 0 then
  1626 		pIndex = #pMode
  1626 		pIndex = #pMode
  1627 	end
  1627 	end
  1628 
  1628 
  1629 	if (curWep == amGirder) or (curWep == amAirAttack) or (curWep == amNapalm) or (curWep == amDrillStrike) then
  1629 	if (curWep == amGirder) or (curWep == amAirAttack) or (curWep == amNapalm) or (curWep == amDrillStrike) then
  1630 		AddCaption(pMode[pIndex],0xffba00ff,capgrpMessage2)
  1630 		showModeMessage()
  1631 		updateCost()
  1631 		updateCost()
  1632 	end
  1632 	end
  1633 
  1633 
  1634 
  1634 
       
  1635 end
       
  1636 
       
  1637 function showModeMessage()
       
  1638 	local val = pMode[pIndex]
       
  1639 	local str
       
  1640 	if cat[cIndex] == "Mine Placement Mode" then
       
  1641 		-- timer in seconds
       
  1642 		str = string.format(loc("%d sec"), div(val, 1000))
       
  1643 	else
       
  1644 		str = tostring(val)
       
  1645 	end
       
  1646 	AddCaption(str,0xffba00ff,capgrpMessage2)
  1635 end
  1647 end
  1636 
  1648 
  1637 function onRight()
  1649 function onRight()
  1638 
  1650 
  1639 	pIndex = pIndex + 1
  1651 	pIndex = pIndex + 1
  1640 	if pIndex > #pMode then
  1652 	if pIndex > #pMode then
  1641 		pIndex = 1
  1653 		pIndex = 1
  1642 	end
  1654 	end
  1643 
  1655 
  1644 	if (curWep == amGirder) or (curWep == amAirAttack) or (curWep == amNapalm) or (curWep == amDrillStrike) then
  1656 	if (curWep == amGirder) or (curWep == amAirAttack) or (curWep == amNapalm) or (curWep == amDrillStrike) then
  1645 		AddCaption(pMode[pIndex],0xffba00ff,capgrpMessage2)
  1657 		showModeMessage()
  1646 		updateCost()
  1658 		updateCost()
  1647 	end
  1659 	end
  1648 
  1660 
  1649 end
  1661 end
  1650 
  1662