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.
This commit is contained in:
Emiliano Molina 2016-12-03 00:16:32 +11:00
parent df8f19ee38
commit cefd92f720

View File

@ -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
-- end