mirror of
https://github.com/ciribob/DCS-CTLD.git
synced 2025-08-15 06:17:22 +00:00
Fixed new groups not getting the target lists quickly after spawn
This commit is contained in:
parent
f71649f4f0
commit
14066646e0
9
CTLD.lua
9
CTLD.lua
@ -5082,9 +5082,12 @@ function ctld.addJTACRadioCommand(_side)
|
||||
local _groupId = ctld.getGroupId(_playerUnit)
|
||||
|
||||
if _groupId then
|
||||
|
||||
local newGroup = false
|
||||
-- env.info("adding command for "..index)
|
||||
if ctld.jtacRadioAdded[tostring(_groupId)] == nil then
|
||||
-- env.info("about command for "..index)
|
||||
newGroup = true
|
||||
local JTACpath = missionCommands.addSubMenuForGroup(_groupId, ctld.jtacMenuName)
|
||||
missionCommands.addCommandForGroup(_groupId, "JTAC Status", JTACpath, ctld.getJTACStatus, { _playerUnit:getName() })
|
||||
ctld.jtacRadioAdded[tostring(_groupId)] = true
|
||||
@ -5094,8 +5097,8 @@ function ctld.addJTACRadioCommand(_side)
|
||||
--fetch the time to check for a regular refresh
|
||||
local time = timer.getTime()
|
||||
|
||||
--depending on the multiplier, this part of the radio menu will be refreshed less often or as often as the static JTAC status command, this is for better reliability for the user when navigating through the menus. New groups will get the lists regardless and if a new JTAC is added all lists will be refreshed regardless of the multiplier.
|
||||
if ctld.jtacLastRadioRefresh + ctld.jtacRadioRefreshDelay <= time or ctld.newJtac or ctld.jtacRadioAdded[tostring(_groupId)] == nil then
|
||||
--depending on the delay, this part of the radio menu will be refreshed less often or as often as the static JTAC status command, this is for better reliability for the user when navigating through the menus. New groups will get the lists regardless and if a new JTAC is added all lists will be refreshed regardless of the delay.
|
||||
if ctld.jtacLastRadioRefresh + ctld.jtacRadioRefreshDelay <= time or ctld.newJtac or newGroup then
|
||||
|
||||
ctld.jtacLastRadioRefresh = time
|
||||
|
||||
@ -5183,7 +5186,7 @@ function ctld.addJTACRadioCommand(_side)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if ctld.newJtac then
|
||||
ctld.newJtac = false
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user