Zone configuration (#62)

* wip

* updates on trigger zone labels, mgrs fix, mission briefings

---------

Co-authored-by: ex61wi <tim.rorije@ing.com>
Co-authored-by: dutchie032 <dutchie032>
This commit is contained in:
2025-09-03 11:58:48 +02:00
committed by GitHub
co-authored by ex61wi dutchie032 <dutchie032>
parent 1d4c0a8313
commit bd023b46ac
10 changed files with 195 additions and 184 deletions
@@ -6,6 +6,7 @@
---@field lastUpdate number @last update time
---@field updateContinuous fun(self: MissionCommandsHelper, time: number): number @function to update commands continuously
---@field pinnedByGroup table<string, Mission> @table of pinned missions by group ID
---@field private _stageBriefings table<string, string> @table of stage briefings by stage name
---@field private _supplyHubGroups table<string, boolean> @table of supply hub groups by their ID
---@field private _logger Logger @logger instance for logging
---@field private _supplyUnitsTracker SupplyUnitsTracker @supply units tracker instance
@@ -32,6 +33,7 @@ function MissionCommandsHelper.getOrCreate(logLevel)
instance.pinnedByGroup = {}
instance.lastUpdate = 0
instance._supplyHubGroups = {}
instance._stageBriefings = {}
instance._supplyUnitsTracker = Spearhead.classes.stageClasses.helpers.SupplyUnitsTracker.getOrCreate(logLevel)
@@ -66,6 +68,14 @@ function MissionCommandsHelper.getOrCreate(logLevel)
return instance
end
function MissionCommandsHelper:AddStageBriefing(stageName, briefing)
self._stageBriefings[stageName] = briefing
end
function MissionCommandsHelper:RemoveStageBriefing(stageName)
self._stageBriefings[stageName] = nil
end
---@param mission Mission
function MissionCommandsHelper:AddMissionToCommands(mission)
self._logger:debug("Adding mission to commands: [" .. mission.code .. "]" .. mission.name)
@@ -174,6 +184,10 @@ function MissionCommandsHelper:AddOverviewCommand(groupID)
return string.format("[%s]\t%s \t%s \t%s %% \t%s nM\n", mission.code, mission.missionTypeDisplay, mission.name, mission:PercentageComplete(), distanceText)
end
for _, briefing in pairs(self._stageBriefings) do
text = text .. briefing .. "\n\n"
end
---Primary missions
text = text .. "Primary Missions\n"
for code, enabled in pairs(self.enabledByCode) do