buildable mission updates
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
local Util = require("classes.util.Util")
|
local Util = require("classes.util.Util")
|
||||||
|
local DcsUtil = require("classes.util.DcsUtil")
|
||||||
local Logger = require("classes.util.Logger")
|
local Logger = require("classes.util.Logger")
|
||||||
local GlobalConfig = require("classes.configuration.GlobalConfig")
|
local GlobalConfig = require("classes.configuration.GlobalConfig")
|
||||||
|
|
||||||
@@ -14,9 +15,6 @@ local drawingLogger = Logger.new("DrawingHelper", level)
|
|||||||
local DrawingHelper = {}
|
local DrawingHelper = {}
|
||||||
DrawingHelper.__index = DrawingHelper
|
DrawingHelper.__index = DrawingHelper
|
||||||
|
|
||||||
|
|
||||||
local customDrawingIdIncrementer = 4210
|
|
||||||
|
|
||||||
---@param object DrawingObject
|
---@param object DrawingObject
|
||||||
---@param logger Logger?
|
---@param logger Logger?
|
||||||
---@return integer? id
|
---@return integer? id
|
||||||
@@ -50,8 +48,7 @@ function DrawingHelper.Draw(object, logger)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function DrawingHelper.GetAndAddId()
|
function DrawingHelper.GetAndAddId()
|
||||||
customDrawingIdIncrementer = customDrawingIdIncrementer + 1
|
return DcsUtil.GetNextDrawID()
|
||||||
return customDrawingIdIncrementer
|
|
||||||
end
|
end
|
||||||
|
|
||||||
---@private
|
---@private
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ function BuildableMission.new(database, logger, targetZone, noLandingZone, requi
|
|||||||
self.code = tostring(database:GetNewMissionCode())
|
self.code = tostring(database:GetNewMissionCode())
|
||||||
|
|
||||||
local splitTargetZoneName = Util.split_string(targetZone.name, "_")
|
local splitTargetZoneName = Util.split_string(targetZone.name, "_")
|
||||||
if splitTargetZoneName and #splitTargetZoneName[3] then
|
if splitTargetZoneName and splitTargetZoneName[3] and splitTargetZoneName[3] ~= "" then
|
||||||
self.name = splitTargetZoneName[3]
|
self.name = splitTargetZoneName[3]
|
||||||
else
|
else
|
||||||
self.name = "Resupply"
|
self.name = "Resupply"
|
||||||
|
|||||||
@@ -632,13 +632,19 @@ do -- INIT DCS_UTIL
|
|||||||
---@field b number
|
---@field b number
|
||||||
---@field a number
|
---@field a number
|
||||||
|
|
||||||
|
|
||||||
|
local customDrawingIdIncrementer = 4210
|
||||||
|
function DCS_UTIL.GetNextDrawID()
|
||||||
|
customDrawingIdIncrementer = customDrawingIdIncrementer + 1
|
||||||
|
return customDrawingIdIncrementer
|
||||||
|
end
|
||||||
|
|
||||||
---@param groupID number
|
---@param groupID number
|
||||||
---@param text string
|
---@param text string
|
||||||
---@param location Vec3
|
---@param location Vec3
|
||||||
---@return number markID
|
---@return number markID
|
||||||
function DCS_UTIL.AddMarkToGroup(groupID, text, location)
|
function DCS_UTIL.AddMarkToGroup(groupID, text, location)
|
||||||
drawID = drawID + 1
|
local drawID = DCS_UTIL.GetNextDrawID()
|
||||||
trigger.action.markToGroup(drawID, text, location, groupID, true, nil)
|
trigger.action.markToGroup(drawID, text, location, groupID, true, nil)
|
||||||
return drawID
|
return drawID
|
||||||
end
|
end
|
||||||
@@ -648,7 +654,7 @@ do -- INIT DCS_UTIL
|
|||||||
---@param location Vec3
|
---@param location Vec3
|
||||||
---@return integer
|
---@return integer
|
||||||
function DCS_UTIL.AddMarkToAll(text, location)
|
function DCS_UTIL.AddMarkToAll(text, location)
|
||||||
drawID = drawID + 1
|
local drawID = DCS_UTIL.GetNextDrawID()
|
||||||
trigger.action.markToAll(drawID, text, location, true, nil)
|
trigger.action.markToAll(drawID, text, location, true, nil)
|
||||||
return drawID
|
return drawID
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user