mirror of
https://github.com/ciribob/DCS-CTLD.git
synced 2026-08-22 06:45:13 +00:00
updated test mission
This commit is contained in:
@@ -5276,12 +5276,13 @@ function ctld.addTransportF10MenuOptions(_unitName)
|
|||||||
local status, error = pcall(function()
|
local status, error = pcall(function()
|
||||||
|
|
||||||
local _unit = ctld.getTransportUnit(_unitName)
|
local _unit = ctld.getTransportUnit(_unitName)
|
||||||
|
ctld.logTrace("_unit = %s", ctld.p(_unit))
|
||||||
if _unit then
|
if _unit then
|
||||||
local _unitTypename = _unit:getTypeName()
|
local _unitTypename = _unit:getTypeName()
|
||||||
local _groupId = ctld.getGroupId(_unit)
|
local _groupId = ctld.getGroupId(_unit)
|
||||||
|
|
||||||
if _groupId then
|
if _groupId then
|
||||||
|
ctld.logTrace("_groupId = %s", ctld.p(_groupId))
|
||||||
if ctld.addedTo[tostring(_groupId)] == nil then
|
if ctld.addedTo[tostring(_groupId)] == nil then
|
||||||
|
|
||||||
local _rootPath = missionCommands.addSubMenuForGroup(_groupId, "CTLD")
|
local _rootPath = missionCommands.addSubMenuForGroup(_groupId, "CTLD")
|
||||||
@@ -7365,6 +7366,7 @@ end
|
|||||||
--- Handle world events.
|
--- Handle world events.
|
||||||
ctld.eventHandler = {}
|
ctld.eventHandler = {}
|
||||||
function ctld.eventHandler:onEvent(event)
|
function ctld.eventHandler:onEvent(event)
|
||||||
|
ctld.logTrace("ctld.eventHandler:onEvent(), event = %s", ctld.p(event))
|
||||||
if event == nil then
|
if event == nil then
|
||||||
ctld.logError("Event handler was called with a nil event!")
|
ctld.logError("Event handler was called with a nil event!")
|
||||||
return
|
return
|
||||||
@@ -7382,6 +7384,7 @@ function ctld.eventHandler:onEvent(event)
|
|||||||
local unitName = nil
|
local unitName = nil
|
||||||
if event.initiator ~= nil and event.initiator.getName then
|
if event.initiator ~= nil and event.initiator.getName then
|
||||||
unitName = event.initiator:getName()
|
unitName = event.initiator:getName()
|
||||||
|
ctld.logTrace("unitName = %s", ctld.p(unitName))
|
||||||
end
|
end
|
||||||
if not unitName then
|
if not unitName then
|
||||||
ctld.logWarning("no unitname found in event %s", ctld.p(event))
|
ctld.logWarning("no unitname found in event %s", ctld.p(event))
|
||||||
@@ -7402,6 +7405,7 @@ function ctld.eventHandler:onEvent(event)
|
|||||||
if ctld.addPlayerAircraftByType then
|
if ctld.addPlayerAircraftByType then
|
||||||
for _,aircraftType in pairs(ctld.aircraftTypeTable) do
|
for _,aircraftType in pairs(ctld.aircraftTypeTable) do
|
||||||
if aircraftType == playerTypeName then
|
if aircraftType == playerTypeName then
|
||||||
|
ctld.logTrace("adding by aircraft type, unitName = %s", ctld.p(unitName))
|
||||||
-- add transport unit to the list
|
-- add transport unit to the list
|
||||||
table.insert(ctld.transportPilotNames, unitName)
|
table.insert(ctld.transportPilotNames, unitName)
|
||||||
-- add transport radio menu
|
-- add transport radio menu
|
||||||
@@ -7412,6 +7416,7 @@ function ctld.eventHandler:onEvent(event)
|
|||||||
else
|
else
|
||||||
for _, _unitName in pairs(ctld.transportPilotNames) do
|
for _, _unitName in pairs(ctld.transportPilotNames) do
|
||||||
if _unitName == unitName then
|
if _unitName == unitName then
|
||||||
|
ctld.logTrace("adding by transportPilotNames, unitName = %s", ctld.p(unitName))
|
||||||
-- add transport radio menu
|
-- add transport radio menu
|
||||||
ctld.addTransportF10MenuOptions(unitName)
|
ctld.addTransportF10MenuOptions(unitName)
|
||||||
break
|
break
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user