Briefing as location (#64)

* Added briefing location as primary location coords

* added pin briefing and briefing duration chagnes

* updated command menu logic, sorting and naming

---------

Co-authored-by: dutchie032 <dutchie032>
This commit is contained in:
2025-12-14 13:54:48 +01:00
committed by GitHub
co-authored by dutchie032 <dutchie032>
parent 7c5701532b
commit f0aee49de2
7 changed files with 2020 additions and 1895 deletions
+53 -46
View File
@@ -1,46 +1,53 @@
# Spearhead
## Contributing.
I'm always happy to see contributions! <br/>
Especially if you've found an issue, annoyance or feature that you know how to solve, fix or create! <br/>
### Keep it small.
Keeping your contributions small and to the point helps both me and yourself. <br/>
It'll help the PR review and the speed of improvements. <br/>
If you have a big feature in mind? Go for it! <br/>
Does it require an entire refactor of parts or all of the program? Maybe make sure to do step 0 first.
### Steps (for first timers)
0. Reach out (Optional)
If you want to let me know you want to do something to contribute, please do! <br/>
Maybe I'm already working on the thing you wanted to build, or someone else is. <br/>
Creating an issue is even better! <br/>
1. Fork the repository
By forking you can create your own working set of code. <br/>
Whether you keep that fork public or private is up to you! <br/>
Keep in mind, forking is alright, but it's best with the intent to contribute back. <br/>
After all, instead of having 5 slightly different versions and products, it might be nicer to have 1 much better version. <br/>
2. Create a Draft PR as soon as possible!
As soon as you've found some times to create an initial version, please create a draft PR. <br/>
That way you can let me and everyone know it's being worked on and people can see what conflicts might arise with their own changes. <br/>
3. Test, test, test
With DCS and Lua there's a bunch of edge cases that are really hard to get to. <br/>
However, you kinda need to make sure most if not all cases are caught and tested. <br/>
Since automated testing for now doesn't seem feasible, please make sure to verify and test functionality after touching stuff. <br/>
4. Finalise and publish the PR.
Finalise the PR and let the maintainers know! <br/>
We can all have a look and discuss the changes. <br/>
# Spearhead
## Contributing.
I'm always happy to see contributions! <br/>
Especially if you've found an issue, annoyance or feature that you know how to solve, fix or create! <br/>
### Keep it small.
Keeping your contributions small and to the point helps both me and yourself. <br/>
It'll help the PR review and the speed of improvements. <br/>
If you have a big feature in mind? Go for it! <br/>
Does it require an entire refactor of parts or all of the program? Maybe make sure to do step 0 first.
### Steps (for first timers)
0. Reach out (Optional)
If you want to let me know you want to do something to contribute, please do! <br/>
Maybe I'm already working on the thing you wanted to build, or someone else is. <br/>
Creating an issue is even better! <br/>
1. Fork the repository
By forking you can create your own working set of code. <br/>
Whether you keep that fork public or private is up to you! <br/>
Keep in mind, forking is alright, but it's best with the intent to contribute back. <br/>
After all, instead of having 5 slightly different versions and products, it might be nicer to have 1 much better version. <br/>
2. Create a Draft PR as soon as possible!
As soon as you've found some times to create an initial version, please create a draft PR. <br/>
That way you can let me and everyone know it's being worked on and people can see what conflicts might arise with their own changes. <br/>
3. Test, test, test
With DCS and Lua there's a bunch of edge cases that are really hard to get to. <br/>
However, you kinda need to make sure most if not all cases are caught and tested. <br/>
Since automated testing for now doesn't seem feasible, please make sure to verify and test functionality after touching stuff. <br/>
4. Finalise and publish the PR.
Finalise the PR and let the maintainers know! <br/>
We can all have a look and discuss the changes. <br/>
# TODO:
- Would it be possible to generate optional markers on mission briefing locations for Tomcat / Phantom navigation? Then Jester can type it in for the pilots automatically.
+34
View File
@@ -0,0 +1,34 @@
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
if Spearhead == nil then Spearhead = {} end
Spearhead.GlobalConfig = GlobalConfig.New()
+1359 -1359
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -119,7 +119,7 @@ function BuildableMission:ShowBriefing(groupID)
"\n\n" ..
"NOTE: Do not land in the orange construction zone!"
trigger.action.outTextForGroup(groupID, briefing, 30)
trigger.action.outTextForGroup(groupID, briefing, Spearhead.GlobalConfig:getBriefingTime())
end
function BuildableMission:MarkMissionAreaToGroup(groupID)
@@ -94,7 +94,7 @@ function Mission:ShowBriefing(groupId)
local text = "Mission [" ..
self.code .. "] " .. self.name .. "\n \n" .. briefing .. " \n \n" .. stateString
trigger.action.outTextForGroup(groupId, text, 30);
trigger.action.outTextForGroup(groupId, text, Spearhead.GlobalConfig:getBriefingTime());
end
@@ -143,9 +143,6 @@ if not Spearhead.classes.stageClasses.missions then Spearhead.classes.stageClass
if not Spearhead.classes.stageClasses.missions.baseMissions then Spearhead.classes.stageClasses.missions.baseMissions = {} end
Spearhead.classes.stageClasses.missions.baseMissions.Mission = Mission
do --aliases
--- @alias MissionPriority
+4
View File
@@ -4,6 +4,10 @@ SpearheadConfig = {
---DEBUG LOGGING
debugEnabled = false, -- default false
--- The time briefings should be displayed by default.
--- Players can always "Clear Messages" through the F10 menu, so setting it to a high value can be
briefingMessageDuration = 30, --default 30
CapConfig = {
--quickly enable of disable the entire CAP Logic
--(you can also just rename all units to not be named "CAP_")