mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge remote-tracking branch 'origin/master' into branch
This commit is contained in:
commit
2e5ffa269f
@ -154,14 +154,7 @@ function MARKEROPS_BASE:OnEventMark(Event)
|
|||||||
self:E("Skipping onEvent. Event or Event.idx unknown.")
|
self:E("Skipping onEvent. Event or Event.idx unknown.")
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
--position
|
|
||||||
if self.debug then
|
|
||||||
local vec3={y=Event.pos.y, x=Event.pos.x, z=Event.pos.z}
|
|
||||||
local coord=COORDINATE:NewFromVec3(vec3)
|
|
||||||
local coordtext = coord:ToStringLLDDM()
|
|
||||||
local text = tostring(Event.text)
|
|
||||||
local m = MESSAGE:New(string.format("Mark added at %s with text: %s",coordtext,text),10,"Info",false):ToAll()
|
|
||||||
end
|
|
||||||
local coalition = Event.MarkCoalition
|
local coalition = Event.MarkCoalition
|
||||||
-- decision
|
-- decision
|
||||||
if Event.id==world.event.S_EVENT_MARK_ADDED then
|
if Event.id==world.event.S_EVENT_MARK_ADDED then
|
||||||
@ -170,15 +163,14 @@ function MARKEROPS_BASE:OnEventMark(Event)
|
|||||||
local Eventtext = tostring(Event.text)
|
local Eventtext = tostring(Event.text)
|
||||||
if Eventtext~=nil then
|
if Eventtext~=nil then
|
||||||
if self:_MatchTag(Eventtext) then
|
if self:_MatchTag(Eventtext) then
|
||||||
local coord=COORDINATE:NewFromVec3({y=Event.pos.y, x=Event.pos.x, z=Event.pos.z})
|
local coord=COORDINATE:NewFromVec3({y=Event.pos.y, x=Event.pos.x, z=Event.pos.z})
|
||||||
if self.debug then
|
if self.debug then
|
||||||
local coordtext = coord:ToStringLLDDM()
|
local coordtext = coord:ToStringLLDDM()
|
||||||
local text = tostring(Event.text)
|
local text = tostring(Event.text)
|
||||||
local m = MESSAGE:New(string.format("Mark added at %s with text: %s",coordtext,text),10,"Info",false):ToAll()
|
local m = MESSAGE:New(string.format("Mark added at %s with text: %s",coordtext,text),10,"Info",false):ToAll()
|
||||||
end
|
end
|
||||||
local matchtable = self:_MatchKeywords(Eventtext)
|
local matchtable = self:_MatchKeywords(Eventtext)
|
||||||
local coord=COORDINATE:NewFromVec3(vec3)
|
self:MarkAdded(Eventtext,matchtable,coord,Event.idx,coalition,Event.PlayerName,Event)
|
||||||
self:MarkAdded(Eventtext,matchtable,coord,Event.idx,coalition,Event.PlayerName,Event)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif Event.id==world.event.S_EVENT_MARK_CHANGE then
|
elseif Event.id==world.event.S_EVENT_MARK_CHANGE then
|
||||||
@ -187,15 +179,14 @@ function MARKEROPS_BASE:OnEventMark(Event)
|
|||||||
local Eventtext = tostring(Event.text)
|
local Eventtext = tostring(Event.text)
|
||||||
if Eventtext~=nil then
|
if Eventtext~=nil then
|
||||||
if self:_MatchTag(Eventtext) then
|
if self:_MatchTag(Eventtext) then
|
||||||
local coord=COORDINATE:NewFromVec3({y=Event.pos.y, x=Event.pos.x, z=Event.pos.z})
|
local coord=COORDINATE:NewFromVec3({y=Event.pos.y, x=Event.pos.x, z=Event.pos.z})
|
||||||
if self.debug then
|
if self.debug then
|
||||||
local coordtext = coord:ToStringLLDDM()
|
local coordtext = coord:ToStringLLDDM()
|
||||||
local text = tostring(Event.text)
|
local text = tostring(Event.text)
|
||||||
local m = MESSAGE:New(string.format("Mark added at %s with text: %s",coordtext,text),10,"Info",false):ToAll()
|
local m = MESSAGE:New(string.format("Mark changed at %s with text: %s",coordtext,text),10,"Info",false):ToAll()
|
||||||
end
|
end
|
||||||
local matchtable = self:_MatchKeywords(Eventtext)
|
local matchtable = self:_MatchKeywords(Eventtext)
|
||||||
local coord=COORDINATE:NewFromVec3(vec3)
|
self:MarkChanged(Eventtext,matchtable,coord,Event.idx,coalition,Event.PlayerName,Event)
|
||||||
self:MarkChanged(Eventtext,matchtable,coord,Event.idx,coalition,Event.PlayerName,Event)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif Event.id==world.event.S_EVENT_MARK_REMOVED then
|
elseif Event.id==world.event.S_EVENT_MARK_REMOVED then
|
||||||
|
|||||||
@ -246,18 +246,20 @@ end
|
|||||||
function POSITIONABLE:GetVec3()
|
function POSITIONABLE:GetVec3()
|
||||||
local DCSPositionable = self:GetDCSObject()
|
local DCSPositionable = self:GetDCSObject()
|
||||||
if DCSPositionable then
|
if DCSPositionable then
|
||||||
--local status, vec3 = pcall(
|
|
||||||
-- function()
|
|
||||||
-- local vec3 = DCSPositionable:getPoint()
|
|
||||||
-- return vec3
|
|
||||||
--end
|
|
||||||
--)
|
|
||||||
local vec3 = DCSPositionable:getPoint()
|
local vec3 = DCSPositionable:getPoint()
|
||||||
--if status then
|
|
||||||
return vec3
|
if not vec3 then
|
||||||
--else
|
local pos = DCSPositionable:getPosition()
|
||||||
--self:E( { "Cannot get Vec3 from DCS Object", Positionable = self, Alive = self:IsAlive() } )
|
if pos and pos.p then
|
||||||
--end
|
vec3 = pos.p
|
||||||
|
else
|
||||||
|
self:E( { "Cannot get the position from DCS Object for GetVec3", Positionable = self, Alive = self:IsAlive() } )
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return vec3
|
||||||
|
|
||||||
end
|
end
|
||||||
-- ERROR!
|
-- ERROR!
|
||||||
self:E( { "Cannot get the Positionable DCS Object for GetVec3", Positionable = self, Alive = self:IsAlive() } )
|
self:E( { "Cannot get the Positionable DCS Object for GetVec3", Positionable = self, Alive = self:IsAlive() } )
|
||||||
@ -388,13 +390,13 @@ function POSITIONABLE:GetCoordinate()
|
|||||||
|
|
||||||
-- Get the current position.
|
-- Get the current position.
|
||||||
local PositionableVec3 = self:GetVec3()
|
local PositionableVec3 = self:GetVec3()
|
||||||
|
if PositionableVec3 then
|
||||||
local coord=COORDINATE:NewFromVec3(PositionableVec3)
|
local coord=COORDINATE:NewFromVec3(PositionableVec3)
|
||||||
local heading = self:GetHeading()
|
local heading = self:GetHeading()
|
||||||
coord.Heading = heading
|
coord.Heading = heading
|
||||||
-- Return a new coordiante object.
|
-- Return a new coordiante object.
|
||||||
return coord
|
return coord
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Error message.
|
-- Error message.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user