Dcs lua tool (#66)
* custom drawings and animations for video * wip * Work in progress refactor for toolkit * wip * Refactored everything for Lua Compile Tool * Trying out the github action * updated the github action ref * initial working version --------- Co-authored-by: ex61wi <tim.rorije@ing.com> Co-authored-by: dutchie031 <dutchie031>
This commit is contained in:
committed by
GitHub
co-authored by
ex61wi
dutchie031 <dutchie031>
parent
c027921527
commit
128aed1d2b
@@ -0,0 +1,98 @@
|
||||
|
||||
---@class CapConfig
|
||||
---@field private _isEnabled boolean
|
||||
---@field private _minSpeed number
|
||||
---@field private _maxSpeed number
|
||||
---@field private _minAlt number
|
||||
---@field private _maxAlt number
|
||||
---@field private _minDurationOnStation number
|
||||
---@field private _maxDurationOnStation number
|
||||
---@field private _maxDeviationRange number
|
||||
---@field private _rearmDelay number
|
||||
---@field private _repairDelay number
|
||||
---@field private _deathDelay number
|
||||
local CapConfig = {};
|
||||
CapConfig.__index = CapConfig
|
||||
|
||||
---@return CapConfig
|
||||
function CapConfig.new()
|
||||
local self = setmetatable({}, CapConfig)
|
||||
|
||||
if SpearheadConfig == nil then SpearheadConfig = {} end
|
||||
if SpearheadConfig.CapConfig == nil then SpearheadConfig.CapConfig = {} end
|
||||
|
||||
local enabled = SpearheadConfig.CapConfig.enabled
|
||||
if enabled == nil then enabled = true end
|
||||
self._isEnabled = enabled
|
||||
|
||||
self._minSpeed = (tonumber(SpearheadConfig.CapConfig.minSpeed) or 400) * 0.514444
|
||||
self._maxSpeed = (tonumber(SpearheadConfig.CapConfig.maxSpeed) or 400) * 0.514444
|
||||
|
||||
self._minAlt = (tonumber(SpearheadConfig.CapConfig.minAlt) or 18000) * 0.3048
|
||||
self._maxAlt = (tonumber(SpearheadConfig.CapConfig.maxAlt) or 28000) * 0.3048
|
||||
|
||||
self._minDurationOnStation = 1200
|
||||
self._maxDurationOnStation = 2700
|
||||
|
||||
self._maxDeviationRange = 35 * 1852 -- in meters
|
||||
self._rearmDelay = tonumber(SpearheadConfig.CapConfig.rearmDelay) or 600
|
||||
self._repairDelay = tonumber(SpearheadConfig.CapConfig.repairDelay) or 600
|
||||
self._deathDelay = tonumber(SpearheadConfig.CapConfig.deathDelay) or 1800
|
||||
|
||||
return self;
|
||||
end
|
||||
|
||||
function CapConfig:isEnabled()
|
||||
return self._isEnabled
|
||||
end
|
||||
|
||||
---@return number
|
||||
function CapConfig:getMinSpeed()
|
||||
return self._minSpeed
|
||||
end
|
||||
|
||||
---@return number
|
||||
function CapConfig:getMaxSpeed()
|
||||
return self._maxSpeed
|
||||
end
|
||||
|
||||
---@return number
|
||||
function CapConfig:getMinAlt()
|
||||
return self._minAlt
|
||||
end
|
||||
|
||||
---@return number
|
||||
function CapConfig:getMaxAlt()
|
||||
return self._maxAlt
|
||||
end
|
||||
|
||||
---@return number
|
||||
function CapConfig:getMinDurationOnStation()
|
||||
return self._minDurationOnStation
|
||||
end
|
||||
|
||||
---@return number
|
||||
function CapConfig:getMaxDurationOnStation()
|
||||
return self._maxDurationOnStation
|
||||
end
|
||||
|
||||
---@return number
|
||||
function CapConfig:getMaxDeviationRange()
|
||||
return self._maxDeviationRange
|
||||
end
|
||||
|
||||
---@return number
|
||||
function CapConfig:getRearmDelay()
|
||||
return self._rearmDelay
|
||||
end
|
||||
|
||||
function CapConfig:getRepairDelay()
|
||||
return self._repairDelay
|
||||
end
|
||||
|
||||
---@return number
|
||||
function CapConfig:getDeathDelay()
|
||||
return self._deathDelay
|
||||
end
|
||||
|
||||
return CapConfig
|
||||
@@ -0,0 +1,33 @@
|
||||
|
||||
|
||||
|
||||
local briefingMessageTime = nil
|
||||
|
||||
---@class GlobalConfig
|
||||
---@field private _briefingTime number ;
|
||||
local GlobalConfig = {}
|
||||
GlobalConfig.__index = GlobalConfig;
|
||||
|
||||
---@return GlobalConfig
|
||||
function GlobalConfig.New()
|
||||
|
||||
local self = setmetatable({}, GlobalConfig)
|
||||
|
||||
self._briefingTime = 30
|
||||
|
||||
if SpearheadConfig then
|
||||
if SpearheadConfig.briefingMessageDuration then
|
||||
self._briefingTime = SpearheadConfig.briefingMessageDuration
|
||||
end
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
function GlobalConfig:getBriefingTime()
|
||||
return self._briefingTime or 30
|
||||
end
|
||||
|
||||
|
||||
return GlobalConfig
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
|
||||
--- @class StageConfig
|
||||
--- @field isEnabled boolean
|
||||
--- @field isDrawStagesEnabled boolean
|
||||
--- @field isDrawPreActivatedEnabled boolean
|
||||
--- @field isAutoStages boolean
|
||||
--- @field startingStage integer
|
||||
--- @field maxMissionsPerStage integer
|
||||
--- @field AmountPreactivateStage integer
|
||||
local StageConfig = {};
|
||||
|
||||
---comment
|
||||
---@return StageConfig
|
||||
function StageConfig:new()
|
||||
|
||||
if SpearheadConfig == nil then SpearheadConfig = {} end
|
||||
if SpearheadConfig.StageConfig == nil then SpearheadConfig.StageConfig = {} end
|
||||
|
||||
---@type StageConfig
|
||||
local o = {
|
||||
isEnabled = SpearheadConfig.StageConfig.enabled or true,
|
||||
isDrawStagesEnabled = SpearheadConfig.StageConfig.drawStages or true,
|
||||
isAutoStages = SpearheadConfig.StageConfig.autoStages or true,
|
||||
startingStage = SpearheadConfig.StageConfig.startingStage or 1,
|
||||
maxMissionsPerStage = SpearheadConfig.StageConfig.maxMissionStage or 10,
|
||||
isDrawPreActivatedEnabled = SpearheadConfig.StageConfig.drawPreActivated or true,
|
||||
AmountPreactivateStage = SpearheadConfig.StageConfig.preactivateStage or 1,
|
||||
}
|
||||
|
||||
setmetatable(o, { __index = self })
|
||||
|
||||
return o;
|
||||
end
|
||||
|
||||
return StageConfig
|
||||
Reference in New Issue
Block a user