Update Utils.lua

- Added parameters time zone and magvar for Sinai map
This commit is contained in:
Frank 2023-06-10 10:08:22 +02:00
parent e9adcb0dd5
commit f1fc9f0b27

View File

@ -43,7 +43,7 @@ BIGSMOKEPRESET = {
HugeSmoke=8, HugeSmoke=8,
} }
--- DCS map as returned by env.mission.theatre. --- DCS map as returned by `env.mission.theatre`.
-- @type DCSMAP -- @type DCSMAP
-- @field #string Caucasus Caucasus map. -- @field #string Caucasus Caucasus map.
-- @field #string Normandy Normandy map. -- @field #string Normandy Normandy map.
@ -53,6 +53,7 @@ BIGSMOKEPRESET = {
-- @field #string Syria Syria map. -- @field #string Syria Syria map.
-- @field #string MarianaIslands Mariana Islands map. -- @field #string MarianaIslands Mariana Islands map.
-- @field #string Falklands South Atlantic map. -- @field #string Falklands South Atlantic map.
-- @field #string Sinai Sinai map.
DCSMAP = { DCSMAP = {
Caucasus="Caucasus", Caucasus="Caucasus",
NTTR="Nevada", NTTR="Nevada",
@ -62,6 +63,7 @@ DCSMAP = {
Syria="Syria", Syria="Syria",
MarianaIslands="MarianaIslands", MarianaIslands="MarianaIslands",
Falklands="Falklands", Falklands="Falklands",
Sinai="SinaiMap"
} }
@ -1390,7 +1392,7 @@ function UTILS.TACANToFrequency(TACANChannel, TACANMode)
end end
--- Returns the DCS map/theatre as optained by env.mission.theatre --- Returns the DCS map/theatre as optained by `env.mission.theatre`.
-- @return #string DCS map name. -- @return #string DCS map name.
function UTILS.GetDCSMap() function UTILS.GetDCSMap()
return env.mission.theatre return env.mission.theatre
@ -1446,6 +1448,7 @@ end
-- * Syria +5 (East) -- * Syria +5 (East)
-- * Mariana Islands +2 (East) -- * Mariana Islands +2 (East)
-- * Falklands +12 (East) - note there's a LOT of deviation across the map, as we're closer to the South Pole -- * Falklands +12 (East) - note there's a LOT of deviation across the map, as we're closer to the South Pole
-- * Sinai +4.8 (East)
-- @param #string map (Optional) Map for which the declination is returned. Default is from env.mission.theatre -- @param #string map (Optional) Map for which the declination is returned. Default is from env.mission.theatre
-- @return #number Declination in degrees. -- @return #number Declination in degrees.
function UTILS.GetMagneticDeclination(map) function UTILS.GetMagneticDeclination(map)
@ -1470,6 +1473,8 @@ function UTILS.GetMagneticDeclination(map)
declination=2 declination=2
elseif map==DCSMAP.Falklands then elseif map==DCSMAP.Falklands then
declination=12 declination=12
elseif map==DCSMAP.Sinai then
declination=4.8
else else
declination=0 declination=0
end end
@ -1685,6 +1690,8 @@ function UTILS.GMTToLocalTimeDifference()
return 10 -- Guam is UTC+10 hours. return 10 -- Guam is UTC+10 hours.
elseif theatre==DCSMAP.Falklands then elseif theatre==DCSMAP.Falklands then
return -3 -- Fireland is UTC-3 hours. return -3 -- Fireland is UTC-3 hours.
elseif theatre==DCSMAP.Sinai then
return 2 -- Currently map is +2 but should be +3 (DCS bug?)
else else
BASE:E(string.format("ERROR: Unknown Map %s in UTILS.GMTToLocal function. Returning 0", tostring(theatre))) BASE:E(string.format("ERROR: Unknown Map %s in UTILS.GMTToLocal function. Returning 0", tostring(theatre)))
return 0 return 0