share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.lua
changeset 13127 a7b67247784d
parent 13126 b1de2f84e130
child 13129 9a328734e469
equal deleted inserted replaced
13126:b1de2f84e130 13127:a7b67247784d
   592 local portalDistance = 5000/5
   592 local portalDistance = 5000/5
   593 local helpDisabled = false  --determines whether help popups pop up
   593 local helpDisabled = false  --determines whether help popups pop up
   594 local CG = nil -- this is the visual gear displayed at CursorX, CursorY
   594 local CG = nil -- this is the visual gear displayed at CursorX, CursorY
   595 local crateSprite = nil-- this is a visual gear aid for crate placement
   595 local crateSprite = nil-- this is a visual gear aid for crate placement
   596 local crateSpriteBorer = nil
   596 local crateSpriteBorer = nil
       
   597 local waypointPreviewSprite = nil
   597 
   598 
   598 local cGear = nil -- detects placement of girders and objects (using airattack)
   599 local cGear = nil -- detects placement of girders and objects (using airattack)
   599 local curWep = amNothing
   600 local curWep = amNothing
   600 local leftHeld = false
   601 local leftHeld = false
   601 local rightHeld = false
   602 local rightHeld = false
   652 local sGear = nil
   653 local sGear = nil
   653 local closestDist
   654 local closestDist
   654 local closestGear = nil
   655 local closestGear = nil
   655 local closestSpriteID = nil
   656 local closestSpriteID = nil
   656 
   657 
       
   658 local wpRadius = 450
       
   659 
   657 ------------------------
   660 ------------------------
   658 -- SOME GENERAL METHODS
   661 -- SOME GENERAL METHODS
   659 ------------------------
   662 ------------------------
   660 
   663 
   661 function BoolToString(boo)
   664 function BoolToString(boo)
   900 	placedHWMapFlag[placedCount] = 0
   903 	placedHWMapFlag[placedCount] = 0
   901 
   904 
   902 	placedSprite[placedCount] = vgtCircle
   905 	placedSprite[placedCount] = vgtCircle
   903 	placedSpec[placedCount] = AddVisualGear(x,y,vgtCircle,0,true)
   906 	placedSpec[placedCount] = AddVisualGear(x,y,vgtCircle,0,true)
   904 	placedTint[placedCount] = 0xFF0000FF
   907 	placedTint[placedCount] = 0xFF0000FF
   905 	placedFrame[placedCount] = 1										--rad is 450
   908 	placedFrame[placedCount] = 1
   906 	SetVisualGearValues(placedSpec[placedCount], x, y, 164, 224, 1, 10, 0, 450, 5, placedTint[placedCount])
   909 	SetVisualGearValues(placedSpec[placedCount], x, y, 164, 224, 1, 10, 0, wpRadius, 5, placedTint[placedCount])
   907 	placedCount = placedCount +1
   910 	placedCount = placedCount +1
   908 
   911 
   909 end
   912 end
   910 
   913 
   911 function LoadSprite(pX, pY, pSprite, pFrame, pTint, p1, p2, p3, pLandFlags)
   914 function LoadSprite(pX, pY, pSprite, pFrame, pTint, p1, p2, p3, pLandFlags)
  2971 					tempFrame = tArr[pIndex][3]
  2974 					tempFrame = tArr[pIndex][3]
  2972 				else
  2975 				else
  2973 					-- Use default ammo icon
  2976 					-- Use default ammo icon
  2974 					tempFrame = tArr[pIndex][1] - 1
  2977 					tempFrame = tArr[pIndex][1] - 1
  2975 				end
  2978 				end
       
  2979 			end
       
  2980 
       
  2981 			-- Waypoint outline
       
  2982 			if (cat[cIndex] == loc("Waypoint Editing Mode")) and (pMode[pIndex] == loc("Place Waypoint")) then
       
  2983 				if not waypointPreviewSprite then
       
  2984 					waypointPreviewSprite = AddVisualGear(CursorX, CursorY, vgtCircle, 1, true)
       
  2985 					SetVisualGearValues(waypointPreviewSprite, CursorX, CursorY, 244, 224, 0, 0, 0, wpRadius/5, 5, 0xFF0000FF)
       
  2986 				end
       
  2987 			elseif waypointPreviewSprite then
       
  2988 				DeleteVisualGear(waypointPreviewSprite)
       
  2989 				waypointPreviewSprite = nil
       
  2990 			end
       
  2991 			if waypointPreviewSprite then
       
  2992 				SetVisualGearValues(waypointPreviewSprite, CursorX, CursorY)
  2976 			end
  2993 			end
  2977 
  2994 
  2978 		else
  2995 		else
  2979 			SetSoundMask(sndIncoming, false)
  2996 			SetSoundMask(sndIncoming, false)
  2980 			if CG ~= nil then
  2997 			if CG ~= nil then