mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-18 05:05:56 +00:00
Merge remote-tracking branch 'origin/master' into develop
This commit is contained in:
@@ -184,6 +184,7 @@ EVENT = {
|
|||||||
ClassName = "EVENT",
|
ClassName = "EVENT",
|
||||||
ClassID = 0,
|
ClassID = 0,
|
||||||
MissionEnd = false,
|
MissionEnd = false,
|
||||||
|
CreateMarkCoordinateOnEvent = false,
|
||||||
}
|
}
|
||||||
|
|
||||||
world.event.S_EVENT_NEW_CARGO = world.event.S_EVENT_MAX + 1000
|
world.event.S_EVENT_NEW_CARGO = world.event.S_EVENT_MAX + 1000
|
||||||
@@ -1063,36 +1064,6 @@ end
|
|||||||
|
|
||||||
do -- Event Creation
|
do -- Event Creation
|
||||||
|
|
||||||
--- Creation of a New Cargo Event.
|
|
||||||
-- @param #EVENT self
|
|
||||||
-- @param AI.AI_Cargo#AI_CARGO Cargo The Cargo created.
|
|
||||||
function EVENT:CreateEventNewCargo( Cargo )
|
|
||||||
self:F( { Cargo } )
|
|
||||||
|
|
||||||
local Event = {
|
|
||||||
id = EVENTS.NewCargo,
|
|
||||||
time = timer.getTime(),
|
|
||||||
cargo = Cargo,
|
|
||||||
}
|
|
||||||
|
|
||||||
world.onEvent( Event )
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Creation of a Cargo Deletion Event.
|
|
||||||
-- @param #EVENT self
|
|
||||||
-- @param AI.AI_Cargo#AI_CARGO Cargo The Cargo created.
|
|
||||||
function EVENT:CreateEventDeleteCargo( Cargo )
|
|
||||||
self:F( { Cargo } )
|
|
||||||
|
|
||||||
local Event = {
|
|
||||||
id = EVENTS.DeleteCargo,
|
|
||||||
time = timer.getTime(),
|
|
||||||
cargo = Cargo,
|
|
||||||
}
|
|
||||||
|
|
||||||
world.onEvent( Event )
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Creation of a New Zone Event.
|
--- Creation of a New Zone Event.
|
||||||
-- @param #EVENT self
|
-- @param #EVENT self
|
||||||
-- @param Core.Zone#ZONE_BASE Zone The Zone created.
|
-- @param Core.Zone#ZONE_BASE Zone The Zone created.
|
||||||
@@ -1361,7 +1332,8 @@ function EVENT:onEvent( Event )
|
|||||||
Event.IniDynamicCargoName = Event.IniUnitName
|
Event.IniDynamicCargoName = Event.IniUnitName
|
||||||
Event.IniPlayerName = string.match(Event.IniUnitName,"^(.+)|%d%d:%d%d|PKG%d+")
|
Event.IniPlayerName = string.match(Event.IniUnitName,"^(.+)|%d%d:%d%d|PKG%d+")
|
||||||
else
|
else
|
||||||
Event.IniUnit = CARGO:FindByName( Event.IniDCSUnitName )
|
--Event.IniUnit = CARGO:FindByName( Event.IniDCSUnitName )
|
||||||
|
Event.IniUnit = STATIC:FindByName( Event.IniDCSUnitName, false )
|
||||||
end
|
end
|
||||||
Event.IniCoalition = Event.IniDCSUnit:getCoalition()
|
Event.IniCoalition = Event.IniDCSUnit:getCoalition()
|
||||||
Event.IniCategory = Event.IniDCSUnit:getDesc().category
|
Event.IniCategory = Event.IniDCSUnit:getDesc().category
|
||||||
@@ -1374,7 +1346,9 @@ function EVENT:onEvent( Event )
|
|||||||
Event.IniDCSUnit = Event.initiator
|
Event.IniDCSUnit = Event.initiator
|
||||||
Event.IniDCSUnitName = ( Event.IniDCSUnit and Event.IniDCSUnit.getName ) and Event.IniDCSUnit:getName() or "Scenery no name "..math.random(1,20000)
|
Event.IniDCSUnitName = ( Event.IniDCSUnit and Event.IniDCSUnit.getName ) and Event.IniDCSUnit:getName() or "Scenery no name "..math.random(1,20000)
|
||||||
Event.IniUnitName = Event.IniDCSUnitName
|
Event.IniUnitName = Event.IniDCSUnitName
|
||||||
Event.IniUnit = SCENERY:Register( Event.IniDCSUnitName, Event.initiator )
|
local ID = (Event.IniDCSUnit and Event.IniDCSUnit.getID) and Event.IniDCSUnit:getID() or Event.IniDCSUnitName
|
||||||
|
Event.IniUnit = (_SCENERY ~= nil) and _SCENERY[ID] or nil
|
||||||
|
--Event.IniUnit = SCENERY:Register( Event.IniDCSUnitName, Event.initiator )
|
||||||
Event.IniCategory = (Event.IniDCSUnit and Event.IniDCSUnit.getDesc ) and Event.IniDCSUnit:getDesc().category
|
Event.IniCategory = (Event.IniDCSUnit and Event.IniDCSUnit.getDesc ) and Event.IniDCSUnit:getDesc().category
|
||||||
Event.IniTypeName = (Event.initiator and Event.initiator.isExist
|
Event.IniTypeName = (Event.initiator and Event.initiator.isExist
|
||||||
and Event.initiator:isExist() and Event.IniDCSUnit and Event.IniDCSUnit.getTypeName) and Event.IniDCSUnit:getTypeName() or "SCENERY"
|
and Event.initiator:isExist() and Event.IniDCSUnit and Event.IniDCSUnit.getTypeName) and Event.IniDCSUnit:getTypeName() or "SCENERY"
|
||||||
@@ -1478,7 +1452,9 @@ function EVENT:onEvent( Event )
|
|||||||
Event.TgtDCSUnitName = Event.TgtDCSUnit.getName and Event.TgtDCSUnit:getName() or nil
|
Event.TgtDCSUnitName = Event.TgtDCSUnit.getName and Event.TgtDCSUnit:getName() or nil
|
||||||
if Event.TgtDCSUnitName~=nil then
|
if Event.TgtDCSUnitName~=nil then
|
||||||
Event.TgtUnitName = Event.TgtDCSUnitName
|
Event.TgtUnitName = Event.TgtDCSUnitName
|
||||||
Event.TgtUnit = SCENERY:Register( Event.TgtDCSUnitName, Event.target )
|
local ID = (Event.TgtDCSUnit and Event.TgtDCSUnit.getID) and Event.TgtDCSUnit:getID() or Event.TgtDCSUnitName
|
||||||
|
--Event.TgtUnit = SCENERY:Register( Event.TgtDCSUnitName, Event.target )
|
||||||
|
Event.TgtUnit = (_SCENERY ~= nil) and _SCENERY[ID] or nil
|
||||||
Event.TgtCategory = Event.TgtDCSUnit:getDesc().category
|
Event.TgtCategory = Event.TgtDCSUnit:getDesc().category
|
||||||
Event.TgtTypeName = Event.TgtDCSUnit:getTypeName()
|
Event.TgtTypeName = Event.TgtDCSUnit:getTypeName()
|
||||||
end
|
end
|
||||||
@@ -1519,7 +1495,9 @@ function EVENT:onEvent( Event )
|
|||||||
if Event.idx then
|
if Event.idx then
|
||||||
Event.MarkID=Event.idx
|
Event.MarkID=Event.idx
|
||||||
Event.MarkVec3=Event.pos
|
Event.MarkVec3=Event.pos
|
||||||
Event.MarkCoordinate=COORDINATE:NewFromVec3(Event.pos)
|
if self.CreateMarkCoordinateOnEvent == true then
|
||||||
|
Event.MarkCoordinate=COORDINATE:NewFromVec3(Event.pos)
|
||||||
|
end
|
||||||
Event.MarkText=Event.text
|
Event.MarkText=Event.text
|
||||||
Event.MarkCoalition=Event.coalition
|
Event.MarkCoalition=Event.coalition
|
||||||
Event.IniCoalition=Event.coalition
|
Event.IniCoalition=Event.coalition
|
||||||
|
|||||||
Reference in New Issue
Block a user