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:
2026-06-06 19:26:32 +02:00
committed by GitHub
co-authored by ex61wi dutchie031 <dutchie031>
parent c027921527
commit 128aed1d2b
82 changed files with 8963 additions and 4390 deletions
+63
View File
@@ -0,0 +1,63 @@
local SpearheadEvents = require("classes.spearhead_events")
local GlobalStageManager = require("classes.stageClasses.GlobalStageManager")
---@type Array<OnMissionCompleteListener>
local MissionCompleteListeners = {}
---@class FullSpearheadAPI : SpearheadAPI
---@field Internal SpearheadAPIInternal
---@class SpearheadAPIInternal
---@field notifyMissionComplete fun(zone_name: string)
---@type FullSpearheadAPI
SpearheadAPI = {
Stages = {
changeStage = function(stageNumber)
if type(stageNumber) ~= "number" then
return false, "stageNumber " .. stageNumber .. " is not a valid number"
end
SpearheadEvents.PublishStageNumberChanged(stageNumber)
return true, ""
end,
getCurrentStage = function()
return GlobalStageManager.getCurrentStage() or nil
end,
isStageComplete = function(stageNumber)
if type(stageNumber) ~= "number" then
return false, "stageNumber " .. stageNumber .. " is not a valid number"
end
local isComplete = GlobalStageManager.isStageComplete(stageNumber)
if isComplete == nil then
return nil, "no stage found with number " .. stageNumber
end
return isComplete, ""
end
},
Missions = {
addOnMissionCompleteListener = function(listener)
if type(listener) ~= "table" or type(listener.onMissionComplete) ~= "function" then
error("listener is not a valid OnMissionCompleteListener")
end
table.insert(MissionCompleteListeners, listener)
end
},
--- Internal Functions for the API that can be called through the rest of the Framework
Internal = {
notifyMissionComplete = function(zone_name)
for _, listener in ipairs(MissionCompleteListeners) do
pcall(function()
listener:onMissionComplete(zone_name)
end)
end
end,
}
}