Update Zone.lua

This commit is contained in:
Frank 2023-12-21 22:33:08 +01:00
parent 8fb126682f
commit 0d18ce086c

View File

@ -2509,74 +2509,6 @@ function ZONE_POLYGON_BASE:DrawZone(Coalition, Color, Alpha, FillColor, FillAlph
end end
if self._.Polygon and #self._.Polygon >= 3 then
Coalition = Coalition or self:GetDrawCoalition()
-- Set draw coalition.
self:SetDrawCoalition(Coalition)
Color = Color or self:GetColorRGB()
Alpha = Alpha or 1
-- Set color.
self:SetColor(Color, Alpha)
FillColor = FillColor or self:GetFillColorRGB()
if not FillColor then
UTILS.DeepCopy(Color)
end
FillAlpha = FillAlpha or self:GetFillColorAlpha()
if not FillAlpha then
FillAlpha = 0.15
end
-- Set fill color -----------> has fill color worked in recent versions of DCS?
-- doing something like
--
-- trigger.action.markupToAll(7, -1, 501, p.Coords[1]:GetVec3(), p.Coords[2]:GetVec3(),p.Coords[3]:GetVec3(),p.Coords[4]:GetVec3(),{1,0,0, 1}, {1,0,0, 1}, 4, false, Text or "")
--
-- doesn't seem to fill in the shape for an n-sided polygon
self:SetFillColor(FillColor, FillAlpha)
IncludeTriangles = IncludeTriangles or false
-- just draw the triangles, we get the outline for free
if IncludeTriangles then
for _, triangle in pairs(self._Triangles) do
local draw_ids = triangle:Draw()
table.combine(self.DrawID, draw_ids)
end
-- draw outline only
else
local coords = self:GetVerticiesCoordinates()
for i = 1, #coords do
local c1 = coords[i]
local c2 = coords[i % #coords + 1]
table.add(self.DrawID, c1:LineToAll(c2, Coalition, Color, Alpha, LineType, ReadOnly))
end
end
if self._.Polygon and #self._.Polygon >= 3 then
Coalition = Coalition or self:GetDrawCoalition()
-- Set draw coalition.
self:SetDrawCoalition(Coalition)
Color = Color or self:GetColorRGB()
Alpha = Alpha or self:GetColorAlpha()
FillColor = FillColor or self:GetFillColorRGB()
FillAlpha = FillAlpha or self:GetFillColorAlpha()
if FillColor then
self:ReFill(FillColor,FillAlpha)
end
if Color then
self:ReDrawBorderline(Color,Alpha,LineType)
end
end
return self return self
end end