share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.lua
changeset 11998 7d8dcac2eae1
parent 11997 6a67e76d0f1d
child 11999 2193619b6b13
equal deleted inserted replaced
11997:6a67e76d0f1d 11998:7d8dcac2eae1
   167 							"Team Identity Mode",
   167 							"Team Identity Mode",
   168 							"Health Modification Mode",
   168 							"Health Modification Mode",
   169 							"Sprite Testing Mode",
   169 							"Sprite Testing Mode",
   170 							"Sprite Modification Mode",
   170 							"Sprite Modification Mode",
   171 							"Sprite Placement Mode",
   171 							"Sprite Placement Mode",
   172 							"Waypoint Placement Mode"
   172 							"Waypoint Mode"
   173 							}]]
   173 							}]]
   174 
   174 
   175 -- [low]	improve support for ShoppaBalance and ConstructionMode, see ranking)
   175 -- [low]	improve support for ShoppaBalance and ConstructionMode, see ranking)
   176 
   176 
   177 -- [low] 	consider combining landflags
   177 -- [low] 	consider combining landflags
   642 				loc("Team Identity Mode"),
   642 				loc("Team Identity Mode"),
   643 				loc("Health Modification Mode"),
   643 				loc("Health Modification Mode"),
   644 				--loc("Sprite Testing Mode"),
   644 				--loc("Sprite Testing Mode"),
   645 				loc("Sprite Placement Mode"),
   645 				loc("Sprite Placement Mode"),
   646 				loc("Sprite Modification Mode"),
   646 				loc("Sprite Modification Mode"),
   647 				loc("Waypoint Placement Mode")
   647 				loc("Waypoint Mode")
   648 				}
   648 				}
   649 
   649 
   650 
   650 
   651 local pMode = {}	-- pMode contains custom subsets of the main categories
   651 local pMode = {}	-- pMode contains custom subsets of the main categories
   652 local pIndex = 1
   652 local pIndex = 1
   915 
   915 
   916 function PlaceWaypoint(x,y)
   916 function PlaceWaypoint(x,y)
   917 
   917 
   918 	placedX[placedCount] = x
   918 	placedX[placedCount] = x
   919 	placedY[placedCount] = y
   919 	placedY[placedCount] = y
   920 	placedType[placedCount] = loc("Waypoint Placement Mode")
   920 	placedType[placedCount] = loc("Waypoint Mode")
   921 	placedLandFlags[placedCount] = nil -- use this to specify waypoint type maybe
   921 	placedLandFlags[placedCount] = nil -- use this to specify waypoint type maybe
   922 	placedHWMapFlag[placedCount] = 0
   922 	placedHWMapFlag[placedCount] = 0
   923 
   923 
   924 	placedSprite[placedCount] = vgtCircle
   924 	placedSprite[placedCount] = vgtCircle
   925 	placedSpec[placedCount] = AddVisualGear(x,y,vgtCircle,0,true)
   925 	placedSpec[placedCount] = AddVisualGear(x,y,vgtCircle,0,true)
  1063 
  1063 
  1064 	closestDist = 999999999
  1064 	closestDist = 999999999
  1065 	closestSpriteID = nil -- just in case
  1065 	closestSpriteID = nil -- just in case
  1066 
  1066 
  1067 	for i = 0, (placedCount-1) do
  1067 	for i = 0, (placedCount-1) do
  1068 		if (placedType[i] == loc("Waypoint Placement Mode")) then
  1068 		if (placedType[i] == loc("Waypoint Mode")) then
  1069 				q = placedX[i] - placedX[placedCount]
  1069 				q = placedX[i] - placedX[placedCount]
  1070 				w = placedY[i] - placedY[placedCount]
  1070 				w = placedY[i] - placedY[placedCount]
  1071 				d = ( (q*q) + (w*w) )
  1071 				d = ( (q*q) + (w*w) )
  1072 				if d < closestDist then
  1072 				if d < closestDist then
  1073 					closestDist = d
  1073 					closestDist = d
  1295 			placedType[placedCount] = "bogus"
  1295 			placedType[placedCount] = "bogus"
  1296 			SelectClosestSprite()
  1296 			SelectClosestSprite()
  1297 			EraseClosestSprite()
  1297 			EraseClosestSprite()
  1298 		end
  1298 		end
  1299 
  1299 
  1300 	elseif cat[cIndex] == loc("Waypoint Placement Mode") then
  1300 	elseif cat[cIndex] == loc("Waypoint Mode") then
  1301 
  1301 
  1302 
  1302 
  1303 		if pMode[pIndex] == loc("Waypoint Deletion Mode") then
  1303 		if pMode[pIndex] == loc("Delete Waypoint") then
  1304 			EraseClosestWaypoint()
  1304 			EraseClosestWaypoint()
  1305 		else
  1305 		else
  1306 			PlaceWaypoint(x,y)
  1306 			PlaceWaypoint(x,y)
  1307 			placedCount = placedCount - 1
  1307 			placedCount = placedCount - 1
  1308 		end
  1308 		end
  1373 		pMode = {loc("LandFlag Modification Mode"),loc("Sprite Erasure Mode")}
  1373 		pMode = {loc("LandFlag Modification Mode"),loc("Sprite Erasure Mode")}
  1374 	elseif cat[cIndex] == loc("Sprite Testing Mode") or cat[cIndex] == loc("Sprite Placement Mode") then
  1374 	elseif cat[cIndex] == loc("Sprite Testing Mode") or cat[cIndex] == loc("Sprite Placement Mode") then
  1375 		for i = 1, #reducedSpriteTextArray do
  1375 		for i = 1, #reducedSpriteTextArray do
  1376 			pMode[i] = reducedSpriteTextArray[i]
  1376 			pMode[i] = reducedSpriteTextArray[i]
  1377 		end
  1377 		end
  1378 	elseif cat[cIndex] == loc("Waypoint Placement Mode") then
  1378 	elseif cat[cIndex] == loc("Waypoint Mode") then
  1379 		pMode = {loc("Standard Waypoint"), loc("Waypoint Deletion Mode")}
  1379 		pMode = {loc("Place Waypoint"), loc("Delete Waypoint")}
  1380 	end
  1380 	end
  1381 
  1381 
  1382 end
  1382 end
  1383 
  1383 
  1384 ------------------------------------------------
  1384 ------------------------------------------------
  2019 	WriteLnToConsole("	portalDistance = " .. portalDistance*5)
  2019 	WriteLnToConsole("	portalDistance = " .. portalDistance*5)
  2020 	table.insert(hFlagList, "	" .. portalDistance*5 .. " " .. ufoFuel .. " " .. 98)
  2020 	table.insert(hFlagList, "	" .. portalDistance*5 .. " " .. ufoFuel .. " " .. 98)
  2021 	WriteLnToConsole("")
  2021 	WriteLnToConsole("")
  2022 
  2022 
  2023 	for i = 0, (placedCount-1) do
  2023 	for i = 0, (placedCount-1) do
  2024 		if placedType[i] == loc("Waypoint Placement Mode") then
  2024 		if placedType[i] == loc("Waypoint Mode") then
  2025 			table.insert(waypointList,
  2025 			table.insert(waypointList,
  2026 			"	AddWayPoint(" ..
  2026 			"	AddWayPoint(" ..
  2027 				placedX[i] ..", " ..
  2027 				placedX[i] ..", " ..
  2028 				placedY[i] ..")"
  2028 				placedY[i] ..")"
  2029 				)
  2029 				)
  2542 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2542 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2543 				loc("Toggle Help: Precise+1") .. "|" ..
  2543 				loc("Toggle Help: Precise+1") .. "|" ..
  2544 				"", 1, 60000
  2544 				"", 1, 60000
  2545 				)
  2545 				)
  2546 
  2546 
  2547 	elseif cat[cIndex] == loc("Waypoint Placement Mode") then
  2547 	elseif cat[cIndex] == loc("Waypoint Mode") then
  2548 
  2548 
  2549 		ShowMission	(
  2549 		ShowMission	(
  2550 				loc("WAYPOINT PLACEMENT MODE"),
  2550 				loc("WAYPOINT MODE"),
  2551 				loc("Use this mode to waypoints"),
  2551 				loc("Use this mode to place or delete waypoints"),
  2552 				loc("Place Waypoint: [Left Click]") .. "|" ..
  2552 				loc("Place/Delete Waypoint: [Left Click]") .. "|" ..
       
  2553 				loc("Toggle Placement/Deletion: [Left], [Right]") .. "|" ..
  2553 				" " .. "|" ..
  2554 				" " .. "|" ..
  2554 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2555 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2555 				loc("Toggle Help: Precise+1") .. "|" ..
  2556 				loc("Toggle Help: Precise+1") .. "|" ..
  2556 				"", -amAirAttack, 60000
  2557 				"", -amAirAttack, 60000
  2557 				)
  2558 				)
  2599 
  2600 
  2600 		ShowMission	(
  2601 		ShowMission	(
  2601 				loc("AIR MINE PLACEMENT MODE"),
  2602 				loc("AIR MINE PLACEMENT MODE"),
  2602 				loc("Use this mode to place air mines"),
  2603 				loc("Use this mode to place air mines"),
  2603 				loc("Place Object: [Left Click]") .. "|" ..
  2604 				loc("Place Object: [Left Click]") .. "|" ..
       
  2605 				loc("Change Timer (in milliseconds): [Left], [Right]") .. "|" ..
  2604 				" " .. "|" ..
  2606 				" " .. "|" ..
  2605 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2607 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2606 				loc("Toggle Help: Precise+1") .. "|" ..
  2608 				loc("Toggle Help: Precise+1") .. "|" ..
  2607 				"", -amAirMine, 60000
  2609 				"", -amAirMine, 60000
  2608 				)
  2610 				)
  2648 
  2650 
  2649 	elseif cat[cIndex] == loc("Repositioning Mode") then
  2651 	elseif cat[cIndex] == loc("Repositioning Mode") then
  2650 
  2652 
  2651 		ShowMission	(
  2653 		ShowMission	(
  2652 				loc("REPOSITIONING MODE"),
  2654 				loc("REPOSITIONING MODE"),
  2653 				loc("Use this mode to select and reposition gears"),
  2655 				loc("Use this mode to select, reposition and delete gears"),
  2654 				loc("[Left], [Right]: Change between selection and placement mode.") .. "|" ..
  2656 				loc("Select/Place/Delete Gear: [Left Click]") .. "|" ..
       
  2657 				loc("Choose Selection/Placement/Deletion: [Left], [Right]") .. "|" ..
  2655 				" " .. "|" ..
  2658 				" " .. "|" ..
  2656 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2659 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2657 				loc("Toggle Help: Precise+1") .. "|" ..
  2660 				loc("Toggle Help: Precise+1") .. "|" ..
  2658 				"", -amAirAttack, 60000
  2661 				"", -amAirAttack, 60000
  2659 				)
  2662 				)
  2703 
  2706 
  2704 		ShowMission	(
  2707 		ShowMission	(
  2705 				loc("GOAL MODE"),
  2708 				loc("GOAL MODE"),
  2706 				loc("Use this mode to mark gears for win/lose conditions."),
  2709 				loc("Use this mode to mark gears for win/lose conditions."),
  2707 				loc("Mark/unmark gear: [Left Click]") .. "|" ..
  2710 				loc("Mark/unmark gear: [Left Click]") .. "|" ..
  2708 				loc("[Left], [Right]: Change between win/lose conditions.") .. "|" ..
  2711 				loc("Select win/lose condition: [Left], [Right]") .. "|" ..
  2709 				" " .. "|" ..
  2712 				" " .. "|" ..
  2710 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2713 				loc("Change Placement Mode: [Up], [Down]") .. "|" ..
  2711 				loc("Toggle Help: Precise+1") .. "|" ..
  2714 				loc("Toggle Help: Precise+1") .. "|" ..
  2712 				"", 3, 60000
  2715 				"", 3, 60000
  2713 				)
  2716 				)