@jtff/miztemplate-lib 3.8.6 → 3.8.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lua/lib/Moose_.lua +271 -46
- package/lua/lib/Splash_Damage_main.lua +7697 -4268
- package/lua/src/020-mission_functions.lua +1 -1
- package/lua/src/130-airboss.lua +1 -1
- package/lua/src/160-atis.lua +83 -1
- package/package.json +1 -1
|
@@ -48,7 +48,7 @@ if (not(SRSConfig)) then
|
|
|
48
48
|
jtff_log.error(string.format("Local SRS config not specified ! Initializing empty values for SRS"), "Initialization")
|
|
49
49
|
SRSConfig= {
|
|
50
50
|
port = 5002,
|
|
51
|
-
path = "C:/Program Files/DCS-SimpleRadio-Standalone",
|
|
51
|
+
path = "C:/Program Files/DCS-SimpleRadio-Standalone/ExternalAudio",
|
|
52
52
|
ip = "127.0.0.1",
|
|
53
53
|
}
|
|
54
54
|
end
|
package/lua/src/130-airboss.lua
CHANGED
|
@@ -77,7 +77,7 @@ end
|
|
|
77
77
|
|
|
78
78
|
function getCaseTypeFromWeather(CVNCoordinates, recovery_start, recovery_stop)
|
|
79
79
|
if (CVNCoordinates) then
|
|
80
|
-
if (type(CVNCoordinates:GetSunset(true)) ~= "nil" and type(CVNCoordinates:GetSunrise(true)) ~= "nil" ) then
|
|
80
|
+
if (type(tonumber(CVNCoordinates:GetSunset(true))) ~= "nil" and type(tonumber(CVNCoordinates:GetSunrise(true))) ~= "nil" ) then
|
|
81
81
|
if ((timer.getAbsTime() >= (tonumber(CVNCoordinates:GetSunset(true)) - 30*60)) or (timer.getAbsTime() <= (tonumber(CVNCoordinates:GetSunrise(true)) + 30*60))) then
|
|
82
82
|
--Navy Night conditions
|
|
83
83
|
jtff_log.info("CASE III weather : Navy Night", "AIRBOSS")
|
package/lua/src/160-atis.lua
CHANGED
|
@@ -1,12 +1,73 @@
|
|
|
1
1
|
-- *****************************************************************************
|
|
2
2
|
-- ** ATIS **
|
|
3
3
|
-- *********************************************************
|
|
4
|
+
--- Enable ATIS for a specific airbase.
|
|
5
|
+
---@param airbase string The name of the airbase for which to enable ATIS for. (MOOSE Enum)
|
|
6
|
+
function EnableAtis(airbase)
|
|
7
|
+
for _, atis in ipairs(ATISArray) do
|
|
8
|
+
if atis.customconfig.airfield == airbase then
|
|
9
|
+
-- Enable ATIS
|
|
10
|
+
atis:Start()
|
|
11
|
+
jtff_log.info(string.format("ATIS at airfield %s enabled (usually by bot).", atis.customconfig.airfield),"ATIS")
|
|
12
|
+
atis.menu[coalition.side.BLUE]:Remove()
|
|
13
|
+
atis.menu[coalition.side.BLUE] = MENU_COALITION_COMMAND:New(
|
|
14
|
+
coalition.side.BLUE,
|
|
15
|
+
"Disable Auto Atis at " .. atis.customconfig.airfield,
|
|
16
|
+
MenuCoalitionAtis[coalition.side.BLUE],
|
|
17
|
+
DisableAtis,
|
|
18
|
+
atis.customconfig.airfield
|
|
19
|
+
)
|
|
20
|
+
atis.menu[coalition.side.RED]:Remove()
|
|
21
|
+
atis.menu[coalition.side.RED] = MENU_COALITION_COMMAND:New(
|
|
22
|
+
coalition.side.RED,
|
|
23
|
+
"Disable Auto Atis at " .. atis.customconfig.airfield,
|
|
24
|
+
MenuCoalitionAtis[coalition.side.RED],
|
|
25
|
+
DisableAtis,
|
|
26
|
+
atis.customconfig.airfield
|
|
27
|
+
)
|
|
28
|
+
return true
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
--- Disable ATIS for a specific airbase.
|
|
34
|
+
---@param airbase string The name of the airbase for which to disable ATIS for. (MOOSE Enum)
|
|
35
|
+
function DisableAtis(airbase)
|
|
36
|
+
for _, atis in ipairs(ATISArray) do
|
|
37
|
+
if atis.customconfig.airfield == airbase then
|
|
38
|
+
-- Disable ATIS
|
|
39
|
+
atis:Stop()
|
|
40
|
+
jtff_log.info(string.format("ATIS at airfield %s disabled (usually by bot).", atis.customconfig.airfield),"ATIS")
|
|
41
|
+
atis.menu[coalition.side.BLUE]:Remove()
|
|
42
|
+
atis.menu[coalition.side.BLUE] = MENU_COALITION_COMMAND:New(
|
|
43
|
+
coalition.side.BLUE,
|
|
44
|
+
"Enable Auto Atis at " .. atis.customconfig.airfield,
|
|
45
|
+
MenuCoalitionAtis[coalition.side.BLUE],
|
|
46
|
+
EnableAtis,
|
|
47
|
+
atis.customconfig.airfield
|
|
48
|
+
)
|
|
49
|
+
atis.menu[coalition.side.RED]:Remove()
|
|
50
|
+
atis.menu[coalition.side.RED] = MENU_COALITION_COMMAND:New(
|
|
51
|
+
coalition.side.RED,
|
|
52
|
+
"Enable Auto Atis at " .. atis.customconfig.airfield,
|
|
53
|
+
MenuCoalitionAtis[coalition.side.RED],
|
|
54
|
+
EnableAtis,
|
|
55
|
+
atis.customconfig.airfield
|
|
56
|
+
)
|
|
57
|
+
return true
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
4
62
|
ATISArray = {}
|
|
5
63
|
compteur = 0
|
|
64
|
+
MenuCoalitionAtis = {}
|
|
65
|
+
MenuCoalitionAtis[coalition.side.BLUE] = MENU_COALITION:New(coalition.side.BLUE, "Atis", MenuCoalitionBlue)
|
|
66
|
+
MenuCoalitionAtis[coalition.side.RED] = MENU_COALITION:New(coalition.side.RED, "Atis", MenuCoalitionRed)
|
|
6
67
|
for index, atisconfig in ipairs(AtisConfig) do
|
|
7
68
|
if atisconfig.enable == true then
|
|
8
69
|
compteur = compteur + 1
|
|
9
|
-
|
|
70
|
+
jtff_log.info(string.format("Creation ATIS at airfield %s", atisconfig.airfield),"ATIS")
|
|
10
71
|
local objAtis = ATIS:New(atisconfig.airfield, atisconfig.radio.freq, atisconfig.radio.modulation)
|
|
11
72
|
:SetImperialUnits()
|
|
12
73
|
:SetSoundfilesPath(soundFilesPrefix .. 'ATIS/ATIS Soundfiles/')
|
|
@@ -47,7 +108,28 @@ for index, atisconfig in ipairs(AtisConfig) do
|
|
|
47
108
|
objAtis:SetSRS(SRSConfig.path, "male", "en-US", nil, SRSConfig.port)
|
|
48
109
|
end
|
|
49
110
|
objAtis.customconfig = atisconfig
|
|
111
|
+
objAtis.menu = {}
|
|
112
|
+
objAtis.menu[coalition.side.BLUE] = MENU_COALITION_COMMAND:New(
|
|
113
|
+
coalition.side.BLUE,
|
|
114
|
+
"Disable Auto Atis at " .. atisconfig.airfield,
|
|
115
|
+
MenuCoalitionAtis[coalition.side.BLUE],
|
|
116
|
+
DisableAtis,
|
|
117
|
+
atisconfig.airfield
|
|
118
|
+
)
|
|
119
|
+
objAtis.menu[coalition.side.RED] = MENU_COALITION_COMMAND:New(
|
|
120
|
+
coalition.side.RED,
|
|
121
|
+
"Disable Auto Atis at " .. atisconfig.airfield,
|
|
122
|
+
MenuCoalitionAtis[coalition.side.RED],
|
|
123
|
+
DisableAtis,
|
|
124
|
+
atisconfig.airfield
|
|
125
|
+
)
|
|
50
126
|
ATISArray[compteur] = objAtis
|
|
51
127
|
ATISArray[compteur]:Start()
|
|
52
128
|
end
|
|
53
129
|
end
|
|
130
|
+
|
|
131
|
+
if compteur == 0 then
|
|
132
|
+
MenuCoalitionAtis[coalition.side.BLUE]:Remove()
|
|
133
|
+
MenuCoalitionAtis[coalition.side.RED]:Remove()
|
|
134
|
+
MenuCoalitionAtis = {}
|
|
135
|
+
end
|