From cefd92f720fa9d29683f258da91b9dfb1fa8627f Mon Sep 17 00:00:00 2001 From: Emiliano Molina Date: Sat, 3 Dec 2016 00:16:32 +1100 Subject: [PATCH] List radio beacons when enabledRadioBeaconDrop is false. When radio beacons are programmatically generated, if option to allow the player to create beacons is not set then there was no way for the player to get the operating frequency of the programmatically generated beacons. This patch modifies addF10MenuOptions to give the user to list radio beacons when enabledRadioBaconDrop is false. If enabledRadioBeaconDrop is true then there is no change to the behaviour of the program. However if it is false then a check is made to see if deployedRadioBeacons is empty. If it is not the the user is given the option to list radio beacons but not modify them. --- CTLD.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CTLD.lua b/CTLD.lua index 03e6654..94cb5c9 100644 --- a/CTLD.lua +++ b/CTLD.lua @@ -4562,6 +4562,9 @@ function ctld.addF10MenuOptions() missionCommands.addCommandForGroup(_groupId, "List Beacons", _radioCommands, ctld.listRadioBeacons, { _unitName }) missionCommands.addCommandForGroup(_groupId, "Drop Beacon", _radioCommands, ctld.dropRadioBeacon, { _unitName }) missionCommands.addCommandForGroup(_groupId, "Remove Closet Beacon", _radioCommands, ctld.removeRadioBeacon, { _unitName }) + elseif ctld.deployedRadioBeacons ~= {} then + local _radioCommands = missionCommands.addSubMenuForGroup(_groupId, "Radio Beacons", _rootPath) + missionCommands.addCommandForGroup(_groupId, "List Beacons", _radioCommands, ctld.listRadioBeacons, { _unitName }) end ctld.addedTo[tostring(_groupId)] = true @@ -5804,4 +5807,4 @@ env.info("CTLD READY") -- for key, value in pairs(getmetatable(_spawnedCrate)) do -- env.info(tostring(key)) -- env.info(tostring(value)) --- end \ No newline at end of file +-- end