From 002cb2a91965efd228f37bc4783e6ba12b7c1ec8 Mon Sep 17 00:00:00 2001
From: omltcat <6239696+omltcat@users.noreply.github.com>
Date: Thu, 30 May 2024 19:52:13 -0400
Subject: [PATCH] Add Controller:setOption Add missing event fields
---
library/mission/controller.lua | 11 +++++++++++
library/mission/country.lua | 1 +
library/mission/types.lua | 16 +++++++++++-----
3 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/library/mission/controller.lua b/library/mission/controller.lua
index e188d62..567baf6 100644
--- a/library/mission/controller.lua
+++ b/library/mission/controller.lua
@@ -28,6 +28,17 @@ function Controller:resetTask() end
---@param command table -- The command to be set.
function Controller:setCommand(command) end
+---Options are a pair of identifier and value.
+---Behavior options are global parameters and will affect controller behavior in all tasks it performs.
+---Options are executed immediately.
+---For example, Rules of Engagement (ROE) are an option that can dictate whether or not a group is currently allowed to attack.
+---This option can over-ride tasking to attack specific targets.
+---Unlike Tasks and Commands, options are organized by id and value.
+---See [Available Options](https://wiki.hoggitworld.com/view/DCS_func_setOption)
+---@param optionId enum -- The identifier of the option.
+---@param optionValue enum|boolean -- The value of the option.
+function Controller:setOption(optionId, optionValue) end
+
---Sets the controlled group to go the specified speed in meters per second.
---Optional boolean `keep` when set to true will maintain that speed on passing waypoints.
---If `keep` is not present or false, the controlled group will return to the speed as defined by their route.
diff --git a/library/mission/country.lua b/library/mission/country.lua
index 8794021..b9b0200 100644
--- a/library/mission/country.lua
+++ b/library/mission/country.lua
@@ -97,6 +97,7 @@ country.id = {
["KUWAIT"] = 71
}
+---@enum country.name
country.name = {
[1] = "UKRAINE",
[2] = "USA",
diff --git a/library/mission/types.lua b/library/mission/types.lua
index 8e8dde5..6becd73 100644
--- a/library/mission/types.lua
+++ b/library/mission/types.lua
@@ -3,15 +3,21 @@
---Object being called when a event handler is triggered.
---Depending on the event, the object may have different fields.
---@class event
+---@field comment string?
+---@field coalition coalition.side?
+---@field decs table?
+---@field groupID integer?
---@field id integer
----@field time number
+---@field idx integer?
---@field initiator Unit?
+---@field target Unit?
+---@field place Airbase?
+---@field pos vec3?
+---@field subPlace integer?
+---@field text string?
+---@field time number
---@field weapon Weapon?
---@field weapon_name string?
----@field target Unit?
----@field comment string?
----@field place Airbase?
----@field subPlace integer?
---`vec2.x = vec3.x = north`
`vec2.y = vec3.z = east`
---@class vec2