Add test codes for display range zone(s) and its sections.
This commit is contained in:
@@ -25,6 +25,38 @@ Range = {
|
|||||||
|
|
||||||
do
|
do
|
||||||
function Range:New()
|
function Range:New()
|
||||||
|
local zoneGroupNamePrefix = 'RangeZone'
|
||||||
|
for i=1,10,1 do
|
||||||
|
local zoneGroupName = zoneGroupNamePrefix..i
|
||||||
|
local points = Utils.getWayPoints(zoneGroupName)
|
||||||
|
if not points then
|
||||||
|
break
|
||||||
|
end
|
||||||
|
|
||||||
|
for j=1,100,1 do
|
||||||
|
local sectionName = '-Urban-'..j
|
||||||
|
|
||||||
|
points = Utils.getWayPoints(zoneGroupName..sectionName)
|
||||||
|
if points then
|
||||||
|
Range.drawPolygon(points)
|
||||||
|
trigger.action.textToAll(-1,Utils.getMarkID(),Utils.makeVec3(points[1]),{1,1,1,1},{0,0,0,0},8,false,sectionName)
|
||||||
|
end
|
||||||
|
|
||||||
|
sectionName = '-Tree-'..j
|
||||||
|
points = Utils.getWayPoints(zoneGroupName..sectionName)
|
||||||
|
if points then
|
||||||
|
Range.drawPolygon(points)
|
||||||
|
trigger.action.textToAll(-1,Utils.getMarkID(),Utils.makeVec3(points[1]),{1,1,1,1},{0,0,0,0},8,false,sectionName)
|
||||||
|
end
|
||||||
|
|
||||||
|
sectionName = '-Open-'..j
|
||||||
|
points = Utils.getWayPoints(zoneGroupName..sectionName)
|
||||||
|
if points then
|
||||||
|
Range.drawPolygon(points)
|
||||||
|
trigger.action.textToAll(-1,Utils.getMarkID(),Utils.makeVec3(points[1]),{1,1,1,1},{0,0,0,0},8,false,sectionName)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -40,6 +72,26 @@ do
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function Range.drawPolygon(points)
|
||||||
|
local regionPolygonID = Utils.getMarkID()
|
||||||
|
|
||||||
|
if #points == 3 then
|
||||||
|
trigger.action.rectToAll(-1,regionPolygonID,points[1],points[2],points[3],{0,1,0,1},{0,1,0,0.3},1)
|
||||||
|
end
|
||||||
|
|
||||||
|
if #points == 4 then
|
||||||
|
trigger.action.quadToAll(-1,regionPolygonID,
|
||||||
|
points[1],
|
||||||
|
points[2],
|
||||||
|
points[3],
|
||||||
|
points[4],
|
||||||
|
{0,1,0,1},{0,1,0,0.3},1)
|
||||||
|
end
|
||||||
|
|
||||||
|
if #points > 4 then
|
||||||
|
Utils.drawPolygon(-1,regionPolygonID,points,{0,1,0,1},{0,1,0,0.3},1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Range:New()
|
||||||
end
|
end
|
||||||
Reference in New Issue
Block a user