Develop to Main (#32)

Reviewed-on: #32
Co-authored-by: dutchie031 <timrorije@gmail.com>
This commit was merged in pull request #32.
This commit is contained in:
2026-08-20 15:00:07 +00:00
committed by dutchie031
parent 7475c03db2
commit f7ff367f5b
36 changed files with 1168 additions and 540 deletions
-69
View File
@@ -173,10 +173,6 @@ do -- INIT DCS_UTIL
verts = enlargedPoints
}
if SpearheadConfig and SpearheadConfig.debugEnabled == true then
DCS_UTIL.DrawZone(triggerZone, { r = 0, g = 1, b = 0, a = 1 }, { a = 0, r = 0, g = 1, b = 0 }, 1)
end
DCS_UTIL.__airbaseZonesByName[name] = triggerZone
end
end
@@ -636,71 +632,6 @@ do -- INIT DCS_UTIL
---@field b number
---@field a number
local drawID = 400
---@param zone SpearheadTriggerZone
---@param lineColor DrawColor
---@param fillColor DrawColor
---@param lineStyle LineType
---@return number drawID
function DCS_UTIL.DrawZone(zone, lineColor, fillColor, lineStyle)
if lineStyle == nil then lineStyle = 4 end
drawID = drawID + 1
if zone.zone_type == "Cilinder" then
trigger.action.circleToAll(-1, drawID, { x = zone.location.x, y = 0, z = zone.location.y }, zone.radius,
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, lineStyle, true)
else
local functionString = "trigger.action.markupToAll(7, -1, " .. drawID .. ","
for _, vecpoint in pairs(zone.verts) do
functionString = functionString .. " { x=" .. vecpoint.x .. ", y=0,z=" .. vecpoint.y .. "},"
end
functionString = functionString .. "{0,1,0,1}, {0,1,0,1}, " .. lineStyle .. ")"
---@diagnostic disable-next-line: deprecated
local f, err = loadstring(functionString)
if f then
f()
else
env.error("Something failed when drawing complex drawing" .. err)
end
end
local fillColorMapped = {
fillColor.r or 0,
fillColor.g or 0,
fillColor.b or 0,
fillColor.a or 0.5
}
local lineColorMapped = {
lineColor.r or 0,
lineColor.g or 0,
lineColor.b or 0,
lineColor.a or 1
}
trigger.action.setMarkupColorFill(drawID, fillColorMapped)
trigger.action.setMarkupColor(drawID, lineColorMapped)
return drawID
end
---@param start Vec3
---@param finish Vec3
---@param lineColor DrawColor
---@param lineStyle LineType
function DCS_UTIL.DrawLine(start, finish, lineColor, lineStyle)
if lineStyle == nil then lineStyle = 4 end
drawID = drawID + 1
local lineColorMapped = {
lineColor.r or 0,
lineColor.g or 0,
lineColor.b or 0,
lineColor.a or 1
}
trigger.action.lineToAll(-1, drawID, start, finish, lineColorMapped, lineStyle)
return drawID
end
---@param groupID number
---@param text string