From 782cfd1fd08f1a2ca81e1f155869ba8b3f9be23f Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Mon, 14 Nov 2022 17:36:34 +0100 Subject: [PATCH 1/3] #ATIS * Added honor Stop() functionality --- Moose Development/Moose/Ops/ATIS.lua | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Moose Development/Moose/Ops/ATIS.lua b/Moose Development/Moose/Ops/ATIS.lua index c9ae8ea41..083aa86a4 100644 --- a/Moose Development/Moose/Ops/ATIS.lua +++ b/Moose Development/Moose/Ops/ATIS.lua @@ -590,7 +590,7 @@ _ATIS = {} --- ATIS class version. -- @field #string version -ATIS.version = "0.9.10" +ATIS.version = "0.9.11" ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- TODO list @@ -1319,8 +1319,10 @@ function ATIS:onafterStatus( From, Event, To ) text = text .. string.format( ", Relay unit=%s (alive=%s)", tostring( self.relayunitname ), relayunitstatus ) end self:T( self.lid .. text ) - - self:__Status( -60 ) + + if not self:Is("Stopped") then + self:__Status( -60 ) + end end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -1348,9 +1350,11 @@ function ATIS:onafterCheckQueue( From, Event, To ) end end - - -- Check back in 5 seconds. - self:__CheckQueue( -math.abs( self.dTQueueCheck ) ) + + if not self:Is("Stopped") then + -- Check back in 5 seconds. + self:__CheckQueue( -math.abs( self.dTQueueCheck ) ) + end end --- Broadcast ATIS radio message. From fbad50973f327e3103e685770073cca92bbfc09c Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Mon, 14 Nov 2022 18:15:55 +0100 Subject: [PATCH 2/3] # Bug fixes --- Moose Development/Moose/Core/Settings.lua | 2 +- Moose Development/Moose/Utilities/Utils.lua | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Moose Development/Moose/Core/Settings.lua b/Moose Development/Moose/Core/Settings.lua index eeaa3db81..671b4cfb0 100644 --- a/Moose Development/Moose/Core/Settings.lua +++ b/Moose Development/Moose/Core/Settings.lua @@ -335,7 +335,7 @@ do -- SETTINGS --- Sets the SETTINGS MGRS accuracy. -- @param #SETTINGS self - -- @param #number MGRS_Accuracy + -- @param #number MGRS_Accuracy 0 to 5 -- @return #SETTINGS function SETTINGS:SetMGRS_Accuracy( MGRS_Accuracy ) self.MGRS_Accuracy = MGRS_Accuracy diff --git a/Moose Development/Moose/Utilities/Utils.lua b/Moose Development/Moose/Utilities/Utils.lua index de5c63933..df656431b 100644 --- a/Moose Development/Moose/Utilities/Utils.lua +++ b/Moose Development/Moose/Utilities/Utils.lua @@ -606,10 +606,12 @@ end -- acc- the accuracy of each easting/northing. 0, 1, 2, 3, 4, or 5. UTILS.tostringMGRS = function(MGRS, acc) --R2.1 - if acc == 0 then + if acc <= 0 then return MGRS.UTMZone .. ' ' .. MGRS.MGRSDigraph else - + + if acc > 5 then acc = 5 end + -- Test if Easting/Northing have less than 4 digits. --MGRS.Easting=123 -- should be 00123 --MGRS.Northing=5432 -- should be 05432 From ae2196585e4ceaa8244b4442932895e3f5e6377b Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Wed, 16 Nov 2022 09:39:54 +0100 Subject: [PATCH 3/3] #MESSAGE * added to country * added a couple of countries to country.id. enumerator --- Moose Development/Moose/Core/Message.lua | 38 ++++++++++++++++++++++++ Moose Development/Moose/DCS.lua | 5 ++++ 2 files changed, 43 insertions(+) diff --git a/Moose Development/Moose/Core/Message.lua b/Moose Development/Moose/Core/Message.lua index 3c3cf4f63..51c307c2e 100644 --- a/Moose Development/Moose/Core/Message.lua +++ b/Moose Development/Moose/Core/Message.lua @@ -217,6 +217,7 @@ end --- Sends a MESSAGE to a Group. -- @param #MESSAGE self -- @param Wrapper.Group#GROUP Group to which the message is displayed. +-- @param Core.Settings#Settings Settings (Optional) Settings for message display. -- @return #MESSAGE Message object. function MESSAGE:ToGroup( Group, Settings ) self:F( Group.GroupName ) @@ -241,6 +242,7 @@ end --- Sends a MESSAGE to a Unit. -- @param #MESSAGE self -- @param Wrapper.Unit#UNIT Unit to which the message is displayed. +-- @param Core.Settings#Settings Settings (Optional) Settings for message display. -- @return #MESSAGE Message object. function MESSAGE:ToUnit( Unit, Settings ) self:F( Unit.IdentifiableName ) @@ -262,6 +264,41 @@ function MESSAGE:ToUnit( Unit, Settings ) return self end +--- Sends a MESSAGE to a Country. +-- @param #MESSAGE self +-- @param #number Country to which the message is displayed, e.g. country.id.GERMANY. For all country numbers see here: [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_enum_country) +-- @param Core.Settings#Settings Settings (Optional) Settings for message display. +-- @return #MESSAGE Message object. +function MESSAGE:ToCountry( Country, Settings ) + self:F(Country ) + if Country then + if self.MessageType then + local Settings = Settings or _SETTINGS -- Core.Settings#SETTINGS + self.MessageDuration = Settings:GetMessageTime( self.MessageType ) + self.MessageCategory = "" -- self.MessageType .. ": " + end + if self.MessageDuration ~= 0 then + self:T( self.MessageCategory .. self.MessageText:gsub("\n$",""):gsub("\n$","") .. " / " .. self.MessageDuration ) + trigger.action.outTextForCountry( Country, self.MessageCategory .. self.MessageText:gsub("\n$",""):gsub("\n$",""), self.MessageDuration, self.ClearScreen ) + end + end + return self +end + +--- Sends a MESSAGE to a Country. +-- @param #MESSAGE self +-- @param #number Country to which the message is displayed, , e.g. country.id.GERMANY. For all country numbers see here: [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_enum_country) +-- @param #boolean Condition Sends the message only if the condition is true. +-- @param Core.Settings#Settings Settings (Optional) Settings for message display. +-- @return #MESSAGE Message object. +function MESSAGE:ToCountryIf( Country, Condition, Settings ) + self:F(Country ) + if Country and Condition == true then + self:ToCountry( Country, Settings ) + end + return self +end + --- Sends a MESSAGE to the Blue coalition. -- @param #MESSAGE self -- @return #MESSAGE @@ -386,6 +423,7 @@ end --- Sends a MESSAGE to all players if the given Condition is true. -- @param #MESSAGE self +-- @param #boolean Condition -- @return #MESSAGE function MESSAGE:ToAllIf( Condition ) diff --git a/Moose Development/Moose/DCS.lua b/Moose Development/Moose/DCS.lua index 63367f674..bc5a06de1 100644 --- a/Moose Development/Moose/DCS.lua +++ b/Moose Development/Moose/DCS.lua @@ -308,6 +308,11 @@ do -- country -- @field Argentinia -- @field Cyprus -- @field Slovenia + -- @field BOLIVIA + -- @field GHANA + -- @field NIGERIA + -- @field PERU + -- @field ECUADOR country = {} --#country