Reviewed-on: #18 Co-authored-by: dutchie031 <timrorije@gmail.com>
This commit was merged in pull request #18.
This commit is contained in:
@@ -220,7 +220,7 @@ function CAP.getAsTasking(groupName, airbase, capZone, capConfig)
|
||||
action = {
|
||||
id = "Script",
|
||||
params = {
|
||||
command = "pcall(Spearhead.Events.PublishOnStation, \"" .. groupName .. "\")"
|
||||
command = "pcall(GlobalCapCallBacks.PublishOnStation, \"" .. groupName .. "\")"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -260,7 +260,7 @@ function CAP.getAsTasking(groupName, airbase, capZone, capConfig)
|
||||
},
|
||||
stopCondition = {
|
||||
duration = durationBefore10,
|
||||
condition = "return Spearhead.DcsUtil.NeedsRTBInTen(\"" .. groupName .. "\", 0.10)",
|
||||
condition = "return GlobalCapCallBacks.NeedsRTBInTen(\"" .. groupName .. "\", 0.10)",
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -273,7 +273,7 @@ function CAP.getAsTasking(groupName, airbase, capZone, capConfig)
|
||||
action = {
|
||||
id = "Script",
|
||||
params = {
|
||||
command = "pcall(Spearhead.Events.PublishRTBInTen, \"" .. groupName .. "\")"
|
||||
command = "pcall(GlobalCapCallBacks.PublishRTBInTen, \"" .. groupName .. "\")"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -299,7 +299,7 @@ function CAP.getAsTasking(groupName, airbase, capZone, capConfig)
|
||||
},
|
||||
stopCondition = {
|
||||
duration = durationAfter10,
|
||||
condition = "return Spearhead.DcsUtil.IsBingoFuel(\"" .. groupName .. "\")",
|
||||
condition = "return GlobalCapCallBacks.IsBingoFuel(\"" .. groupName .. "\", 0.10)",
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -312,7 +312,7 @@ function CAP.getAsTasking(groupName, airbase, capZone, capConfig)
|
||||
action = {
|
||||
id = "Script",
|
||||
params = {
|
||||
command = "pcall(Spearhead.Events.PublishRTB, \"" .. groupName .. "\")"
|
||||
command = "pcall(GlobalCapCallBacks.PublishRTB, \"" .. groupName .. "\")"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
|
||||
local DcsUtil = require("classes.util.DcsUtil")
|
||||
local Events = require("classes.spearhead_events")
|
||||
|
||||
|
||||
GlobalCapCallBacks = {}
|
||||
|
||||
function GlobalCapCallBacks.IsBingoFuel(groupName, fuelPercent)
|
||||
return DcsUtil.IsBingoFuel(groupName, fuelPercent)
|
||||
end
|
||||
|
||||
function GlobalCapCallBacks.NeedsRTBInTen(groupName, fuelOffset)
|
||||
return DcsUtil.NeedsRTBInTen(groupName, fuelOffset)
|
||||
end
|
||||
|
||||
function GlobalCapCallBacks.PublishRTBInTen(groupName)
|
||||
return Events.PublishRTBInTen(groupName)
|
||||
end
|
||||
|
||||
function GlobalCapCallBacks.PublishRTB(groupName)
|
||||
return Events.PublishRTB(groupName)
|
||||
end
|
||||
|
||||
function GlobalCapCallBacks.PublishOnStation(groupName)
|
||||
return Events.PublishOnStation(groupName)
|
||||
end
|
||||
@@ -247,7 +247,7 @@ function INTERCEPT.getInterceptTaskPoint(groupName, currentPoint, targetPoint, a
|
||||
action = {
|
||||
id = "Script",
|
||||
params = {
|
||||
command = "pcall(Spearhead.Events.PublishRTB, \"" .. groupName .. "\")"
|
||||
command = "pcall(GlobalCapCallBacks.PublishRTB, \"" .. groupName .. "\")"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -379,7 +379,7 @@ function INTERCEPT.getUnitInterceptTaskPoint(groupName, currentPoint, targetPosi
|
||||
action = {
|
||||
id = "Script",
|
||||
params = {
|
||||
command = "pcall(Spearhead.Events.PublishRTB, \"" .. groupName .. "\")"
|
||||
command = "pcall(GlobalCapCallBacks.PublishRTB, \"" .. groupName .. "\")"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ function SWEEP.getAsTasking(groupName, airbase, capZone, capConfig)
|
||||
action = {
|
||||
id = "Script",
|
||||
params = {
|
||||
command = "pcall(Spearhead.Events.PublishOnStation, \"" .. groupName .. "\")"
|
||||
command = "pcall(GlobalCapCallBacks.PublishOnStation, \"" .. groupName .. "\")"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -270,7 +270,7 @@ function SWEEP.getAsTasking(groupName, airbase, capZone, capConfig)
|
||||
action = {
|
||||
id = "Script",
|
||||
params = {
|
||||
command = "pcall(Spearhead.Events.PublishRTB, \"" .. groupName .. "\")"
|
||||
command = "pcall(GlobalCapCallBacks.PublishRTB, \"" .. groupName .. "\")"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user