share/hedgewars/Data/Scripts/Multiplayer/Construction_Mode.lua
changeset 11730 8cc9c8a43dcc
parent 11729 2d57eed66d41
child 11732 e28b534188d3
child 11758 b6cf979b3377
equal deleted inserted replaced
11729:2d57eed66d41 11730:8cc9c8a43dcc
  1394 	end
  1394 	end
  1395 
  1395 
  1396 
  1396 
  1397 end
  1397 end
  1398 
  1398 
       
  1399 function onRight()
       
  1400 
       
  1401 	pIndex = pIndex + 1
       
  1402 	if pIndex > #pMode then
       
  1403 		pIndex = 1
       
  1404 	end
       
  1405 
       
  1406 	if (curWep == amGirder) or (curWep == amAirAttack) or (curWep == amNapalm) or (curWep == amDrillStrike) then
       
  1407 		showModeMessage()
       
  1408 		updateCost()
       
  1409 	end
       
  1410 
       
  1411 end
       
  1412 
  1399 function showModeMessage()
  1413 function showModeMessage()
  1400 	if CurrentHedgehog == nil then return end
  1414 	if CurrentHedgehog == nil then return end
  1401 	local val = pMode[pIndex]
  1415 	local val = pMode[pIndex]
  1402 	local str
  1416 	local str
  1403 	if cat[cIndex] == "Mine Placement Mode" then
  1417 	if cat[cIndex] == "Mine Placement Mode" then
  1404 		-- timer in seconds
  1418 		-- timer in seconds
  1405 		str = string.format(loc("%d sec"), div(val, 1000))
  1419 		str = string.format(loc("%d sec"), div(val, 1000))
       
  1420 	elseif cat[cIndex] == "Girder Placement Mode" then
       
  1421 		str = loc("Girder")
       
  1422 	elseif cat[cIndex] == "Rubber Placement Mode" then
       
  1423 		str = loc("Rubber")
  1406 	else
  1424 	else
  1407 		str = tostring(val)
  1425 		str = tostring(val)
  1408 	end
  1426 	end
  1409 	AddCaption(str,0xffba00ff,capgrpMessage2)
  1427 	AddCaption(str,0xffba00ff,capgrpMessage2)
  1410 end
  1428 end
  1411 
       
  1412 function onRight()
       
  1413 
       
  1414 	pIndex = pIndex + 1
       
  1415 	if pIndex > #pMode then
       
  1416 		pIndex = 1
       
  1417 	end
       
  1418 
       
  1419 	if (curWep == amGirder) or (curWep == amAirAttack) or (curWep == amNapalm) or (curWep == amDrillStrike) then
       
  1420 		showModeMessage()
       
  1421 		updateCost()
       
  1422 	end
       
  1423 
       
  1424 end
       
  1425 
       
  1426 
  1429 
  1427 function updatePlacementDisplay(pDir)
  1430 function updatePlacementDisplay(pDir)
  1428 
  1431 
  1429 	foundMatch = false
  1432 	foundMatch = false
  1430 	while(foundMatch == false) do
  1433 	while(foundMatch == false) do