diff --git a/.luarc.json b/.luarc.json index 58110070410..b7ee4c277a2 100644 --- a/.luarc.json +++ b/.luarc.json @@ -2,6 +2,9 @@ "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json", "runtime.version": "Lua 5.1", "completion.requireSeparator": "/", + "workspace.library": [ + "library" + ], "runtime.path": [ "?", "?.lua" diff --git a/library/LuaArchive.lua b/library/LuaArchive.lua new file mode 100644 index 00000000000..9dff016a1d8 --- /dev/null +++ b/library/LuaArchive.lua @@ -0,0 +1,10 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaArchive.cpp +--- +---@meta + diff --git a/library/LuaAtlasTextures.lua b/library/LuaAtlasTextures.lua new file mode 100644 index 00000000000..abd2af97bab --- /dev/null +++ b/library/LuaAtlasTextures.lua @@ -0,0 +1,10 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaAtlasTextures.cpp +--- +---@meta + diff --git a/library/LuaBitOps.lua b/library/LuaBitOps.lua new file mode 100644 index 00000000000..eb36ec4fffd --- /dev/null +++ b/library/LuaBitOps.lua @@ -0,0 +1,65 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaBitOps.cpp +--- +---@meta + +---math bit extensions +--- +---Note: there are no bit shift. Use those Lua functions instead for 24 bits bitshift +---24 bits because only the 24 bits of the mantissa can be easily used in a 32 bit float +---bitshift functions (<<, >> equivalent) +--- +----- left shift +---local function lsh(value,shift) +---return (value*(2^shift)) % 2^24 +---end +--- +----- right shift +---local function rsh(value,shift) +---return math.floor(value/2^shift) % 2^24 +---end +--- +---@see rts/Lua/LuaBitOps.cpp + +---Returns the bitwise OR of all arguments. Only use up to 24 bit integers. +--- +---@param a1 integer +---@param a2 integer +---@param ... integer +---@return integer result +function math.bit_or(a1, a2, ...) end + +---Returns the bitwise AND of all arguments. Only use up to 24 bit integers. +--- +---@param a1 integer +---@param a2 integer +---@param ... integer +---@return integer result +function math.bit_and(a1, a2, ...) end + +---Returns the bitwise XOR of all arguments. Only use up to 24 bit integers. +--- +---@param a1 integer +---@param a2 integer +---@param ... integer +---@return integer result +function math.bit_xor(a1, a2, ...) end + +---Returns the bitwise NOT of the 24 bit integer argument. +--- +---@param value integer +---@return integer result +function math.bit_inv(value) end + +---Set each of the bits of a 24 bit integer. Returns result = result OR (1 << a1) OR (1 << a2) OR ...;) +--- +---@param a1 integer +---@param a2 integer +---@param ... integer +---@return integer result +function math.bit_bits(a1, a2, ...) end \ No newline at end of file diff --git a/library/LuaConstCMD.lua b/library/LuaConstCMD.lua new file mode 100644 index 00000000000..148e0899b95 --- /dev/null +++ b/library/LuaConstCMD.lua @@ -0,0 +1,202 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaConstCMD.cpp +--- +---@meta + +---Command constants +--- +---@see rts/Lua/LuaConstCMD.cpp + +---@enum CMD +CMD = { + ---@type -1 + FIRESTATE_NONE = nil, + + ---@type -1 + MOVESTATE_NONE = nil, + + ---@type 0 + STOP = nil, + + ---@type 0 + MOVESTATE_HOLDPOS = nil, + + ---@type 0 + FIRESTATE_HOLDFIRE = nil, + + ---@type 1 + INSERT = nil, + + ---@type 1 + MOVESTATE_MANEUVER = nil, + + ---@type 1 + FIRESTATE_RETURNFIRE = nil, + + ---@type 1 + WAITCODE_TIME = nil, + + ---@type 2 + WAITCODE_DEATH = nil, + + ---@type 2 + MOVESTATE_ROAM = nil, + + ---@type 2 + REMOVE = nil, + + ---@type 2 + FIRESTATE_FIREATWILL = nil, + + ---@type 3 + FIRESTATE_FIREATNEUTRAL = nil, + + ---@type 3 + WAITCODE_SQUAD = nil, + + ---@type 4 + OPT_META = nil, + + ---@type 4 + WAITCODE_GATHER = nil, + + ---@type 5 + WAIT = nil, + + ---@type 6 + TIMEWAIT = nil, + + ---@type 7 + DEATHWAIT = nil, + + ---@type 8 + OPT_INTERNAL = nil, + + ---@type 8 + SQUADWAIT = nil, + + ---@type 9 + GATHERWAIT = nil, + + ---@type 10 + MOVE = nil, + + ---@type 15 + PATROL = nil, + + ---@type 16 + FIGHT = nil, + + ---@type 16 + OPT_RIGHT = nil, + + ---@type 20 + LOOPBACKATTACK = nil, + + ---@type 20 + ATTACK = nil, + + ---@type 21 + AREA_ATTACK = nil, + + ---@type 25 + GUARD = nil, + + ---@type 30 + AISELECT = nil, + + ---@type 32 + OPT_SHIFT = nil, + + ---@type 35 + GROUPSELECT = nil, + + ---@type 36 + GROUPADD = nil, + + ---@type 37 + GROUPCLEAR = nil, + + ---@type 40 + REPAIR = nil, + + ---@type 45 + FIRE_STATE = nil, + + ---@type 50 + MOVE_STATE = nil, + + ---@type 55 + SETBASE = nil, + + ---@type 60 + INTERNAL = nil, + + ---@type 64 + OPT_CTRL = nil, + + ---@type 65 + SELFD = nil, + + ---@type 70 + SET_WANTED_MAX_SPEED = nil, + + ---@type 75 + LOAD_UNITS = nil, + + ---@type 76 + LOAD_ONTO = nil, + + ---@type 80 + UNLOAD_UNITS = nil, + + ---@type 81 + UNLOAD_UNIT = nil, + + ---@type 85 + ONOFF = nil, + + ---@type 90 + RECLAIM = nil, + + ---@type 95 + CLOAK = nil, + + ---@type 100 + STOCKPILE = nil, + + ---@type 105 + MANUALFIRE = nil, + + ---@type 105 + DGUN = nil, + + ---@type 110 + RESTORE = nil, + + ---@type 115 + REPEAT = nil, + + ---@type 120 + TRAJECTORY = nil, + + ---@type 125 + RESURRECT = nil, + + ---@type 128 + OPT_ALT = nil, + + ---@type 130 + CAPTURE = nil, + + ---@type 135 + AUTOREPAIRLEVEL = nil, + + ---@type 145 + IDLEMODE = nil +} \ No newline at end of file diff --git a/library/LuaConstCMDTYPE.lua b/library/LuaConstCMDTYPE.lua new file mode 100644 index 00000000000..701cc0c93d1 --- /dev/null +++ b/library/LuaConstCMDTYPE.lua @@ -0,0 +1,66 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaConstCMDTYPE.cpp +--- +---@meta + +---Command type constants +--- +---@see rts/Lua/LuaConstCMDTYPE.cpp + +---Note, the CMDTYPE[] table is bidirectional. That means: CMDTYPE[CMDTYPE.ICON] := "CMDTYPE_ICON" +--- +---@enum CMDTYPE +CMDTYPE = { + ---@type number expect 0 parameters in return + ICON = nil, + + ---@type number expect 1 parameter in return (number selected mode) + ICON_MODE = nil, + + ---@type number expect 3 parameters in return (mappos) + ICON_MAP = nil, + + ---@type number expect 4 parameters in return (mappos+radius) + ICON_AREA = nil, + + ---@type number expect 1 parameters in return (unitid) + ICON_UNIT = nil, + + ---@type number expect 1 parameters in return (unitid) or 3 parameters in return (mappos) + ICON_UNIT_OR_MAP = nil, + + ---@type number expect 3 or 6 parameters in return (middle and right side of front if a front was defined) + ICON_FRONT = nil, + + ---@type number expect 1 parameter in return (number selected option) + COMBO_BOX = nil, + + ---@type number expect 1 parameter in return (unitid) or 4 parameters in return (mappos+radius) + ICON_UNIT_OR_AREA = nil, + + ---@type number expect 1 parameter in return (unitid or Game.maxUnits+featureid) or 4 parameters in return (mappos+radius) + ICON_UNIT_FEATURE_OR_AREA = nil, + + ---@type number expect 3 parameters in return (mappos) + ICON_BUILDING = nil, + + ---@type number expect 1 parameter in return (unitid) or 3 parameters in return (mappos) or 6 parameters in return (startpos+endpos) + ICON_UNIT_OR_RECTANGLE = nil, + + ---@type number expect 1 parameter in return (number) + NUMBER = nil, + + ---@type number used with CMD_INTERNAL + CUSTOM = nil, + + ---@type number next command page used with CMD_INTERNAL + NEXT = nil, + + ---@type number previous command page used with CMD_INTERNAL + PREV = nil +} \ No newline at end of file diff --git a/library/LuaConstCOB.lua b/library/LuaConstCOB.lua new file mode 100644 index 00000000000..6577e71cfaf --- /dev/null +++ b/library/LuaConstCOB.lua @@ -0,0 +1,330 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaConstCOB.cpp +--- +---@meta + +---COB constants +--- +---@see rts/Lua/LuaConstCOB.cpp + +---@enum COB +COB = { + ---@type number + ACTIVATION = nil, + + ---@type number + STANDINGMOVEORDERS = nil, + + ---@type number + STANDINGFIREORDERS = nil, + + ---@type number + HEALTH = nil, + + ---@type number + INBUILDSTANCE = nil, + + ---@type number + BUSY = nil, + + ---@type number + PIECE_XZ = nil, + + ---@type number + PIECE_Y = nil, + + ---@type number + UNIT_XZ = nil, + + ---@type number + UNIT_Y = nil, + + ---@type number + UNIT_HEIGHT = nil, + + ---@type number + XZ_ATAN = nil, + + ---@type number + XZ_HYPOT = nil, + + ---@type number + ATAN = nil, + + ---@type number + HYPOT = nil, + + ---@type number + GROUND_HEIGHT = nil, + + ---@type number + BUILD_PERCENT_LEFT = nil, + + ---@type number + YARD_OPEN = nil, + + ---@type number + BUGGER_OFF = nil, + + ---@type number + ARMORED = nil, + + ---@type number + IN_WATER = nil, + + ---@type number + CURRENT_SPEED = nil, + + ---@type number + VETERAN_LEVEL = nil, + + ---@type number + ON_ROAD = nil, + + ---@type number + MAX_ID = nil, + + ---@type number + MY_ID = nil, + + ---@type number + UNIT_TEAM = nil, + + ---@type number + UNIT_BUILD_PERCENT_LEFT = nil, + + ---@type number + UNIT_ALLIED = nil, + + ---@type number + MAX_SPEED = nil, + + ---@type number + CLOAKED = nil, + + ---@type number + WANT_CLOAK = nil, + + ---@type number + GROUND_WATER_HEIGHT = nil, + + ---@type number + UPRIGHT = nil, + + ---@type number + POW = nil, + + ---@type number + PRINT = nil, + + ---@type number + HEADING = nil, + + ---@type number + TARGET_ID = nil, + + ---@type number + LAST_ATTACKER_ID = nil, + + ---@type number + LOS_RADIUS = nil, + + ---@type number + AIR_LOS_RADIUS = nil, + + ---@type number + RADAR_RADIUS = nil, + + ---@type number + JAMMER_RADIUS = nil, + + ---@type number + SONAR_RADIUS = nil, + + ---@type number + SONAR_JAM_RADIUS = nil, + + ---@type number + SEISMIC_RADIUS = nil, + + ---@type number + DO_SEISMIC_PING = nil, + + ---@type number + CURRENT_FUEL = nil, + + ---@type number + TRANSPORT_ID = nil, + + ---@type number + SHIELD_POWER = nil, + + ---@type number + STEALTH = nil, + + ---@type number + CRASHING = nil, + + ---@type number + CHANGE_TARGET = nil, + + ---@type number + CEG_DAMAGE = nil, + + ---@type number + COB_ID = nil, + + ---@type number + PLAY_SOUND = nil, + + ---@type number + KILL_UNIT = nil, + + ---@type number + ALPHA_THRESHOLD = nil, + + ---@type number + SET_WEAPON_UNIT_TARGET = nil, + + ---@type number + SET_WEAPON_GROUND_TARGET = nil, + + ---@type number + SONAR_STEALTH = nil, + + ---@type number + REVERSING = nil, + + ---@type number + FLANK_B_MODE = nil, + + ---@type number + FLANK_B_DIR = nil, + + ---@type number + FLANK_B_MOBILITY_ADD = nil, + + ---@type number + FLANK_B_MAX_DAMAGE = nil, + + ---@type number + FLANK_B_MIN_DAMAGE = nil, + + ---@type number + WEAPON_RELOADSTATE = nil, + + ---@type number + WEAPON_RELOADTIME = nil, + + ---@type number + WEAPON_ACCURACY = nil, + + ---@type number + WEAPON_SPRAY = nil, + + ---@type number + WEAPON_RANGE = nil, + + ---@type number + WEAPON_PROJECTILE_SPEED = nil, + + ---@type number + MIN = nil, + + ---@type number + MAX = nil, + + ---@type number + ABS = nil, + + ---@type number + GAME_FRAME = nil +} + +---@enum SFX +SFX = { + ---@type number + ---Piece Flag for `Spring.UnitScript.Explode` + SHATTER = nil, + + ---@type number + ---Piece Flag for `Spring.UnitScript.Explode` + EXPLODE = nil, + + ---@type number + ---Piece Flag for `Spring.UnitScript.Explode` + EXPLODE_ON_HIT = nil, + + ---@type number + ---Piece Flag for `Spring.UnitScript.Explode` + FALL = nil, + + ---@type number + ---Piece Flag for `Spring.UnitScript.Explode` + SMOKE = nil, + + ---@type number + ---Piece Flag for `Spring.UnitScript.Explode` + FIRE = nil, + + ---@type number + ---Piece Flag for `Spring.UnitScript.Explode` + NONE = nil, + + ---@type number + ---Piece Flag for `Spring.UnitScript.Explode` + NO_CEG_TRAIL = nil, + + ---@type number + ---Piece Flag for `Spring.UnitScript.Explode` + NO_HEATCLOUD = nil, + + ---@type number + ---Piece Flag for `Spring.UnitScript.Explode` + RECURSIVE = nil, + + ---@type number + ---For `Spring.UnitScript.EmitSfx`. + VTOL = nil, + + ---@type number + ---For `Spring.UnitScript.EmitSfx`. + WAKE = nil, + + ---@type number + ---For `Spring.UnitScript.EmitSfx`. + REVERSE_WAKE = nil, + + ---@type number + ---For `Spring.UnitScript.EmitSfx`. + WHITE_SMOKE = nil, + + ---@type number + ---For `Spring.UnitScript.EmitSfx`. + BLACK_SMOKE = nil, + + ---@type number + ---For `Spring.UnitScript.EmitSfx`. + BUBBLE = nil, + + ---@type number + ---For `Spring.UnitScript.EmitSfx`. + CEG = nil, + + ---@type number + ---For `Spring.UnitScript.EmitSfx`. + FIRE_WEAPON = nil, + + ---@type number + ---For `Spring.UnitScript.EmitSfx`. + DETONATE_WEAPON = nil, + + ---@type number + ---For `Spring.UnitScript.EmitSfx`. + GLOBAL = nil +} \ No newline at end of file diff --git a/library/LuaConstEngine.lua b/library/LuaConstEngine.lua new file mode 100644 index 00000000000..44a7711b097 --- /dev/null +++ b/library/LuaConstEngine.lua @@ -0,0 +1,39 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaConstEngine.cpp +--- +---@meta + +---Engine constants +--- +---@see rts/Lua/LuaConstEngine.cpp + +---@class FeatureSupport +---@field hasExitOnlyYardmaps boolean +---@field rmlUiApiVersion integer +local FeatureSupport = {} + +---Engine specific information. +Engine = { + ---@type string Returns the same as `spring *sync-version`, e.g. "92" + version = nil, + + ---@type string + versionFull = nil, + + ---@type string + versionPatchSet = nil, + + ---@type string (unsynced only) Gets additional engine buildflags, e.g. "OMP" or "MT-Sim DEBUG" + buildFlags = nil, + + ---@type FeatureSupport table containing various engine features as keys; use for cross-version compat + FeatureSupport = nil, + + ---@type number indicates the build type and is either 32 or 64 (or 0 in synced code) + wordSize = nil +} \ No newline at end of file diff --git a/library/LuaConstGL.lua b/library/LuaConstGL.lua new file mode 100644 index 00000000000..5c3f1662be9 --- /dev/null +++ b/library/LuaConstGL.lua @@ -0,0 +1,635 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaConstGL.cpp +--- +---@meta + +---OpenGL Constants +--- +---@see rts/Lua/LuaConstGL.cpp + +---Drawing Primitives +--- +---@section primitives + +---@enum GL +GL = { + ---@type number + POINTS = nil, + + ---@type number + LINES = nil, + + ---@type number + LINE_LOOP = nil, + + ---@type number + LINE_STRIP = nil, + + ---@type number + TRIANGLES = nil, + + ---@type number + TRIANGLE_STRIP = nil, + + ---@type number + TRIANGLE_FAN = nil, + + ---@type number + QUADS = nil, + + ---@type number + QUAD_STRIP = nil, + + ---@type number + POLYGON = nil, + + ---@type number + PATCHES = nil, + + ---@type number + ZERO = nil, + + ---@type number + ONE = nil, + + ---@type number + SRC_COLOR = nil, + + ---@type number + ONE_MINUS_SRC_COLOR = nil, + + ---@type number + SRC_ALPHA = nil, + + ---@type number + ONE_MINUS_SRC_ALPHA = nil, + + ---@type number + DST_ALPHA = nil, + + ---@type number + ONE_MINUS_DST_ALPHA = nil, + + ---@type number + ZERO = nil, + + ---@type number + ONE = nil, + + ---@type number + SRC_COLOR = nil, + + ---@type number + ONE_MINUS_SRC_COLOR = nil, + + ---@type number + SRC_ALPHA = nil, + + ---@type number + ONE_MINUS_SRC_ALPHA = nil, + + ---@type number + DST_ALPHA = nil, + + ---@type number + ONE_MINUS_DST_ALPHA = nil, + + ---@type number + DST_COLOR = nil, + + ---@type number + ONE_MINUS_DST_COLOR = nil, + + ---@type number + SRC_ALPHA_SATURATE = nil, + + ---@type number + FUNC_ADD = nil, + + ---@type number + FUNC_SUBTRACT = nil, + + ---@type number + FUNC_REVERSE_SUBTRACT = nil, + + ---@type number + MIN = nil, + + ---@type number + MAX = nil, + + ---@type number + NEVER = nil, + + ---@type number + LESS = nil, + + ---@type number + EQUAL = nil, + + ---@type number + LEQUAL = nil, + + ---@type number + GREATER = nil, + + ---@type number + NOTEQUAL = nil, + + ---@type number + GEQUAL = nil, + + ---@type number + ALWAYS = nil, + + ---@type number + CLEAR = nil, + + ---@type number + AND = nil, + + ---@type number + AND_REVERSE = nil, + + ---@type number + COPY = nil, + + ---@type number + AND_INVERTED = nil, + + ---@type number + NOOP = nil, + + ---@type number + XOR = nil, + + ---@type number + OR = nil, + + ---@type number + NOR = nil, + + ---@type number + EQUIV = nil, + + ---@type number + INVERT = nil, + + ---@type number + OR_REVERSE = nil, + + ---@type number + COPY_INVERTED = nil, + + ---@type number + OR_INVERTED = nil, + + ---@type number + NAND = nil, + + ---@type number + SET = nil, + + ---@type number + BACK = nil, + + ---@type number + FRONT = nil, + + ---@type number + FRONT_AND_BACK = nil, + + ---@type number + POINT = nil, + + ---@type number + LINE = nil, + + ---@type number + FILL = nil, + + ---@type number + DEPTH_BUFFER_BIT = nil, + + ---@type number + ACCUM_BUFFER_BIT = nil, + + ---@type number + STENCIL_BUFFER_BIT = nil, + + ---@type number + COLOR_BUFFER_BIT = nil, + + ---@type number + FLAT = nil, + + ---@type number + SMOOTH = nil, + + ---@type number + MODELVIEW = nil, + + ---@type number + PROJECTION = nil, + + ---@type number + TEXTURE = nil, + + ---@type number + NEAREST = nil, + + ---@type number + LINEAR = nil, + + ---@type number + NEAREST_MIPMAP_NEAREST = nil, + + ---@type number + LINEAR_MIPMAP_NEAREST = nil, + + ---@type number + NEAREST_MIPMAP_LINEAR = nil, + + ---@type number + LINEAR_MIPMAP_LINEAR = nil, + + ---@type number + REPEAT = nil, + + ---@type number + MIRRORED_REPEAT = nil, + + ---@type number + CLAMP = nil, + + ---@type number + CLAMP_TO_EDGE = nil, + + ---@type number + CLAMP_TO_BORDER = nil, + + ---@type number + TEXTURE_ENV = nil, + + ---@type number + TEXTURE_ENV_MODE = nil, + + ---@type number + TEXTURE_ENV_COLOR = nil, + + ---@type number + MODULATE = nil, + + ---@type number + DECAL = nil, + + ---@type number + BLEND = nil, + + ---@type number + REPLACE = nil, + + ---@type number + TEXTURE_GEN_MODE = nil, + + ---@type number + EYE_PLANE = nil, + + ---@type number + OBJECT_PLANE = nil, + + ---@type number + EYE_LINEAR = nil, + + ---@type number + OBJECT_LINEAR = nil, + + ---@type number + SPHERE_MAP = nil, + + ---@type number + NORMAL_MAP = nil, + + ---@type number + REFLECTION_MAP = nil, + + ---@type number + S = nil, + + ---@type number + T = nil, + + ---@type number + R = nil, + + ---@type number + Q = nil, + + ---@type number + CURRENT_BIT = nil, + + ---@type number + POINT_BIT = nil, + + ---@type number + LINE_BIT = nil, + + ---@type number + POLYGON_BIT = nil, + + ---@type number + POLYGON_STIPPLE_BIT = nil, + + ---@type number + PIXEL_MODE_BIT = nil, + + ---@type number + LIGHTING_BIT = nil, + + ---@type number + FOG_BIT = nil, + + ---@type number + DEPTH_BUFFER_BIT = nil, + + ---@type number + ACCUM_BUFFER_BIT = nil, + + ---@type number + STENCIL_BUFFER_BIT = nil, + + ---@type number + VIEWPORT_BIT = nil, + + ---@type number + TRANSFORM_BIT = nil, + + ---@type number + ENABLE_BIT = nil, + + ---@type number + COLOR_BUFFER_BIT = nil, + + ---@type number + HINT_BIT = nil, + + ---@type number + EVAL_BIT = nil, + + ---@type number + LIST_BIT = nil, + + ---@type number + TEXTURE_BIT = nil, + + ---@type number + SCISSOR_BIT = nil, + + ---@type number + ALL_ATTRIB_BITS = nil, + + ---@type number + FOG_HINT = nil, + + ---@type number + LINE_SMOOTH_HINT = nil, + + ---@type number + POINT_SMOOTH_HINT = nil, + + ---@type number + POLYGON_SMOOTH_HINT = nil, + + ---@type number + PERSPECTIVE_CORRECTION_HINT = nil, + + ---@type number + DONT_CARE = nil, + + ---@type number + FASTEST = nil, + + ---@type number + NICEST = nil, + + ---@type number + AMBIENT = nil, + + ---@type number + DIFFUSE = nil, + + ---@type number + SPECULAR = nil, + + ---@type number + POSITION = nil, + + ---@type number + SPOT_DIRECTION = nil, + + ---@type number + SPOT_EXPONENT = nil, + + ---@type number + SPOT_CUTOFF = nil, + + ---@type number + CONSTANT_ATTENUATION = nil, + + ---@type number + LINEAR_ATTENUATION = nil, + + ---@type number + QUADRATIC_ATTENUATION = nil, + + ---@type number + VERTEX_SHADER = nil, + + ---@type number + TESS_CONTROL_SHADER = nil, + + ---@type number + TESS_EVALUATION_SHADER = nil, + + ---@type number + GEOMETRY_SHADER = nil, + + ---@type number + FRAGMENT_SHADER = nil, + + ---@type number + GEOMETRY_INPUT_TYPE = nil, + + ---@type number + GEOMETRY_OUTPUT_TYPE = nil, + + ---@type number + GEOMETRY_VERTICES_OUT = nil, + + ---@type number + PATCH_VERTICES = nil, + + ---@type number + PATCH_DEFAULT_OUTER_LEVEL = nil, + + ---@type number + PATCH_DEFAULT_INNER_LEVEL = nil, + + ---@type number + BYTE = nil, + + ---@type number + UNSIGNED_BYTE = nil, + + ---@type number + SHORT = nil, + + ---@type number + UNSIGNED_SHORT = nil, + + ---@type number + INT = nil, + + ---@type number + UNSIGNED_INT = nil, + + ---@type number + FLOAT = nil, + + ---@type number + FLOAT_VEC4 = nil, + + ---@type number + INT_VEC4 = nil, + + ---@type number + UNSIGNED_INT_VEC4 = nil, + + ---@type number + FLOAT_MAT4 = nil, + + ---@type number + ELEMENT_ARRAY_BUFFER = nil, + + ---@type number + ARRAY_BUFFER = nil, + + ---@type number + UNIFORM_BUFFER = nil, + + ---@type number + SHADER_STORAGE_BUFFER = nil +} + +---BlendingFactorDest +--- +---@section blendingfactordest + +---BlendingFactorSrc +--- +---@section blendingfactorsrc + +---AlphaFunction and DepthFunction +--- +---@section alphadepth + +---LogicOp +--- +---@section logicop + +---Culling +--- +---@section culling + +---PolygonMode +--- +---@section polygonmode + +---Clear Bits +--- +---@section clearbits + +---ShadeModel +--- +---@section shademodel + +---MatrixMode +--- +---@section matrixmode + +---Texture Filtering +--- +---@section texturefiltering + +---Texture Clamping +--- +---@section textureclamping + +---Texture Environment +--- +---@section textureenvironment + +---Texture Generation +--- +---@section texturegeneration + +---glPushAttrib() bits +--- +---@section glpushattribbits + +---glHint() targets +--- +---@section glhinttargets + +---glHint() modes +--- +---@section glhintmodes + +---Light Specification +--- +---@section lightspecification + +---Shader Types +--- +---@section shadertypes + +---Geometry Shader Parameters +--- +---@section geometryshaderparameters + +---Tesselation control shader parameters +--- +---@section tesselationcontrolshaderparameters + +---OpenGL Data Types +--- +---@section OpenGL_Data_Types + +---OpenGL Buffer Types +--- +---@section OpenGL_Buffer_Types + +---FBO Attachments +--- +---@section fboattachments + +---Not included, but useful texture Formats +--- +---@section textureformats + +---Not included, but useful RBO Formats +--- +---@section rboformats + +---Not included, but useful FBO Targets +--- +---@section fbotargets + +---Not included, but useful FBO Status +--- +---@section fbostatus \ No newline at end of file diff --git a/library/LuaConstGame.lua b/library/LuaConstGame.lua new file mode 100644 index 00000000000..f754336d64b --- /dev/null +++ b/library/LuaConstGame.lua @@ -0,0 +1,203 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaConstGame.cpp +--- +---@meta + +---Game constants +--- +---@see rts/Lua/LuaConstGame.cpp + +---Game specific information +Game = { + ---@type number + maxUnits = nil, + + ---@type number + maxTeams = nil, + + ---@type number + maxPlayers = nil, + + ---@type number Divide Game.mapSizeX or Game.mapSizeZ by this to get engine's "mapDims" coordinates. The resolution of height, yard and type maps. + squareSize = nil, + + ---@type number The resolution of metalmap (for use in API such as Spring.GetMetalAmount etc.) + metalMapSquareSize = nil, + + ---@type number + gameSpeed = nil, + + ---@type number + startPosType = nil, + + ---@type boolean + ghostedBuildings = nil, + + ---@type string + mapChecksum = nil, + + ---@type string + modChecksum = nil, + + ---@type boolean + mapDamage = nil, + + ---@type string + mapName = nil, + + ---@type string = string Game.mapHumanName + mapDescription = nil, + + ---@type number + mapHardness = nil, + + ---@type number + mapX = nil, + + ---@type number + mapY = nil, + + ---@type number in worldspace/opengl coords. Divide by Game.squareSize to get engine's "mapDims" coordinates + mapSizeX = nil, + + ---@type number in worldspace/opengl coords. Divide by Game.squareSize to get engine's "mapDims" coordinates + mapSizeZ = nil, + + ---@type number + gravity = nil, + + ---@type number + tidal = nil, + + ---@type number + windMin = nil, + + ---@type number + windMax = nil, + + ---@type number + extractorRadius = nil, + + ---@type number + waterDamage = nil, + + ---@type table Containing {def}IDs of environmental-damage sources + envDamageTypes = nil, + + ---@type string + gameName = nil, + + ---@type string + gameShortName = nil, + + ---@type string + gameVersion = nil, + + ---@type string + gameMutator = nil, + + ---@type string + gameDesc = nil, + + ---@type boolean + requireSonarUnderWater = nil, + + ---@type number + transportAir = nil, + + ---@type number + transportShip = nil, + + ---@type number + transportHover = nil, + + ---@type number + transportGround = nil, + + ---@type number + fireAtKilled = nil, + + ---@type number + fireAtCrashing = nil, + + ---@type boolean + constructionDecay = nil, + + ---@type boolean + reclaimAllowEnemies = nil, + + ---@type boolean + reclaimAllowAllies = nil, + + ---@type number + constructionDecayTime = nil, + + ---@type number + constructionDecaySpeed = nil, + + ---@type number + multiReclaim = nil, + + ---@type number + reclaimMethod = nil, + + ---@type number + reclaimUnitMethod = nil, + + ---@type number + reclaimUnitEnergyCostFactor = nil, + + ---@type number + reclaimUnitEfficiency = nil, + + ---@type number + reclaimFeatureEnergyCostFactor = nil, + + ---@type number + repairEnergyCostFactor = nil, + + ---@type number + resurrectEnergyCostFactor = nil, + + ---@type number + captureEnergyCostFactor = nil, + + ---@type table + ---```lua + ---example: { + ---["vtol"] = 0, ["special"] = 1, ["noweapon"] = 2, + ---["notair"] = 3, ["notsub"] = 4, ["all"] = 5, + ---["weapon"] = 6, ["notship"] = 7, ["notland"] = 8, + ---["mobile"] = 9, ["kbot"] = 10, ["antigator"] = 11, + ---["tank"] = 12, ["plant"] = 13, ["ship"] = 14, + ---["antiemg"] = 15, ["antilaser"] = 16, ["antiflame"] = 17, + ---["underwater"] = 18, ["hover"] = 19, ["phib"] = 20, + ---["constr"] = 21, ["strategic"] = 22, ["commander"] = 23, + ---["paral"] = 24, ["jam"] = 25, ["mine"] = 26, + ---["kamikaze"] = 27, ["minelayer"] = 28, ["notstructure"] = 29, + ---["air"] = 30 + ---} + ---``` + springCategories = nil, + + ---@type table (bidirectional) + ---```lua + ---example: { + ---[1] = amphibious, [2] = anniddm, [3] = antibomber, + ---[4] = antifighter, [5] = antiraider, [6] = atl, + ---[7] = blackhydra, [8] = bombers, [9] = commanders, + ---[10] = crawlingbombs, ... + --- + ---["amphibious"] = 1, ["anniddm"] = 2, ["antibomber"] = 3 + ---["antifighter"] = 4, ["antiraider"] = 5, ["atl"] = 6 + ---["blackhydra"] = 7, ["bombers"] = 8, ["commanders"] = 9 + ---["crawlingbombs"]= 10, ... + ---} + ---``` + armorTypes = nil +} \ No newline at end of file diff --git a/library/LuaConstPlatform.lua b/library/LuaConstPlatform.lua new file mode 100644 index 00000000000..7ec8f064c5a --- /dev/null +++ b/library/LuaConstPlatform.lua @@ -0,0 +1,91 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaConstPlatform.cpp +--- +---@meta + +---Platform constants +--- +---@see rts/Lua/LuaConstPlatform.cpp + +---Platform specific information +Platform = { + ---@type string Full GPU device name + gpu = nil, + + ---@type "Nvidia"|"Intel"|"ATI"|"Mesa"|"Unknown" + gpuVendor = nil, + + ---@type string `major.minor.buildNumber` + glVersionShort = nil, + + ---@type string `major.minor` + glslVersionShort = nil, + + ---@type string Full version + glVersion = nil, + + ---@type string + glVendor = nil, + + ---@type string + glRenderer = nil, + + ---@type string Full version + glslVersion = nil, + + ---@type string + glewVersion = nil, + + ---@type string full name of the OS + osName = nil, + + ---@type "Windows"|"Linux"|"MacOSX"|"FreeBSD"|"Unknown" + osFamily = nil, + + ---@type number + numDisplays = nil, + + ---@type number Size of total GPU memory in MBs; only available for "Nvidia", (rest are 0) + gpuMemorySize = nil, + + ---@type number + sdlVersionCompiledMajor = nil, + + ---@type number + sdlVersionCompiledMinor = nil, + + ---@type number + sdlVersionCompiledPatch = nil, + + ---@type number + sdlVersionLinkedMajor = nil, + + ---@type number + sdlVersionLinkedMinor = nil, + + ---@type number + sdlVersionLinkedPatch = nil, + + ---@type boolean + glSupportNonPowerOfTwoTex = nil, + + ---@type boolean + glSupportTextureQueryLOD = nil, + + ---@type boolean + glSupport24bitDepthBuffer = nil, + + ---@type boolean + glSupportRestartPrimitive = nil, + + ---@type boolean + glSupportClipSpaceControl = nil, + + ---@type boolean + glSupportFragDepthLayout = nil +} \ No newline at end of file diff --git a/library/LuaFBOs.lua b/library/LuaFBOs.lua new file mode 100644 index 00000000000..092adde28b3 --- /dev/null +++ b/library/LuaFBOs.lua @@ -0,0 +1,102 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaFBOs.cpp +--- +---@meta + +---FBO +--- +---@see rts/Lua/LuaFBOs.cpp + +gl = { + +} + +---attachment ::= luaTex or `RBO.rbo` or nil or { luaTex [, num target [, num level ] ] } +--- +---@class attachment +local attachment = {} + +---User Data FBO +--- +---@class Fbo +---@field depth attachment +---@field stencil attachment +---@field color0 attachment +---@field color1 attachment +---@field color2 attachment +---@field colorn attachment +---@field color15 attachment +---@field drawbuffers table `{ GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..}` +---@field readbuffer table `GL_COLOR_ATTACHMENT0_EXT` +local Fbo = {} + +---@param fbo Fbo +function gl.CreateFBO(fbo) end + +---This doesn't delete the attached objects! +--- +---@param fbo Fbo +function gl.DeleteFBO(fbo) end + +---@param fbo Fbo +---@param target GL? +---@return boolean valid +---@return number? status +function gl.IsValidFBO(fbo, target) end + +---@param fbo Fbo +---@param target GL? +---@param identities boolean? +---@param lua_function function? +---@param arg1 any? +---@param arg2 any? +---@param argn any? +function gl.ActiveFBO(fbo, target, identities, lua_function, arg1, arg2, argn) end + +---Bind default or specified via rawFboId numeric id of FBO +--- +---@param fbo nil +---@param target GL? (Default: `GL_FRAMEBUFFER_EXT`) +---@param rawFboId integer? (Default: 0) +---@return nil +function gl.RawBindFBO(fbo, target, rawFboId) end + +---@param fbo Fbo +---@param target GL? (Default: `fbo.target`) +---@return number previouslyBoundRawFboId +function gl.RawBindFBO(fbo, target) end + +---needs `GLEW_EXT_framebuffer_blit` +--- +---@param x0Src number +---@param y0Src number +---@param x1Src number +---@param y1Src number +---@param x0Dst number +---@param y0Dst number +---@param x1Dst number +---@param y1Dst number +---@param mask number? (Default: GL_COLOR_BUFFER_BIT) +---@param filter number? (Default: GL_NEAREST) +function gl.BlitFBO(x0Src, y0Src, x1Src, y1Src, x0Dst, y0Dst, x1Dst, y1Dst, mask, filter) end + +---needs `GLEW_EXT_framebuffer_blit` +--- +---@param fboSrc Fbo +---@param x0Src number +---@param y0Src number +---@param x1Src number +---@param y1Src number +---@param fboDst Fbo +---@param x0Dst number +---@param y0Dst number +---@param x1Dst number +---@param y1Dst number +---@param mask number? (Default: GL_COLOR_BUFFER_BIT) +---@param filter number? (Default: GL_NEAREST) +function gl.BlitFBO(fboSrc, x0Src, y0Src, x1Src, y1Src, fboDst, x0Dst, y0Dst, x1Dst, y1Dst, mask, filter) end \ No newline at end of file diff --git a/library/LuaFeatureDefs.lua b/library/LuaFeatureDefs.lua new file mode 100644 index 00000000000..f1e381dd9dc --- /dev/null +++ b/library/LuaFeatureDefs.lua @@ -0,0 +1,10 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaFeatureDefs.cpp +--- +---@meta + diff --git a/library/LuaFonts.lua b/library/LuaFonts.lua new file mode 100644 index 00000000000..9c973d65bc2 --- /dev/null +++ b/library/LuaFonts.lua @@ -0,0 +1,10 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaFonts.cpp +--- +---@meta + diff --git a/library/LuaGaia.lua b/library/LuaGaia.lua new file mode 100644 index 00000000000..d8e43ba26c6 --- /dev/null +++ b/library/LuaGaia.lua @@ -0,0 +1,10 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaGaia.cpp +--- +---@meta + diff --git a/library/LuaHandle.lua b/library/LuaHandle.lua new file mode 100644 index 00000000000..2d8cee4fc2c --- /dev/null +++ b/library/LuaHandle.lua @@ -0,0 +1,820 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaHandle.cpp +--- +---@meta + +---Callins, functions called by the Engine +--- +--- +---This page is future looking to unified widget/gadget (aka "addon") handler, which may yet be some way off, c.f. the changelog. +--- +---Related Sourcecode: [LuaHandle.cpp](https://github.com/beyond-all-reason/spring/blob/BAR105/rts/Lua/LuaHandle.cpp) +--- +---For now, to use these addons in a widget, prepend widget: and, for a gadget, prepend gadget:. For example, +--- +---function widget:UnitCreated(unitID, unitDefID, unitTeam, builderID) +---... +---end +--- +---Some functions may differ between (synced) gadget and widgets; those are in the [Synced - Unsynced Shared](#Synced___Unsynced_Shared) section. Essentially the reason is that all information should be available to synced (game logic controlling) gadgets, but restricted to unsynced gadget/widget (e.g. information about an enemy unit only detected via radar and not yet in LOS). In such cases the full (synced) param list is documented. +--- +---Attention: some callins will only work on the unsynced portion of the gadget. Due to the type-unsafe nature of lua parsing, those callins not firing up might be hard to trace. This document will be continuously updated to properly alert about those situations. +--- +---@see rts/Lua/LuaHandle.cpp + +---Common +--- +---@section common + +---Called when the addon is (re)loaded. +function Initialize() end + +---Called when the game is (re)loaded. +function LoadCode() end + +---Called when the addon or the game is shutdown. +--- +---@return nil +function Shutdown() end + +---Called when a player issues a UI command e.g. types /foo or /luarules foo. +--- +---@param msg string +---@param playerID number +function GotChatMsg(msg, playerID) end + +---Called after `GamePreload` and before `GameStart`. See Lua_SaveLoad. +--- +---@param zipReader table +function Load(zipReader) end + +---Game +--- +---@section game + +---Called before the 0 gameframe. +--- +---Is not called when a saved game is loaded. +function GamePreload() end + +---Called upon the start of the game. +--- +---Is not called when a saved game is loaded. +function GameStart() end + +---Called when the game ends +--- +---@param winningAllyTeams number[] list of winning allyTeams, if empty the game result was undecided (like when dropping from an host). +function GameOver(winningAllyTeams) end + +---Called when the game is paused. +--- +---@param playerID number +---@param paused boolean +function GamePaused(playerID, paused) end + +---Called for every game simulation frame (30 per second). +--- +---@param frame number Starts at frame 1 +function GameFrame(frame) end + +---Called at the end of every game simulation frame +--- +---@param frame number Starts at frame 1 +function GameFramePost(frame) end + +---Called once to deliver the gameID +--- +---@param gameID string encoded in hex. +function GameID(gameID) end + +---Teams +--- +---@section teams + +---Called when a team dies (see `Spring.KillTeam`). +--- +---@param teamID number +function TeamDied(teamID) end + +---@param teamID number +function TeamChanged(teamID) end + +---Called whenever a player's status changes e.g. becoming a spectator. +--- +---@param playerID number +function PlayerChanged(playerID) end + +---Called whenever a new player joins the game. +--- +---@param playerID number +function PlayerAdded(playerID) end + +---Called whenever a player is removed from the game. +--- +---@param playerID number +---@param reason string +function PlayerRemoved(playerID, reason) end + +---Units +--- +---@section units + +---Called at the moment the unit is created. +--- +---@param unitID integer +---@param unitDefID integer +---@param unitTeam integer +---@param builderID number? +function UnitCreated(unitID, unitDefID, unitTeam, builderID) end + +---Called at the moment the unit is completed. +--- +---@param unitID integer +---@param unitDefID integer +---@param unitTeam integer +function UnitFinished(unitID, unitDefID, unitTeam) end + +---Called when a factory finishes construction of a unit. +--- +---@param unitID integer +---@param unitDefID integer +---@param unitTeam integer +---@param factID number +---@param factDefID number +---@param userOrders boolean +function UnitFromFactory(unitID, unitDefID, unitTeam, factID, factDefID, userOrders) end + +---Called when a living unit becomes a nanoframe again. +--- +---@param unitID integer +---@param unitDefID integer +---@param unitTeam integer +function UnitReverseBuilt(unitID, unitDefID, unitTeam) end + +---Called when a unit being built starts decaying. +--- +---@param unitID integer +---@param unitDefID integer +---@param unitTeam integer +---@param timeSinceLastBuild number +---@param iterationPeriod number +---@param part number +function UnitConstructionDecayed(unitID, unitDefID, unitTeam, timeSinceLastBuild, iterationPeriod, part) end + +---Called when a unit is destroyed. +--- +---@param unitID integer +---@param unitDefID integer +---@param unitTeam integer +---@param attackerID number +---@param attackerDefID number +---@param attackerTeam number +---@param weaponDefID number +function UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam, weaponDefID) end + +---Called when a unit is transferred between teams. This is called before `UnitGiven` and in that moment unit is still assigned to the oldTeam. +--- +---@param unitID integer +---@param unitDefID integer +---@param oldTeam number +---@param newTeam number +function UnitTaken(unitID, unitDefID, oldTeam, newTeam) end + +---Called when a unit is transferred between teams. This is called after `UnitTaken` and in that moment unit is assigned to the newTeam. +--- +---@param unitID integer +---@param unitDefID integer +---@param newTeam number +---@param oldTeam number +function UnitGiven(unitID, unitDefID, newTeam, oldTeam) end + +---Called when a unit is idle (empty command queue). +--- +---@param unitID integer +---@param unitDefID integer +---@param unitTeam integer +function UnitIdle(unitID, unitDefID, unitTeam) end + +---Called after when a unit accepts a command, after `AllowCommand` returns true. +--- +---@param unitID integer +---@param unitDefID integer +---@param unitTeam integer +---@param cmdID number +---@param cmdParams table +---@param options CommandOptions +---@param cmdTag number +function UnitCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, options, cmdTag) end + +---Called when a unit completes a command. +--- +---@param unitID integer +---@param unitDefID integer +---@param unitTeam integer +---@param cmdID number +---@param cmdParams table +---@param options CommandOptions +---@param cmdTag number +function UnitCmdDone(unitID, unitDefID, unitTeam, cmdID, cmdParams, options, cmdTag) end + +---Called when a unit is damaged (after UnitPreDamaged). +--- +---@param unitID integer +---@param unitDefID integer +---@param unitTeam integer +---@param damage number +---@param paralyzer number +---@param weaponDefID number +---@param projectileID number +---@param attackerID number +---@param attackerDefID number +---@param attackerTeam number +function UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam) end + +---Called when a unit changes its stun status. +--- +---@param unitID integer +---@param unitDefID integer +---@param unitTeam integer +---@param stunned boolean +function UnitStunned(unitID, unitDefID, unitTeam, stunned) end + +---Called when a unit gains experience greater or equal to the minimum limit set by calling `Spring.SetExperienceGrade`. +--- +---Should be called more reliably with small values of experience grade. +--- +---@param unitID integer +---@param unitDefID integer +---@param unitTeam integer +---@param experience number +---@param oldExperience number +function UnitExperience(unitID, unitDefID, unitTeam, experience, oldExperience) end + +---Called when a unit's harvestStorage is full (according to its unitDef's entry). +--- +---@param unitID integer +---@param unitDefID integer +---@param unitTeam integer +function UnitHarvestStorageFull(unitID, unitDefID, unitTeam) end + +---Called when a unit emits a seismic ping. +--- +---See `seismicSignature`. +--- +---@param x number +---@param y number +---@param z number +---@param strength number +---@param allyTeam integer +---@param unitID integer +---@param unitDefID integer +function UnitSeismicPing(x, y, z, strength, allyTeam, unitID, unitDefID) end + +---Called when a unit enters radar of an allyteam. +--- +---Also called when a unit enters LOS without any radar coverage. +--- +---@param unitID integer +---@param unitTeam integer +---@param allyTeam integer +---@param unitDefID integer +function UnitEnteredRadar(unitID, unitTeam, allyTeam, unitDefID) end + +---Called when a unit enters LOS of an allyteam. +--- +---Its called after the unit is in LOS, so you can query that unit. +--- +---@param unitID integer +---@param unitTeam integer +---@param allyTeam integer who's LOS the unit entered. +---@param unitDefID integer +function UnitEnteredLos(unitID, unitTeam, allyTeam, unitDefID) end + +---Called when a unit leaves radar of an allyteam. +--- +---Also called when a unit leaves LOS without any radar coverage. +---For widgets, this is called just after a unit leaves radar coverage, so +---widgets cannot get the position of units that left their radar. +--- +---@param unitID integer +---@param unitTeam integer +---@param allyTeam integer +---@param unitDefID integer +function UnitLeftRadar(unitID, unitTeam, allyTeam, unitDefID) end + +---Called when a unit leaves LOS of an allyteam. +--- +---For widgets, this one is called just before the unit leaves los, so you can still get the position of a unit that left los. +--- +---@param unitID integer +---@param unitTeam integer +---@param allyTeam integer +---@param unitDefID integer +function UnitLeftLos(unitID, unitTeam, allyTeam, unitDefID) end + +---Transport +--- +---@section transport + +---Called when a unit is loaded by a transport. +--- +---@param unitID integer +---@param unitDefID integer +---@param unitTeam integer +---@param transportID integer +---@param transportTeam integer +function UnitLoaded(unitID, unitDefID, unitTeam, transportID, transportTeam) end + +---Called when a unit is unloaded by a transport. +--- +---@param unitID integer +---@param unitDefID integer +---@param unitTeam integer +---@param transportID integer +---@param transportTeam integer +function UnitUnloaded(unitID, unitDefID, unitTeam, transportID, transportTeam) end + +---Unit Interactions +--- +---@section unit_interactions + +---@param unitID integer +---@param unitDefID integer +---@param unitTeam integer +function UnitEnteredUnderwater(unitID, unitDefID, unitTeam) end + +---@param unitID integer +---@param unitDefID integer +---@param unitTeam integer +function UnitEnteredWater(unitID, unitDefID, unitTeam) end + +---@param unitID integer +---@param unitDefID integer +---@param unitTeam integer +function UnitLeftAir(unitID, unitDefID, unitTeam) end + +---@param unitID integer +---@param unitDefID integer +---@param unitTeam integer +function UnitLeftUnderwater(unitID, unitDefID, unitTeam) end + +---@param unitID integer +---@param unitDefID integer +---@param unitTeam integer +function UnitLeftWater(unitID, unitDefID, unitTeam) end + +---@param unitID integer +---@param unitDefID integer +---@param unitTeam integer +function UnitEnteredAir(unitID, unitDefID, unitTeam) end + +---Called when a unit cloaks. +--- +---@param unitID integer +---@param unitDefID integer +---@param unitTeam integer +function UnitCloaked(unitID, unitDefID, unitTeam) end + +---Called when a unit decloaks. +--- +---@param unitID integer +---@param unitDefID integer +---@param unitTeam integer +function UnitDecloaked(unitID, unitDefID, unitTeam) end + +---Called when two units collide. +--- +---Both units must be registered with `Script.SetWatchUnit`. +--- +---@param colliderID number +---@param collideeID number +function UnitUnitCollision(colliderID, collideeID) end + +---Called when a unit collides with a feature. +--- +---The unit must be registered with `Script.SetWatchUnit` and the feature registered with `Script.SetWatchFeature`. +--- +---@param colliderID number +---@param collideeID number +function UnitFeatureCollision(colliderID, collideeID) end + +---@param unitID integer +---@param unitDefID integer +---@param unitTeam integer +function UnitMoveFailed(unitID, unitDefID, unitTeam) end + +---@param unitID integer +---@param unitDefID integer +---@param unitTeam integer +function UnitArrivedAtGoal(unitID, unitDefID, unitTeam) end + +---Called just before a unit is invalid, after it finishes its death animation. +--- +---@param unitID integer +---@param unitDefID integer +---@param unitTeam integer +function RenderUnitDestroyed(unitID, unitDefID, unitTeam) end + +---Features +--- +---@section features + +---Called when a feature is created. +--- +---@param featureID number +---@param allyTeamID number +function FeatureCreated(featureID, allyTeamID) end + +---Called when a feature is destroyed. +--- +---@param featureID number +---@param allyTeamID number +function FeatureDestroyed(featureID, allyTeamID) end + +---Called when a feature is damaged. +--- +---@param featureID number +---@param featureDefID number +---@param featureTeam number +---@param damage number +---@param weaponDefID number +---@param projectileID number +---@param attackerID number +---@param attackerDefID number +---@param attackerTeam number +function FeatureDamaged(featureID, featureDefID, featureTeam, damage, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam) end + +---Projectiles +--- +---@section projectiles +--- +---The following Callins are only called for weaponDefIDs registered via Script.SetWatchWeapon. + +---Called when the projectile is created. +--- +---Note that weaponDefID is missing if the projectile is spawned as part of a burst, but `Spring.GetProjectileDefID` and `Spring.GetProjectileName` still work in callin scope using proID. +--- +---@param proID number +---@param proOwnerID number +---@param weaponDefID number +function ProjectileCreated(proID, proOwnerID, weaponDefID) end + +---Called when the projectile is destroyed. +--- +---@param proID number +---@param ownerID number +---@param proWeaponDefID number +function ProjectileDestroyed(proID, ownerID, proWeaponDefID) end + +---Called when an explosion occurs. +--- +---@param weaponDefID number +---@param px number +---@param py number +---@param pz number +---@param attackerID number +---@param projectileID number +---@return boolean noGfx if then no graphical effects are drawn by the engine for this explosion. +function Explosion(weaponDefID, px, py, pz, attackerID, projectileID) end + +---Called when a units stockpile of weapons increases or decreases. +--- +---@param unitID integer +---@param unitDefID integer +---@param unitTeam integer +---@param weaponNum integer +---@param oldCount integer +---@param newCount integer +function StockpileChanged(unitID, unitDefID, unitTeam, weaponNum, oldCount, newCount) end + +---Receives messages from unsynced sent via `Spring.SendLuaRulesMsg` or `Spring.SendLuaUIMsg`. +--- +---@param msg string +---@param playerID number +function RecvLuaMsg(msg, playerID) end + +---Called when a chat command '/save' or '/savegame' is received. +--- +---@param zip table a userdatum representing the savegame zip file. See Lua_SaveLoad. +function Save(zip) end + +---Called when the unsynced copy of the height-map is altered. +--- +---@return number x1 +---@return number z1 +---@return number x2 +---@return number z2 +function UnsyncedHeightMapUpdate() end + +---Called for every draw frame (including when the game is paused) and at least once per sim frame except when catching up. +--- +---@param dt number the time since the last update. +function Update(dt) end + +---Called whenever the window is resized. +--- +---@param viewSizeX number +---@param viewSizeY number +function ViewResize(viewSizeX, viewSizeY) end + +function SunChanged() end + +---Used to set the default command when a unit is selected. First parameter is the type of the object pointed at (either "unit or "feature") and the second is its unitID or featureID respectively. +--- +---@param type string "unit" | "feature" +---@param id integer unitID | featureID +function DefaultCommand(type, id) end + +---Draw* Functions +--- +---@section draw +--- +---Inside the Draw* functions, you can use the Lua OpenGL Api to draw graphics. +--- +---Avoid doing heavy calculations inside these callins; ideally, do the calculations elsewhere and use Draw callins only for drawing. + +---Use this callin to update textures, shaders, etc. +--- +---Doesn't render to screen! +---Also available to LuaMenu. +function DrawGenesis() end + +---Spring draws command queues, 'map stuff', and map marks. +function DrawWorld() end + +---Spring draws units, features, some water types, cloaked units, and the sun. +function DrawWorldPreUnit() end + +---Called before decals are drawn +function DrawPreDecals() end + +function DrawWaterPost() end + +---Invoked after semi-transparent shadows pass is about to conclude +--- +---This callin has depth and color buffer of shadowmap bound via FBO as well as the FFP state to do "semi-transparent" shadows pass (traditionally only used to draw shadows of shadow casting semi-transparent particles). Can be used to draw nice colored shadows. +function DrawShadowPassTransparent() end + +function DrawWorldShadow() end + +function DrawWorldReflection() end + +function DrawWorldRefraction() end + +---Runs at the start of the forward pass when a custom map shader has been assigned via `Spring.SetMapShader` (convenient for setting uniforms). +function DrawGroundPreForward() end + +function DrawGroundPostForward() end + +---Runs at the start of the deferred pass when a custom map shader has been assigned via `Spring.SetMapShader` (convenient for setting uniforms). +function DrawGroundPreDeferred() end + +function DrawGroundDeferred() end + +---This runs at the end of its respective deferred pass. +--- +---Allows proper frame compositing (with ground flashes/decals/foliage/etc, which are drawn between it and `DrawWorldPreUnit`) via `gl.CopyToTexture`. +function DrawGroundPostDeferred() end + +---Runs at the end of the unit deferred pass. +--- +---Informs Lua code it should make use of the $model_gbuffer_* textures before another pass overwrites them (and to allow proper blending with e.g. cloaked objects which are drawn between these events and DrawWorld via gl.CopyToTexture). N.B. The *PostDeferred events are only sent (and only have a real purpose) if forward drawing is disabled. +function DrawUnitsPostDeferred() end + +---Runs at the end of the feature deferred pass to inform Lua code it should make use of the $model_gbuffer_* textures before another pass overwrites them (and to allow proper blending with e.g. cloaked objects which are drawn between these events and DrawWorld via gl.CopyToTexture). N.B. The *PostDeferred events are only sent (and only have a real purpose) if forward drawing is disabled. +function DrawFeaturesPostDeferred() end + +function DrawShadowUnitsLua() end + +function DrawShadowFeaturesLua() end + +---DrawWorldPreParticles is called multiples times per draw frame. +---Each call has a different permutation of values for drawAboveWater, drawBelowWater, drawReflection, and drawRefraction. +--- +---@param drawAboveWater boolean +---@param drawBelowWater boolean +---@param drawReflection boolean +---@param drawRefraction boolean +function DrawWorldPreParticles(drawAboveWater, drawBelowWater, drawReflection, drawRefraction) end + +---Also available to LuaMenu. +--- +---@param viewSizeX number +---@param viewSizeY number +function DrawScreen(viewSizeX, viewSizeY) end + +---@param viewSizeX number +---@param viewSizeY number +function DrawScreenEffects(viewSizeX, viewSizeY) end + +---Similar to DrawScreenEffects, this can be used to alter the contents of a frame after it has been completely rendered (i.e. World, MiniMap, Menu, UI). +--- +---@param viewSizeX number +---@param viewSizeY number +function DrawScreenPost(viewSizeX, viewSizeY) end + +---@param sx number relative to the minimap's position and scale. +---@param sy number relative to the minimap's position and scale. +function DrawInMinimap(sx, sy) end + +---@param sx number relative to the minimap's position and scale. +---@param sy number relative to the minimap's position and scale. +function DrawInMinimapBackground(sx, sy) end + +---Called every 60 frames, calculating delta between `GameFrame` and `GameProgress`. +--- +---Can give an ETA about catching up with simulation for mid-game join players. +--- +---@param serverFrameNum integer +function GameProgress(serverFrameNum) end + +---Called when the keymap changes +--- +---Can be caused due to a change in language or keyboard +function KeyMapChanged() end + +---Input +--- +---@section input + +---Key Modifier Params +--- +---@class KeyModifiers +---@field right boolean Right mouse key pressed +---@field alt boolean Alt key pressed +---@field ctrl boolean Ctrl key pressed +---@field shift boolean Shift key pressed +local KeyModifiers = {} + +---Called repeatedly when a key is pressed down. +--- +---Return true if you don't want other callins or the engine to also receive this keypress. A list of key codes can be seen at the SDL wiki. +--- +---@param keyCode number +---@param mods KeyModifiers +---@param isRepeat boolean If you want an action to occur only once check for isRepeat == false. +---@param label boolean the name of the key +---@param utf32char number (deprecated) always 0 +---@param scanCode number +---@param actionList table the list of actions for this keypress +---@return boolean halt whether to halt the chain for consumers of the keypress +function KeyPress(keyCode, mods, isRepeat, label, utf32char, scanCode, actionList) end + +---Called when the key is released. +--- +---@param keyCode number +---@param mods KeyModifiers +---@param label boolean the name of the key +---@param utf32char number (deprecated) always 0 +---@param scanCode number +---@param actionList table the list of actions for this keyrelease +---@return boolean +function KeyRelease(keyCode, mods, label, utf32char, scanCode, actionList) end + +---Called whenever a key press results in text input. +--- +---@param utf8char string +function TextInput(utf8char) end + +---@param utf8 string +---@param start number +---@param length number +function TextEditing(utf8, start, length) end + +---Called when a mouse button is pressed. +--- +---The button parameter supports up to 7 buttons. Must return true for `MouseRelease` and other functions to be called. +--- +---@param x number +---@param y number +---@param button number +---@return boolean becomeMouseOwner +function MousePress(x, y, button) end + +---Called when a mouse button is released. +--- +---Please note that in order to have Spring call `Spring.MouseRelease`, you need to have a `Spring.MousePress` call-in in the same addon that returns true. +--- +---@param x number +---@param y number +---@param button number +---@return boolean becomeMouseOwner +function MouseRelease(x, y, button) end + +---Called when the mouse is moved. +--- +---@param x number final x position +---@param y number final y position +---@param dx number distance travelled in x +---@param dy number distance travelled in y +---@param button number +function MouseMove(x, y, dx, dy, button) end + +---Called when the mouse wheel is moved. +--- +---@param up boolean the direction +---@param value number the amount travelled +function MouseWheel(up, value) end + +---Called every `Update`. +--- +---Must return true for `Mouse*` events and `Spring.GetToolTip` to be called. +--- +---@param x number +---@param y number +---@return boolean isAbove +function IsAbove(x, y) end + +---Called when `Spring.IsAbove` returns true. +--- +---@param x number +---@param y number +---@return string tooltip +function GetTooltip(x, y) end + +---Called when a command is issued. +--- +---@param cmdID integer +---@param cmdParams table +---@param options CommandOptions +---@return boolean Returning true deletes the command and does not send it through the network. +function CommandNotify(cmdID, cmdParams, options) end + +---Called when text is entered into the console (e.g. `Spring.Echo`). +--- +---@param msg string +---@param priority integer +function AddConsoleLine(msg, priority) end + +---Called when a unit is added to or removed from a control group. +--- +---@param groupID number +function GroupChanged(groupID) end + +---@param ttType string "unit" | "feature" | "ground" | "selection" +---@param data1 number unitID | featureID | posX +---@param data2 number? posY +---@param data3 number? posZ +---@return string newTooltip +function WorldTooltip(ttType, data1, data2, data3) end + +---@param playerID number +---@param type string "point" | "line" | "erase" +---@param posX number +---@param posY number +---@param posZ number +---@param data4 string|number point: label, erase: radius, line: pos2X +---@param pos2Y number? when type is line +---@param pos2Z number? when type is line +function MapDrawCmd(playerID, type, posX, posY, posZ, data4, pos2Y, pos2Z) end + +---@param state string +---@param ready boolean +---@param playerStates table +---@return boolean success +---@return boolean newReady +function GameSetup(state, ready, playerStates) end + +---@param aiTeam integer +---@param dataStr string +function RecvSkirmishAIMessage(aiTeam, dataStr) end + +---Downloads +--- +---@section downloads + +---Called when a Pr-downloader download is queued +--- +---@param id number +---@param name string +---@param type string +function DownloadQueued(id, name, type) end + +---Called when a Pr-downloader download is started via VFS.DownloadArchive. +--- +---@param id number +function DownloadStarted(id) end + +---Called when a Pr-downloader download finishes successfully. +--- +---@param id number +function DownloadFinished(id) end + +---Called when a Pr-downloader download fails to complete. +--- +---@param id number +---@param errorID number +function DownloadFailed(id, errorID) end + +---Called incrementally during a Pr-downloader download. +--- +---@param id number +---@param downloaded number +---@param total number +function DownloadProgress(id, downloaded, total) end \ No newline at end of file diff --git a/library/LuaHandleSynced.lua b/library/LuaHandleSynced.lua new file mode 100644 index 00000000000..00cc134d434 --- /dev/null +++ b/library/LuaHandleSynced.lua @@ -0,0 +1,392 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaHandleSynced.cpp +--- +---@meta + +---Callins, functions called by the Engine (Synced) +--- +---@see rts/Lua/LuaHandleSynced.cpp + +---Misc +--- +---@section misc + +---Receives data sent via `SendToUnsynced` callout. +--- +---@param arg1 any +---@param arg2 any +---@param argn any +function RecvFromSynced(arg1, arg2, argn) end + +---Custom Object Rendering +--- +---For the following calls drawMode can be one of the following, notDrawing = 0, normalDraw = 1, shadowDraw = 2, reflectionDraw = 3, refractionDraw = 4, and finally gameDeferredDraw = 5 which was added in 102.0. +--- +---@section custom_object + +---For custom rendering of units +--- +---@param unitID integer +---@param drawMode number +---@return boolean suppressEngineDraw +function DrawUnit(unitID, drawMode) end + +---For custom rendering of features +--- +---@param featureID integer +---@param drawMode number +---@return boolean suppressEngineDraw +function DrawFeature(featureID, drawMode) end + +---For custom rendering of shields. +--- +---@param featureID integer +---@param weaponID integer +---@param drawMode number +---@return boolean suppressEngineDraw +function DrawShield(featureID, weaponID, drawMode) end + +---For custom rendering of weapon (& other) projectiles +--- +---@param projectileID integer +---@param drawMode number +---@return boolean suppressEngineDraw +function DrawProjectile(projectileID, drawMode) end + +---@param uuid number +---@param drawMode number +---@return boolean suppressEngineDraw +function DrawMaterial(uuid, drawMode) end + +---Called when the unit reaches an unknown command in its queue (i.e. one not handled by the engine). +--- +---@param unitID integer +---@param unitDefID integer +---@param unitTeam integer +---@param cmdID integer +---@param cmdParams number[] +---@param cmdOptions CommandOptions +---@param cmdTag number +---@return boolean whether to remove the command from the queue +function CommandFallback(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag) end + +---Called when the command is given, before the unit's queue is altered. +--- +---The queue remains untouched when a command is blocked, whether it would be queued or replace the queue. +--- +---@param unitID integer +---@param unitDefID integer +---@param unitTeam integer +---@param cmdID integer +---@param cmdParams number[] +---@param cmdOptions CommandOptions +---@param cmdTag number +---@param synced boolean +---@param fromLua boolean +---@return boolean whether it should be let into the queue. +function AllowCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag, synced, fromLua) end + +---Called just before unit is created. +--- +---@param unitDefID integer +---@param builderID integer +---@param builderTeam integer +---@param x number +---@param y number +---@param z number +---@param facing number +---@return boolean allow, boolean dropOrder +function AllowUnitCreation(unitDefID, builderID, builderTeam, x, y, z, facing) end + +---Called just before a unit is transferred to a different team. +--- +---@param unitID integer +---@param unitDefID integer +---@param oldTeam integer +---@param newTeam integer +---@param capture boolean +---@return boolean whether or not the transfer is permitted. +function AllowUnitTransfer(unitID, unitDefID, oldTeam, newTeam, capture) end + +---Called just before a unit progresses its build percentage. +--- +---@param builderID integer +---@param builderTeam integer +---@param unitID integer +---@param unitDefID integer +---@param part number +---@return boolean whether or not the build makes progress. +function AllowUnitBuildStep(builderID, builderTeam, unitID, unitDefID, part) end + +---@param builderID integer +---@param builderTeam integer +---@param unitID integer +---@param unitDefID integer +---@param part number +---@return boolean whether or not the capture makes progress. +function AllowUnitCaptureStep(builderID, builderTeam, unitID, unitDefID, part) end + +---@param transporterID integer +---@param transporterUnitDefID integer +---@param transporterTeam integer +---@param transporteeID integer +---@param transporteeUnitDefID integer +---@param transporteeTeam integer +---@return boolean whether or not the transport is allowed +function AllowUnitTransport(transporterID, transporterUnitDefID, transporterTeam, transporteeID, transporteeUnitDefID, transporteeTeam) end + +---@param transporterID integer +---@param transporterUnitDefID integer +---@param transporterTeam integer +---@param transporteeID integer +---@param transporteeUnitDefID integer +---@param transporteeTeam integer +---@param x number +---@param y number +---@param z number +---@return boolean whether or not the transport load is allowed +function AllowUnitTransportLoad(transporterID, transporterUnitDefID, transporterTeam, transporteeID, transporteeUnitDefID, transporteeTeam, x, y, z) end + +---@param transporterID integer +---@param transporterUnitDefID integer +---@param transporterTeam integer +---@param transporteeID integer +---@param transporteeUnitDefID integer +---@param transporteeTeam integer +---@param x number +---@param y number +---@param z number +---@return boolean whether or not the transport unload is allowed +function AllowUnitTransportUnload(transporterID, transporterUnitDefID, transporterTeam, transporteeID, transporteeUnitDefID, transporteeTeam, x, y, z) end + +---@param unitID integer +---@param enemyID integer? +---@return boolean whether unit is allowed to cloak +function AllowUnitCloak(unitID, enemyID) end + +---@param unitID integer +---@param objectID integer? +---@param weaponNum number? +---@return boolean whether unit is allowed to decloak +function AllowUnitCloak(unitID, objectID, weaponNum) end + +---@param unitID integer +---@param targetID integer +---@return boolean whether unit is allowed to selfd +function AllowUnitKamikaze(unitID, targetID) end + +---Called just before feature is created. +--- +---@param featureDefID integer +---@param teamID integer +---@param x number +---@param y number +---@param z number +---@return boolean whether or not the creation is permitted +function AllowFeatureCreation(featureDefID, teamID, x, y, z) end + +---Called just before a feature changes its build percentage. +--- +---Note that this is also called for resurrecting features, and for refilling features with resources before resurrection. +---On reclaim the part values are negative, and on refill and ressurect they are positive. +---Part is the percentage the feature be built or reclaimed per frame. +---Eg. for a 30 workertime builder, that's a build power of 1 per frame. +---For a 50 buildtime feature reclaimed by this builder, part will be 100/-50(/1) = -2%, or -0.02 numerically. +--- +---@param builderID integer +---@param builderTeam integer +---@param featureID integer +---@param featureDefID integer +---@param part number +---@return boolean whether or not the change is permitted +function AllowFeatureBuildStep(builderID, builderTeam, featureID, featureDefID, part) end + +---Called when a team sets the sharing level of a resource. +--- +---@param teamID integer +---@param res string +---@param level number +---@return boolean whether or not the sharing level is permitted +function AllowResourceLevel(teamID, res, level) end + +---Called just before resources are transferred between players. +--- +---@param oldTeamID integer +---@param newTeamID integer +---@param res string +---@param amount number +---@return boolean whether or not the transfer is permitted. +function AllowResourceTransfer(oldTeamID, newTeamID, res, amount) end + +---Determines if this unit can be controlled directly in FPS view. +--- +---@param unitID integer +---@param unitDefID integer +---@param unitTeam integer +---@param playerID integer +---@return boolean allow +function AllowDirectUnitControl(unitID, unitDefID, unitTeam, playerID) end + +---Called when a construction unit wants to "use his nano beams". +--- +---@param unitID integer +---@param unitDefID integer +---@param action number one of following: +--- +----1 Build +---CMD.REPAIR Repair +---CMD.RECLAIM Reclaim +---CMD.RESTORE Restore +---CMD.RESURRECT Resurrect +---CMD.CAPTURE Capture +---@return boolean actionAllowed +function AllowBuilderHoldFire(unitID, unitDefID, action) end + +---Whether a start position should be allowed +--- +---clamped{X,Y,Z} are the coordinates clamped into start-boxes, raw is where player tried to place their marker. +--- +---The readyState can be any one of: +--- +---0 - player picked a position, +---1 - player clicked ready, +---2 - player pressed ready OR the game was force-started (player did not click ready, but is now forcibly readied) or +---3 - the player failed to load. +---The default 'failed to choose' start-position is the north-west point of their startbox, or (0,0,0) if they do not have a startbox. +--- +---@param playerID integer +---@param teamID integer +---@param readyState number +---@param clampedX number +---@param clampedY number +---@param clampedZ number +---@param rawX number +---@param rawY number +---@param rawZ number +---@return boolean allow +function AllowStartPosition(playerID, teamID, readyState, clampedX, clampedY, clampedZ, rawX, rawY, rawZ) end + +---Enable both Spring.MoveCtrl.SetCollideStop and Spring.MoveCtrl.SetTrackGround to enable this call-in. +--- +---@param unitID integer +---@param unitDefID integer +---@param unitTeam integer +---@param data number was supposed to indicate the type of notification but currently never has a value other than 1 ("unit hit the ground"). +---@return boolean whether or not the unit should remain script-controlled (false) or return to engine controlled movement (true). +function MoveCtrlNotify(unitID, unitDefID, unitTeam, data) end + +---Called when pre-building terrain levelling terraforms are completed (c.f. levelGround) +--- +---@param unitID integer +---@param unitDefID integer +---@param unitTeam integer +---@param buildUnitID integer +---@param buildUnitDefID integer +---@param buildUnitTeam integer +---@return boolean if true the current build order is terminated +function TerraformComplete(unitID, unitDefID, unitTeam, buildUnitID, buildUnitDefID, buildUnitTeam) end + +---Damage Controllers +--- +---For the following callins, in addition to being a regular weapon, weaponDefID may be one of the following: +--- +----1 - debris collision, also default of Spring.AddUnitDamage +----2 - ground collision +----3 - object collision +----4 - fire damage +----5 - water damage +----6 - kill damage +----7 - crush damage + +---Called before damage is applied to the unit, allows fine control over how much damage and impulse is applied. +--- +---Called after every damage modification (even `HitByWeaponId`) but before the damage is applied +--- +---expects two numbers returned by lua code: +---1st is stored under *newDamage if newDamage != NULL +---2nd is stored under *impulseMult if impulseMult != NULL +--- +---@param unitID integer +---@param unitDefID integer +---@param unitTeam integer +---@param damage number +---@param paralyzer boolean +---@param weaponDefID integer? Synced Only +---@param projectileID integer? Synced Only +---@param attackerID integer? Synced Only +---@param attackerDefID integer? Synced Only +---@param attackerTeam integer? Synced Only +---@return number newDamage, number impulseMult +function UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam) end + +---Called before damage is applied to the feature. +--- +---Allows fine control over how much damage and impulse is applied. +--- +---@param featureID integer +---@param featureDefID integer +---@param featureTeam integer +---@param damage number +---@param weaponDefID integer +---@param projectileID integer +---@param attackerID integer +---@param attackerDefID integer +---@param attackerTeam integer +---@return number newDamage +---@return number impulseMult +function FeaturePreDamaged(featureID, featureDefID, featureTeam, damage, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam) end + +---Called before any engine shield-vs-projectile logic executes. +--- +---If the weapon is a hitscan type (BeamLaser or LightningCanon) then proID is nil and beamEmitterWeaponNum and beamEmitterUnitID are populated instead. +--- +---@param projectileID integer +---@param projectileOwnerID integer +---@param shieldWeaponNum integer +---@param shieldCarrierID integer +---@param bounceProjectile boolean +---@param beamEmitterWeaponNum integer +---@param beamEmitterUnitID integer +---@param startX number +---@param startY number +---@param startZ number +---@param hitX number +---@param hitY number +---@param hitZ number +---@return boolean if true the gadget handles the collision event and the engine does not remove the projectile +function ShieldPreDamaged(projectileID, projectileOwnerID, shieldWeaponNum, shieldCarrierID, bounceProjectile, beamEmitterWeaponNum, beamEmitterUnitID, startX, startY, startZ, hitX, hitY, hitZ) end + +---Determines if this weapon can automatically generate targets itself. See also commandFire weaponDef tag. +--- +---@param attackerID integer +---@param attackerWeaponNum integer +---@param attackerWeaponDefID integer +---@return boolean allowCheck +---@return boolean ignoreCheck +function AllowWeaponTargetCheck(attackerID, attackerWeaponNum, attackerWeaponDefID) end + +---Controls blocking of a specific target from being considered during a weapon's periodic auto-targeting sweep. +--- +---@param attackerID integer +---@param targetID integer +---@param attackerWeaponNum integer +---@param attackerWeaponDefID integer +---@param defPriority number +---@return boolean allowed +---@return number the new priority for this target (if you don't want to change it, return defPriority). Lower priority targets are targeted first. +function AllowWeaponTarget(attackerID, targetID, attackerWeaponNum, attackerWeaponDefID, defPriority) end + +---Controls blocking of a specific intercept target from being considered during an interceptor weapon's periodic auto-targeting sweep. +--- +---Only called for weaponDefIDs registered via Script.SetWatchWeapon. +--- +---@param interceptorUnitID integer +---@param interceptorWeaponID integer +---@param targetProjectileID integer +---@return boolean allowed +function AllowWeaponInterceptTarget(interceptorUnitID, interceptorWeaponID, targetProjectileID) end \ No newline at end of file diff --git a/library/LuaIO.lua b/library/LuaIO.lua new file mode 100644 index 00000000000..81aa6e329d4 --- /dev/null +++ b/library/LuaIO.lua @@ -0,0 +1,10 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaIO.cpp +--- +---@meta + diff --git a/library/LuaInputReceiver.lua b/library/LuaInputReceiver.lua new file mode 100644 index 00000000000..550b9e74de1 --- /dev/null +++ b/library/LuaInputReceiver.lua @@ -0,0 +1,10 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaInputReceiver.cpp +--- +---@meta + diff --git a/library/LuaInterCall.lua b/library/LuaInterCall.lua new file mode 100644 index 00000000000..f115ef626a0 --- /dev/null +++ b/library/LuaInterCall.lua @@ -0,0 +1,10 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaInterCall.cpp +--- +---@meta + diff --git a/library/LuaIntro.lua b/library/LuaIntro.lua new file mode 100644 index 00000000000..3ab9e7ba6b7 --- /dev/null +++ b/library/LuaIntro.lua @@ -0,0 +1,16 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaIntro.cpp +--- +---@meta + +---Draws custom load screens. +function DrawLoadScreen() end + +---@param message string +---@param replaceLastLine boolean +function LoadProgress(message, replaceLastLine) end \ No newline at end of file diff --git a/library/LuaMaterial.lua b/library/LuaMaterial.lua new file mode 100644 index 00000000000..1bae827978d --- /dev/null +++ b/library/LuaMaterial.lua @@ -0,0 +1,10 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaMaterial.cpp +--- +---@meta + diff --git a/library/LuaMathExtra.lua b/library/LuaMathExtra.lua new file mode 100644 index 00000000000..2781a170cf6 --- /dev/null +++ b/library/LuaMathExtra.lua @@ -0,0 +1,86 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaMathExtra.cpp +--- +---@meta + +---math extensions +--- +---@see rts/Lua/LuaMathExtra.cpp + +---Returns the length of hypotenuse of right angle triangle with sides x and y, +---equivalent to `sqrt(x*x + y*y)`, but has better numerical stability and +---internally handles intermediate overflows/underflows, but is also slower. +--- +---@param x number +---@param y number +---@return number `sqrt(x*x+y*y)` +function math.hypot(x, y) end + +---Returns the length of the diagonal of an n-dimensional box (or the length of +---an n-component vector). Rather quick method that does not handle intermediate +---overflows/underflows nor is made for numerical stability. +--- +---@param x number +---@param ... number +---@return number diagonal +function math.diag(x, ...) end + +---Returns x clamped to min and max boundaries. +--- +---@param value number +---@param min number +---@param max number +---@return number clamped +function math.clamp(value, min, max) end + +---Returns 0 if x == 0, 1 if x > 0, -1 if x < 0 +--- +---@param x number +---@return number sign +function math.sgn(x) end + +---Returns linear interpolation between x and y with ratio a (x+(y-x)*a). +--- +---@param x number +---@param y number +---@param a number +---@return number (x+(y-x)*a) +function math.mix(x, y, a) end + +---Returns x rounded to n decimals, if n is omitted or <=0, rounds to nearest +---integer. Note that Spring's Lua interpreter uses 32-bit floats for all +---numbers so max. precision is ~7 decimal digits. +--- +---@param x number +---@param decimals number +---@return number rounded +function math.round(x, decimals) end + +---Returns erf(x), the Gauss error function, between -1 and 1. +--- +---@param x number +---@return number erf +function math.erf(x) end + +---Applies the smoothstep function +--- +---Clamps and rescales v to a value between [0; 1] based on the edges and then applies the smoothstep function. +---For example math.smoothstep(10, 25, 15) is 0.259, because 15 is 0.333 of the way from 10 to 25, and smoothstep(0.333) is 0.259 +--- +---@param edge0 number +---@param edge1 number +---@param v number +---@return number smoothstep +function math.smoothstep(edge0, edge1, v) end + +---Returns the normalize vector of an given vector. +--- +---@param x number +---@param ... number +---@return number ... normalized +function math.normalize(x, ...) end \ No newline at end of file diff --git a/library/LuaMemPool.lua b/library/LuaMemPool.lua new file mode 100644 index 00000000000..5841a339af9 --- /dev/null +++ b/library/LuaMemPool.lua @@ -0,0 +1,10 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaMemPool.cpp +--- +---@meta + diff --git a/library/LuaMenu.lua b/library/LuaMenu.lua new file mode 100644 index 00000000000..e40dad63a3c --- /dev/null +++ b/library/LuaMenu.lua @@ -0,0 +1,24 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaMenu.cpp +--- +---@meta + +---Lua Menu API +--- +---@see rts/Lua/LuaMenu.cpp + +---Called whenever LuaMenu is on with no game loaded. +function ActivateMenu() end + +---Called whenever LuaMenu is on with a game loaded. +function ActivateGame() end + +---Enables Draw{Genesis,Screen,ScreenPost} callins if true is returned, otherwise they are called once every 30 seconds. Only active when a game isn't running. +--- +---@return boolean allowDraw +function AllowDraw() end \ No newline at end of file diff --git a/library/LuaMetalMap.lua b/library/LuaMetalMap.lua new file mode 100644 index 00000000000..901d077472e --- /dev/null +++ b/library/LuaMetalMap.lua @@ -0,0 +1,19 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaMetalMap.cpp +--- +---@meta + +---Metal Map Lua API +--- +---@see rts/Lua/LuaMetalMap.cpp + +---@param x integer in worldspace/16. +---@param z integer in worldspace/16. +---@param metalAmount number must be between 0 and 255*maxMetal (with maxMetal from the .smd or mapinfo.lua). +---@return nil +function Spring.SetMetalAmount(x, z, metalAmount) end \ No newline at end of file diff --git a/library/LuaObjectRendering.lua b/library/LuaObjectRendering.lua new file mode 100644 index 00000000000..23c1ac989e8 --- /dev/null +++ b/library/LuaObjectRendering.lua @@ -0,0 +1,10 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaObjectRendering.cpp +--- +---@meta + diff --git a/library/LuaOpenGL.lua b/library/LuaOpenGL.lua new file mode 100644 index 00000000000..588a78f58d5 --- /dev/null +++ b/library/LuaOpenGL.lua @@ -0,0 +1,62 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaOpenGL.cpp +--- +---@meta + +---Lua OpenGL API +--- +---@see rts/Lua/LuaOpenGL.cpp + +---Text +--- +---@section text + +gl = { + +} + +---@param text string +---@param x number +---@param y number +---@param size number +---@param options string? concatenated string of option characters. +--- +---- horizontal alignment: +---- 'c' = center +---- 'r' = right +---- vertical alignment: +---- 'a' = ascender +---- 't' = top +---- 'v' = vertical center +---- 'x' = baseline +---- 'b' = bottom +---- 'd' = descender +---- decorations: +---- 'o' = black outline +---- 'O' = white outline +---- 's' = shadow +---- other: +---- 'n' = don't round vertex coords to nearest integer (font may get blurry) +---@return nil +function gl.Text(text, x, y, size, options) end + +---Draw Basics +--- +---@section draw_basics + +---@param r number Red +---@param g number Green +---@param b number Blue +---@param a number? Alpha (Default: 1.0f) +function gl.Color(r, g, b, a) end + +---@param rgbs [number,number,number,number] Red, green, blue, alpha +function gl.Color(rgbs) end + +---@param rgb [number,number,number] Red, green, blue +function gl.Color(rgb) end \ No newline at end of file diff --git a/library/LuaOpenGLUtils.lua b/library/LuaOpenGLUtils.lua new file mode 100644 index 00000000000..6f1460e7163 --- /dev/null +++ b/library/LuaOpenGLUtils.lua @@ -0,0 +1,10 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaOpenGLUtils.cpp +--- +---@meta + diff --git a/library/LuaParser.lua b/library/LuaParser.lua new file mode 100644 index 00000000000..bc67b955301 --- /dev/null +++ b/library/LuaParser.lua @@ -0,0 +1,10 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaParser.cpp +--- +---@meta + diff --git a/library/LuaPathFinder.lua b/library/LuaPathFinder.lua new file mode 100644 index 00000000000..0890aef5b25 --- /dev/null +++ b/library/LuaPathFinder.lua @@ -0,0 +1,10 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaPathFinder.cpp +--- +---@meta + diff --git a/library/LuaRBOs.lua b/library/LuaRBOs.lua new file mode 100644 index 00000000000..49e05a9940a --- /dev/null +++ b/library/LuaRBOs.lua @@ -0,0 +1,39 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaRBOs.cpp +--- +---@meta + +---RBO +--- +---@see rts/Lua/LuaRBOs.cpp + +---User Data RBO +--- +---@class RBO +---@field target GL +---@field format GL +---@field xsize integer +---@field ysize integer +---@field valid boolean +---@field samples integer will return globalRendering->msaaLevel for multisampled RBO or 0 otherwise +local RBO = {} + +---@class CreateRBOData +---@field target GL +---@field format GL +---@field samples number? any number here will result in creation of multisampled RBO +local CreateRBOData = {} + +---@param xsize integer +---@param ysize integer +---@param data CreateRBOData +---@return RBO +function gl.CreateRBO(xsize, ysize, data) end + +---@param rbo RBO +function gl.DeleteRBO(rbo) end \ No newline at end of file diff --git a/library/LuaRules.lua b/library/LuaRules.lua new file mode 100644 index 00000000000..4f4472c7679 --- /dev/null +++ b/library/LuaRules.lua @@ -0,0 +1,13 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaRules.cpp +--- +---@meta + +---Lua Rules +--- +---@see rts/Lua/LuaRules.cpp \ No newline at end of file diff --git a/library/LuaRulesParams.lua b/library/LuaRulesParams.lua new file mode 100644 index 00000000000..41654fd6346 --- /dev/null +++ b/library/LuaRulesParams.lua @@ -0,0 +1,10 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaRulesParams.cpp +--- +---@meta + diff --git a/library/LuaScream.lua b/library/LuaScream.lua new file mode 100644 index 00000000000..7a16095b9cf --- /dev/null +++ b/library/LuaScream.lua @@ -0,0 +1,10 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaScream.cpp +--- +---@meta + diff --git a/library/LuaShaders.lua b/library/LuaShaders.lua new file mode 100644 index 00000000000..f47f1422c16 --- /dev/null +++ b/library/LuaShaders.lua @@ -0,0 +1,221 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaShaders.cpp +--- +---@meta + +---Shader creation and management +--- +---These functions are ONLY available if the graphics adapter supports GLSL. +---Please test in your scripts if one of them exists before you use them. In headless mode, the gl. callouts are nil. +--- +---@see rts/Lua/LuaShaders.cpp + +---Returns the shader compilation error log. This is empty if the shader linking failed, in that case, check your in/out blocks and ensure they match. +--- +---@return string infoLog +function gl.GetShaderLog() end + +---A table of uniform name to value. +--- +---The Uniforms are the values you send along with the shader-program. To use +---them in the shader-program declare them like this: `uniform float frame;` +--- +---Specify a Lua array to initialize GLSL arrays. +--- +---The engine will automatically fill in an appropriately named uniform for team +---colour if it is declared; +--- +---```glsl +---uniform vec4 teamColor; +---``` +--- +---@class UniformParam : { [string]: T|T[] } +local UniformParam = {} + +---@class ShaderParams +---@field vertex string? +--- +---The "Vetex" or vertex-shader is your GLSL-Code as string, its written in a +---C-Dialect. This shader is busy deforming the geometry of a unit but it can +---not create new polygons. Use it for waves, wobbling surfaces etc. +---@field tcs string? +--- +---The "TCS" or Tesselation Control Shader controls how much tessellation a +---particular patch gets; it also defines the size of a patch, thus allowing it +---to augment data. It can also filter vertex data taken from the vertex shader. +---The main purpose of the TCS is to feed the tessellation levels to the +---Tessellation primitive generator stage, as well as to feed patch data (as its +---output values) to the Tessellation Evaluation Shader stage. +---@field tes string? +--- +---The "TES" or Tesselation Evaluation Shader takes the abstract patch generated +---by the tessellation primitive generation stage, as well as the actual vertex +---data for the entire patch, and generates a particular vertex from it. Each +---TES invocation generates a single vertex. It can also take per-patch data +---provided by the Tessellation Control Shader. +---@field geometry string? +--- +---The "Geometry" or Geometry-shader can create new vertices and vertice-stripes +---from points. +---@field fragment string? +--- +---The "Fragment" or Fragment-shader (sometimes called pixel-Shader) is post +---processing the allready rendered picture (for example drawing stars on the +---sky). +--- +---Remember textures are not always 2 dimensional pictures. They can contain +---information about the depth, or the third value marks areas and the strength +---at which these are processed. +---@field uniform UniformParam? +---@field uniformInt UniformParam? +---@field uniformFloat UniformParam? +---@field uniformMatrix UniformParam? +---@field geoInputType integer? inType +---@field geoOutputType integer? outType +---@field geoOutputVerts integer? maxVerts +---@field definitions string? string of shader #defines" +local ShaderParams = {} + +---Create a shader. +--- +---@param shaderParams ShaderParams +---@return integer shaderID +function gl.CreateShader(shaderParams) end + +---Deletes a shader identified by shaderID +--- +---@param shaderID integer +function gl.DeleteShader(shaderID) end + +---Binds a shader program identified by shaderID. Pass 0 to disable the shader. Returns wether the shader was successfully bound. +--- +---@param shaderID integer +---@return boolean linked +function gl.UseShader(shaderID) end + +---Binds a shader program identified by shaderID, and calls the Lua func with +---the specified arguments. +--- +---Can be used in NON-drawing events (to update uniforms etc.)! +--- +---@param shaderID integer +---@param func function +---@param ... any Arguments +function gl.ActiveShader(shaderID, func, ...) end + +---@class ActiveUniform +---@field name string +---@field type string String name of `GL_*` constant. +---@field length integer The character length of `name`. +---@field size integer +---@field location GL +local ActiveUniform = {} + +---Query the active (actually used) uniforms of a shader and identify their +---names, types (float, int, uint) and sizes (float, vec4, ...). +--- +---@param shaderID integer +---@return ActiveUniform[] activeUniforms +function gl.GetActiveUniforms(shaderID) end + +---Returns the locationID of a shaders uniform. Needed for changing uniform +---values with function `gl.Uniform`. +--- +---@param shaderID integer +---@param name string +---@return GL locationID +function gl.GetUniformLocation(shaderID, name) end + +---Sets the uniform float value at the locationID for the currently active +---shader. Shader must be activated before setting uniforms. +--- +---@param locationID GL|string uniformName +---@param f1 number +---@param f2 number? +---@param f3 number? +---@param f4 number? +function gl.Uniform(locationID, f1, f2, f3, f4) end + +---Sets the uniform int value at the locationID for the currently active shader. +---Shader must be activated before setting uniforms. +--- +---@param locationID integer|string uniformName +---@param int1 integer +---@param int2 integer? +---@param int3 integer? +---@param int4 integer? +function gl.UniformInt(locationID, int1, int2, int3, int4) end + +---@alias UniformArrayType +---| 1 # int +---| 2 # float +---| 3 # float matrix + +---Sets the an array of uniform values at the locationID for the currently +---active shader. +--- +---Shader must be activated before setting uniforms. +--- +---@param locationID integer|string uniformName +---@param type UniformArrayType +---@param uniforms number[] Array up to 1024 elements +function gl.UniformArray(locationID, type, uniforms) end + +---Sets the a uniform mat4 locationID for the currently active shader. +--- +---Shader must be activated before setting uniforms. +--- +---Can set one one common matrix like shadow, or by passing 16 additional +---numbers for the matrix. +--- +---@param locationID integer|string uniformName +---@param matrix "shadows"|"camera"|"caminv"|"camprj" Name of common matrix. +function gl.UniformMatrix(locationID, matrix) end + +---Sets the a uniform mat4 locationID for the currently active shader. +--- +---Shader must be activated before setting uniforms. +--- +---Can set one one common matrix like shadow, or by passing 16 additional +---numbers for the matrix. +--- +---@param locationID number|string uniformName +---@param matrix number[] A 2x2, 3x3 or 4x4 matrix. +function gl.UniformMatrix(locationID, matrix) end + +--- +---Return the GLSL compliant definition of UniformMatricesBuffer(idx=0) or UniformParamsBuffer(idx=1) structure. +--- +---@param index number +---@return string glslDefinition +function gl.GetEngineUniformBufferDef(index) end + +--- +---Return the GLSL compliant definition of ModelUniformData structure (per Unit/Feature buffer available on GPU) +--- +---@param index number +---@return string glslDefinition +function gl.GetEngineModelUniformDataDef(index) end + +---Sets the Geometry shader parameters for shaderID. Needed by geometry shader programs (check the opengl GL_ARB_geometry_shader4 extension for glProgramParameteri) +--- +---@param shaderID integer +---@param param number +---@param number number +---@return nil +function gl.SetGeometryShaderParameter(shaderID, param, number) end + +---Sets the tesselation shader parameters for `shaderID`. +--- +---Needed by tesselation shader programs. (Check the opengl +---`GL_ARB_tessellation_shader` extension for `glProgramParameteri`). +--- +---@param param integer +---@param value integer +---@return nil +function gl.SetTesselationShaderParameter(param, value) end \ No newline at end of file diff --git a/library/LuaSyncedCtrl.lua b/library/LuaSyncedCtrl.lua new file mode 100644 index 00000000000..a8ba0ae1f84 --- /dev/null +++ b/library/LuaSyncedCtrl.lua @@ -0,0 +1,1638 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaSyncedCtrl.cpp +--- +---@meta + +---Synced Lua API +--- +---@see rts/Lua/LuaSyncedCtrl.cpp + +---Teams +--- +---@section teams + +---Changes the value of the (one-sided) alliance between: firstAllyTeamID -> secondAllyTeamID. +--- +---@param firstAllyTeamID integer +---@param secondAllyTeamID integer +---@param ally boolean +---@return nil +function Spring.SetAlly(firstAllyTeamID, secondAllyTeamID, ally) end + +---Changes the start box position of an allyTeam. +--- +---@param allyTeamID integer +---@param xMin number left start box boundary (elmos) +---@param zMin number top start box boundary (elmos) +---@param xMax number right start box boundary (elmos) +---@param zMax number bottom start box boundary (elmos) +---@return nil +function Spring.SetAllyTeamStartBox(allyTeamID, xMin, zMin, xMax, zMax) end + +---Assigns a player to a team. +--- +---@param playerID integer +---@param teamID integer +---@return nil +function Spring.AssignPlayerToTeam(playerID, teamID) end + +---Changes access to global line of sight for a team and its allies. +--- +---@param allyTeamID integer +---@param globallos boolean +---@return nil +function Spring.SetGlobalLos(allyTeamID, globallos) end + +---Game End +--- +---@section gameend + +---Will declare a team to be dead (no further orders can be assigned to such teams units). +--- +---Gaia team cannot be killed. +--- +---@param teamID integer +---@return nil +function Spring.KillTeam(teamID) end + +---Will declare game over. +--- +---A list of winning allyteams can be passed, if undecided (like when dropped from the host) it should be empty (no winner), in the case of a draw with multiple winners, all should be listed. +--- +---@param allyTeamID1 number? +---@param allyTeamID2 number? +---@param allyTeamIDn number? +---@return nil +function Spring.GameOver(allyTeamID1, allyTeamID2, allyTeamIDn) end + +---Resources +--- +---@section resources + +---Set tidal strength +--- +---@param strength number +---@return nil +function Spring.SetTidal(strength) end + +---Set wind strength +--- +---@param minStrength number +---@param maxStrength number +---@return nil +function Spring.SetWind(minStrength, maxStrength) end + +---Adds metal or energy resources to the specified team. +--- +---@param teamID integer +---@param type ResourceName +---@param amount number +---@return nil +function Spring.AddTeamResource(teamID, type, amount) end + +---Consumes metal or energy resources of the specified team. +--- +---@param teamID integer +---@param type ResourceName Resource type. +---@param amount number Amount of resource to use. +---@return boolean hadEnough +---True if enough of the resource type was available and was consumed, otherwise false. +function Spring.UseTeamResource(teamID, type, amount) end + +---Consumes metal and/or energy resources of the specified team. +--- +---@param teamID integer +---@param amount ResourceUsage +---@return boolean hadEnough +---True if enough of the resource type(s) were available and was consumed, otherwise false. +function Spring.UseTeamResource(teamID, amount) end + +---@param teamID integer +---@param resource ResourceName|StorageName +---@param amount number +---@return nil +function Spring.SetTeamResource(teamID, resource, amount) end + +---Changes the resource amount for a team beyond which resources aren't stored but transferred to other allied teams if possible. +--- +---@param teamID integer +---@param type ResourceName +---@param amount number +---@return nil +function Spring.SetTeamShareLevel(teamID, type, amount) end + +---Transfers resources between two teams. +--- +---@param teamID_src integer +---@param teamID_recv integer +---@param type ResourceName +---@param amount number +---@return nil +function Spring.ShareTeamResource(teamID_src, teamID_recv, type, amount) end + +---Rules Params +--- +---@section rulesparams + +---Parameters for los access +--- +---If one condition is fulfilled all beneath it are too (e.g. if an unit is in +---LOS it can read params with `inradar=true` even if the param has +---`inlos=false`) All GameRulesParam are public, TeamRulesParams can just be +---`private`,`allied` and/or `public` You can read RulesParams from any Lua +---enviroments! With those losAccess policies you can limit their access. +--- +---NOTE: Need to explicitly declare `public` scope here to prevent LLS from +---detecting field names as access modifiers. +--- +---See https://github.com/LuaLS/lua-language-server/issues/1814 +--- +---@class losAccess +---@field public private boolean? only readable by the ally (default) +---@field public allied boolean? readable by ally + ingame allied +---@field public inlos boolean? readable if the unit is in LOS +---@field public inradar boolean? readable if the unit is in AirLOS +---@field public public boolean? readable by all +local losAccess = {} + +---@param paramName string +---@param paramValue ?number|string numeric paramValues in quotes will be converted to number. +---@tparam +---@return nil +function Spring.SetGameRulesParam(paramName, paramValue) end + +---@param teamID integer +---@param paramName string +---@param paramValue ?number|string numeric paramValues in quotes will be converted to number. +---@tparam +---@return nil +function Spring.SetTeamRulesParam(teamID, paramName, paramValue) end + +---@param playerID integer +---@param paramName string +---@param paramValue ?number|string numeric paramValues in quotes will be converted to number. +---@tparam +---@return nil +function Spring.SetPlayerRulesParam(playerID, paramName, paramValue) end + +---@param unitID integer +---@param paramName string +---@param paramValue ?number|string numeric paramValues in quotes will be converted to number. +---@tparam +---@return nil +function Spring.SetUnitRulesParam(unitID, paramName, paramValue) end + +---@param featureID integer +---@param paramName string +---@param paramValue ?number|string numeric paramValues in quotes will be converted to number. +---@tparam +---@return nil +function Spring.SetFeatureRulesParam(featureID, paramName, paramValue) end + +---Lua to COB +--- +---@section luatocob + +---@param unitID integer +---@param funcName integer|string? Function ID or name. +---@param retArgs integer Number of values to return. +---@param ... any Arguments +---@return number ... +function Spring.CallCOBScript(unitID, funcName, retArgs, ...) end + +---@param unitID integer +---@param funcName string +---@return integer? funcID +function Spring.GetCOBScriptID(unitID, funcName) end + +---Unit Handling +--- +---@section unithandling + +---@see Spring.DestroyUnit +--- +---Offmap positions are clamped! Use MoveCtrl to move to such positions. +---@param unitDefName string|number or unitDefID +---@param x number +---@param y number +---@param z number +---@param facing string|number possible values for facing are: "south" | "s" | 0, "east" | "e" | 1, "north" | "n" | 2, "west" | "w" | 3 +---@param teamID integer +---@param build boolean? (Default: false) the unit is created in "being built" state with buildProgress = 0 +---@param flattenGround boolean? (Default: true) the unit flattens ground, if it normally does so +---@param unitID integer? requests specific unitID +---@param builderID integer? +---@return number|nil unitID meaning unit was created +function Spring.CreateUnit(unitDefName, x, y, z, facing, teamID, build, flattenGround, unitID, builderID) end + +---@see Spring.CreateUnit +---@param unitID integer +---@param selfd boolean? (Default: false) makes the unit act like it self-destructed. +---@param reclaimed boolean? (Default: false) don't show any DeathSequences, don't leave a wreckage. This does not give back the resources to the team! +---@param attackerID integer? +---@param cleanupImmediately boolean? (Default: false) stronger version of reclaimed, removes the unit unconditionally and makes its ID available for immediate reuse (otherwise it takes a few frames) +---@return nil +function Spring.DestroyUnit(unitID, selfd, reclaimed, attackerID, cleanupImmediately) end + +---@param unitID integer +---@param newTeamID integer +---@param given boolean? (Default: true) if false, the unit is captured. +---@return nil +function Spring.TransferUnit(unitID, newTeamID, given) end + +---Unit Control +--- +---@section unitcontrol + +---@param unitID integer +---@param where table keys and values are, respectively and in this order: buildTime=amount, metalCost=amount, energyCost=amount +---@return nil +function Spring.SetUnitCosts(unitID, where) end + +---Unit Resourcing +--- +---@section unitresourcing + +---@param unitID integer +---@param res string +---@param amount number +---@return nil +function Spring.SetUnitResourcing(unitID, res, amount) end + +---@param unitID integer +---@param res table keys are: "[u|c][u|m][m|e]" unconditional | conditional, use | make, metal | energy. Values are amounts +---@return nil +function Spring.SetUnitResourcing(unitID, res) end + +---@param unitID integer +---@param tooltip string +---@return nil +function Spring.SetUnitTooltip(unitID, tooltip) end + +---@param unitID integer +---@param health number|table where keys can be one of health|capture|paralyze|build and values are amounts +---@return nil +function Spring.SetUnitHealth(unitID, health) end + +---@param unitID integer +---@param maxHealth number +---@return nil +function Spring.SetUnitMaxHealth(unitID, maxHealth) end + +---@param unitID integer +---@param stockpile number? +---@param buildPercent number? +---@return nil +function Spring.SetUnitStockpile(unitID, stockpile, buildPercent) end + +---Parameter for weapon states +--- +---@class WeaponState +---@field reloadState integer? +---@field reloadFrame integer? Alias for `reloadState`. +---@field reloadTime number? +---@field reaimTime integer? +---@field accuracy number? +---@field sprayAngle number? +---@field range number? +---If you change the range of a weapon with dynamic damage make sure you use `SetUnitWeaponDamages` to change dynDamageRange as well. +---@field projectileSpeed number? +---@field burst integer? +---@field burstRate number? +---@field projectiles integer? +---@field salvoLeft integer? +---@field nextSalvo integer? +---@field aimReady number? +---Set to `true` if a non-zero value is passed, `false` is zero is passed. +---@field forceAim integer? +---@field avoidFlags integer? +---@field collisionFlags integer? +local WeaponState = {} + +---@param unitID integer +---@param forceUseWeapons number? +---@param allowUseWeapons number? +---@return nil +function Spring.SetUnitUseWeapons(unitID, forceUseWeapons, allowUseWeapons) end + +---@param unitID integer +---@param weaponNum number +---@param states WeaponState +---@return nil +function Spring.SetUnitWeaponState(unitID, weaponNum, states) end + +---@param unitID integer +---@param weaponNum number +---@param key string +---@param value number +---@return nil +function Spring.SetUnitWeaponState(unitID, weaponNum, key, value) end + +---Parameters for damage +--- +---@class WeaponDamages +---@field paralyzeDamageTime integer +---@field impulseFactor number +---@field impulseBoost number +---@field craterMult number +---@field craterBoost number +---@field dynDamageExp number +---@field dynDamageMin number +---@field dynDamageRange number +---@field dynDamageInverted number +---Set to `true` if a non-zero value is passed, `false` is zero is passed. +---@field craterAreaOfEffect number +---@field damageAreaOfEffect number +---@field edgeEffectiveness number +---@field explosionSpeed number +local WeaponDamages = {} + +---@param unitID integer +---@param weaponNum number|"selfDestruct"|"explode" +---@param damages WeaponDamages +---@return nil +function Spring.SetUnitWeaponDamages(unitID, weaponNum, damages) end + +---@param unitID integer +---@param weaponNum number|"selfDestruct"|"explode" +---@param key string +---@param value number +---@return nil +function Spring.SetUnitWeaponDamages(unitID, weaponNum, key, value) end + +---@param unitID integer +---@param maxRange number +---@return nil +function Spring.SetUnitMaxRange(unitID, maxRange) end + +---@see Spring.AddUnitExperience +---@see Spring.GetUnitExperience +---@param unitID integer +---@param experience number +---@return nil +function Spring.SetUnitExperience(unitID, experience) end + +---@see Spring.SetUnitExperience +---@see Spring.GetUnitExperience +---@param unitID integer +---@param deltaExperience number Can be negative to subtract, but the unit will never have negative total afterwards +---@return nil +function Spring.AddUnitExperience(unitID, deltaExperience) end + +---@param unitID integer +---@param armored boolean? +---@param armorMultiple number? +---@return nil +function Spring.SetUnitArmored(unitID, armored, armorMultiple) end + +---Unit LOS +--- +---@section unitlos + +--- +---The 3rd argument is either the bit-and combination of the following numbers: +--- +---LOS_INLOS = 1 +---LOS_INRADAR = 2 +---LOS_PREVLOS = 4 +---LOS_CONTRADAR = 8 +--- +---or a table of the following form: +--- +---losTypes = { +---[los = boolean,] +---[radar = boolean,] +---[prevLos = boolean,] +---[contRadar = boolean] +---} +--- +---@param unitID integer +---@param allyTeam number +---@param losTypes number|table +---@return nil +function Spring.SetUnitLosMask(unitID, allyTeam, losTypes) end + +---@param unitID integer +---@param allyTeam number +---@param los number|table +---@return nil +function Spring.SetUnitLosState(unitID, allyTeam, los) end + +--- +---If the 2nd argument is a number, the value works like this: +---1:=normal cloak +---2:=for free cloak (cost no E) +---3:=for free + no decloaking (except the unit is stunned) +---4:=ultimative cloak (no ecost, no decloaking, no stunned decloak) +--- +---The decloak distance is only changed: +---- if the 3th argument is a number or a boolean. +---- if the boolean is false it takes the default decloak distance for that unitdef, +---- if the boolean is true it takes the absolute value of it. +--- +---@param unitID integer +---@param cloak boolean|number +---@param cloakArg boolean|number +---@return nil +function Spring.SetUnitCloak(unitID, cloak, cloakArg) end + +---@param unitID integer +---@param stealth boolean +---@return nil +function Spring.SetUnitStealth(unitID, stealth) end + +---@param unitID integer +---@param sonarStealth boolean +---@return nil +function Spring.SetUnitSonarStealth(unitID, sonarStealth) end + +---@param unitID integer +---@param seismicSignature number +---@return nil +function Spring.SetUnitSeismicSignature(unitID, seismicSignature) end + +---@param unitID integer +---@param alwaysVisible boolean +---@return nil +function Spring.SetUnitAlwaysVisible(unitID, alwaysVisible) end + +---@param unitID integer +---@param useAirLos boolean +---@return nil +function Spring.SetUnitUseAirLos(unitID, useAirLos) end + +---@param unitID integer +---@param depth number corresponds to metal extraction rate +---@param range number? similar to "extractsMetal" in unitDefs. +---@return nil +function Spring.SetUnitMetalExtraction(unitID, depth, range) end + +---See also harvestStorage UnitDef tag. +--- +---@param unitID integer +---@param metal number +---@return nil +function Spring.SetUnitHarvestStorage(unitID, metal) end + +---@param unitID integer +---@param paramName string one of `buildRange`|`buildDistance`|`buildRange3D` +---@number +---@return nil +function Spring.SetUnitBuildParams(unitID, paramName) end + +---@param builderID integer +---@param buildSpeed number +---@param repairSpeed number? +---@param reclaimSpeed number? +---@param captureSpeed number? +---@param terraformSpeed number? +---@return nil +function Spring.SetUnitBuildSpeed(builderID, buildSpeed, repairSpeed, reclaimSpeed, captureSpeed, terraformSpeed) end + +--- +---This saves a lot of engine calls, by replacing: function script.QueryNanoPiece() return currentpiece end +---Use it! +--- +---@param builderID integer +---@param pieces table +---@return nil +function Spring.SetUnitNanoPieces(builderID, pieces) end + +---@param unitID integer +---@param isblocking boolean +---@param isSolidObjectCollidable boolean +---@param isProjectileCollidable boolean +---@param isRaySegmentCollidable boolean +---@param crushable boolean +---@param blockEnemyPushing boolean +---@param blockHeightChanges boolean +---@return nil +function Spring.SetUnitBlocking(unitID, isblocking, isSolidObjectCollidable, isProjectileCollidable, isRaySegmentCollidable, crushable, blockEnemyPushing, blockHeightChanges) end + +---@param unitID integer +---@param crashing boolean +---@return boolean success +function Spring.SetUnitCrashing(unitID, crashing) end + +---@param unitID integer +---@param weaponID integer? (Default: -1) +---@param enabled boolean? +---@param power number? +---@return nil +function Spring.SetUnitShieldState(unitID, weaponID, enabled, power) end + +---@param unitID integer +---@param weaponID integer? (optional if the unit only has one shield) +---@param rechargeTime number? (in seconds; emulates a regular hit if nil) +---@return nil +function Spring.SetUnitShieldRechargeDelay(unitID, weaponID, rechargeTime) end + +---@param unitID integer +---@param type string "dir"|"minDamage"|"maxDamage"|"moveFactor"|"mode" +---@param arg1 number x|minDamage|maxDamage|moveFactor|mode +---@param y number? only when type is "dir" +---@param z number? only when type is "dir" +---@return nil +function Spring.SetUnitFlanking(unitID, type, arg1, y, z) end + +---@param unitID integer +---@param Physical number[bit] state bit +---@return nil +function Spring.SetUnitPhysicalStateBit(unitID, Physical) end + +---@param unitID integer +---@return number Unit's PhysicalState bitmask +function Spring.GetUnitPhysicalState(unitID) end + +---@param unitID integer +---@param neutral boolean +---@return nil|boolean setNeutral +function Spring.SetUnitNeutral(unitID, neutral) end + +---Defines a unit's target. +--- +---@param unitID integer +---@param enemyUnitID integer? when nil drops the units current target. +---@param dgun boolean? (Default: false) +---@param userTarget boolean? (Default: false) +---@param weaponNum number? (Default: -1) +---@return boolean success +function Spring.SetUnitTarget(unitID, enemyUnitID, dgun, userTarget, weaponNum) end + +---@param unitID integer +---@param x number? when nil or not passed it will drop target and ignore other parameters +---@param y number? +---@param z number? +---@param dgun boolean? (Default: false) +---@param userTarget boolean? (Default: false) +---@param weaponNum number? (Default: -1) +---@return boolean success +function Spring.SetUnitTarget(unitID, x, y, z, dgun, userTarget, weaponNum) end + +---@param unitID integer +---@param mpX number new middle positionX of unit +---@param mpY number new middle positionY of unit +---@param mpZ number new middle positionZ of unit +---@param apX number new positionX that enemies aim at on this unit +---@param apY number new positionY that enemies aim at on this unit +---@param apZ number new positionZ that enemies aim at on this unit +---@param relative boolean? (Default: false) are the new coordinates relative to world (false) or unit (true) coordinates? Also, note that apy is inverted! +---@return boolean success +function Spring.SetUnitMidAndAimPos(unitID, mpX, mpY, mpZ, apX, apY, apZ, relative) end + +---@param unitID integer +---@param radius number +---@param height number +---@return boolean success +function Spring.SetUnitRadiusAndHeight(unitID, radius, height) end + +--- +---Sets the unit's radius for when targeted by build, repair, reclaim-type commands. +--- +---@param unitID integer +---@param build number radius for when targeted by build, repair, reclaim-type commands. +---@return nil +function Spring.SetUnitBuildeeRadius(unitID, build) end + +---Changes the pieces hierarchy of a unit by attaching a piece to a new parent. +--- +---@param unitID integer +---@param AlteredPiece number +---@param ParentPiece number +---@return nil +function Spring.SetUnitPieceParent(unitID, AlteredPiece, ParentPiece) end + +---Sets the local (i.e. parent-relative) matrix of the given piece. +--- +---If any of the first three elements are non-zero, and also blocks all script animations from modifying it until {0, 0, 0} is passed. +--- +---@param unitID integer +---@param pieceNum number +---@param matrix number[] an array of 16 floats +---@return nil +function Spring.SetUnitPieceMatrix(unitID, pieceNum, matrix) end + +---@param unitID integer +---@param scaleX number +---@param scaleY number +---@param scaleZ number +---@param offsetX number +---@param offsetY number +---@param offsetZ number +---@param vType number +---@param tType number +---@param Axis number +---@return nil +--- +---enum COLVOL_TYPES { +---COLVOL_TYPE_DISABLED = -1, +---COLVOL_TYPE_ELLIPSOID = 0, +---COLVOL_TYPE_CYLINDER, +---COLVOL_TYPE_BOX, +---COLVOL_TYPE_SPHERE, +---COLVOL_NUM_TYPES // number of non-disabled collision volume types +---}; +---enum COLVOL_TESTS { +---COLVOL_TEST_DISC = 0, +---COLVOL_TEST_CONT = 1, +---COLVOL_NUM_TESTS = 2 // number of tests +---}; +---enum COLVOL_AXES { +---COLVOL_AXIS_X = 0, +---COLVOL_AXIS_Y = 1, +---COLVOL_AXIS_Z = 2, +---COLVOL_NUM_AXES = 3 // number of collision volume axes +---}; +function Spring.SetUnitCollisionVolumeData(unitID, scaleX, scaleY, scaleZ, offsetX, offsetY, offsetZ, vType, tType, Axis) end + +---@param unitID integer +---@param pieceIndex number +---@param enable boolean +---@param scaleX number +---@param scaleY number +---@param scaleZ number +---@param offsetX number +---@param offsetY number +---@param offsetZ number +---@param volumeType number? +---@param primaryAxis number? +---@return nil +function Spring.SetUnitPieceCollisionVolumeData(unitID, pieceIndex, enable, scaleX, scaleY, scaleZ, offsetX, offsetY, offsetZ, volumeType, primaryAxis) end + +---@param unitID integer +---@param pieceIndex number +---@param visible boolean +---@return nil +function Spring.SetUnitPieceVisible(unitID, pieceIndex, visible) end + +---@param unitID integer +---@param type "los"|"airLos"|"radar"|"sonar"|"seismic"|"radarJammer"|"sonarJammer" +---@param radius number +---@return number? New radius, or `nil` if unit is invalid. +function Spring.SetUnitSensorRadius(unitID, type, radius) end + +---@param unitID integer +---@param posErrorVectorX number +---@param posErrorVectorY number +---@param posErrorVectorZ number +---@param posErrorDeltaX number +---@param posErrorDeltaY number +---@param posErrorDeltaZ number +---@param nextPosErrorUpdate number? +---@return nil +function Spring.SetUnitPosErrorParams(unitID, posErrorVectorX, posErrorVectorY, posErrorVectorZ, posErrorDeltaX, posErrorDeltaY, posErrorDeltaZ, nextPosErrorUpdate) end + +---Used by default commands to get in build-, attackrange etc. +--- +---@param unitID integer +---@param goalX number +---@param goalY number +---@param goalZ number +---@param goalRadius number? +---@param moveSpeed number? +---@param moveRaw boolean? +---@return nil +function Spring.SetUnitMoveGoal(unitID, goalX, goalY, goalZ, goalRadius, moveSpeed, moveRaw) end + +---Used in conjunction with Spring.UnitAttach et al. to re-implement old airbase & fuel system in Lua. +--- +---@param unitID integer +---@param goalX number +---@param goalY number +---@param goalZ number +---@param goalRadius number? +---@return nil +function Spring.SetUnitLandGoal(unitID, goalX, goalY, goalZ, goalRadius) end + +---@param unitID integer +---@return nil +function Spring.ClearUnitGoal(unitID) end + +---@param unitID integer +---@param posX number +---@param posY number +---@param posZ number +---@param velX number +---@param velY number +---@param velZ number +---@param rotX number +---@param rotY number +---@param rotZ number +---@param dragX number +---@param dragY number +---@param dragZ number +---@return nil +function Spring.SetUnitPhysics(unitID, posX, posY, posZ, velX, velY, velZ, rotX, rotY, rotZ, dragX, dragY, dragZ) end + +---@param unitID integer +---@param mass number +---@return nil +function Spring.SetUnitMass(unitID, mass) end + +---Set unit position (2D) +--- +---Sets a unit's position in 2D, at terrain height. +--- +---@param unitID integer +---@param x number +---@param z number +---@param floating boolean? (Default: false) If true, over water the position is on surface. If false, on seafloor. +---@return nil +function Spring.SetUnitPosition(unitID, x, z, floating) end + +---Set unit position (3D) +--- +---Sets a unit's position in 3D, at an arbitrary height. +--- +---@param unitID integer +---@param x number +---@param y number +---@param z number +---@return nil +function Spring.SetUnitPosition(unitID, x, y, z) end + +---@param unitID integer +---@param yaw number +---@param pitch number +---@param roll number +---@return nil +function Spring.SetUnitRotation(unitID, yaw, pitch, roll) end + +---@param unitID integer +---@param x number +---@param y number +---@param z number +---@return nil +function Spring.SetUnitDirection(unitID, x, y, z) end + +--- +---Use this call to set up unit direction in a robust way. Heading (-32768 to 32767) represents a 2D (xz plane) unit orientation if unit was completely upright, new {upx,upy,upz} direction will be used as new "up" vector, the rotation set by "heading" will remain preserved. +--- +---@param unitID integer +---@param heading number +---@param upx number +---@param upy number +---@param upz number +---@return nil +function Spring.SetUnitHeadingAndUpDir(unitID, heading, upx, upy, upz) end + +---@param unitID integer +---@param velX number +---@param velY number +---@param velZ number +---@return nil +function Spring.SetUnitVelocity(unitID, velX, velY, velZ) end + +---@param unitID integer +---@param buggerOff boolean? +---@param offset number? +---@param radius number? +---@param relHeading number? +---@param spherical boolean? +---@param forced boolean? +---@return nil|number buggerOff +function Spring.SetFactoryBuggerOff(unitID, buggerOff, offset, radius, relHeading, spherical, forced) end + +---@param x number +---@param y number +---@param z number? uses ground height when unspecified +---@param radius number +---@param teamID integer +---@param spherical boolean? (Default: true) +---@param forced boolean? (Default: true) +---@param excludeUnitID integer? +---@tparam +---@return nil +function Spring.BuggerOff(x, y, z, radius, teamID, spherical, forced, excludeUnitID) end + +---@param unitID integer +---@param damage number +---@param paralyze number? (Default: 0) equals to the paralyzetime in the WeaponDef. +---@param attackerID integer? (Default: -1) +---@param weaponID integer? (Default: -1) +---@param impulseX number? +---@param impulseY number? +---@param impulseZ number? +---@return nil +function Spring.AddUnitDamage(unitID, damage, paralyze, attackerID, weaponID, impulseX, impulseY, impulseZ) end + +---@param unitID integer +---@param x number +---@param y number +---@param z number +---@param decayRate number? +---@return nil +function Spring.AddUnitImpulse(unitID, x, y, z, decayRate) end + +---@param unitID integer +---@param pindSize number +---@return nil +function Spring.AddUnitSeismicPing(unitID, pindSize) end + +---@param unitID integer +---@param resource string "m" | "e" +---@param amount number +---@return nil +function Spring.AddUnitResource(unitID, resource, amount) end + +---@param unitID integer +---@param resource ResourceName +---@param amount number +---@return boolean? okay +function Spring.UseUnitResource(unitID, resource, amount) end + +---@param unitID integer +---@param resources ResourceUsage +---@return boolean? okay +function Spring.UseUnitResource(unitID, resources) end + +---Decals +--- +---@section decals + +---@param unitID integer +---@return nil +function Spring.AddObjectDecal(unitID) end + +---@param unitID integer +---@return nil +function Spring.RemoveObjectDecal(unitID) end + +---Grass +--- +---@section grass + +---@param x number +---@param z number +---@return nil +function Spring.AddGrass(x, z) end + +---@param x number +---@param z number +---@return nil +function Spring.RemoveGrass(x, z) end + +---Feature Handling +--- +---@section featurehandling + +---@param featureDef string|number name or id +---@param x number +---@param y number +---@param z number +---@param heading number? +---@param AllyTeamID integer? +---@param featureID integer? +---@return number featureID +function Spring.CreateFeature(featureDef, x, y, z, heading, AllyTeamID, featureID) end + +---@param featureDefID integer +---@return nil +function Spring.DestroyFeature(featureDefID) end + +---Feature Control +--- +---@param featureDefID integer +---@param teamID integer +---@return nil +function Spring.TransferFeature(featureDefID, teamID) end + +---@param featureID integer +---@param enable boolean +---@return nil +function Spring.SetFeatureAlwaysVisible(featureID, enable) end + +---@param featureID integer +---@param useAirLos boolean +---@return nil +function Spring.SetFeatureUseAirLos(featureID, useAirLos) end + +---@param featureID integer +---@param health number +---@return nil +function Spring.SetFeatureHealth(featureID, health) end + +---@param featureID integer +---@param maxHealth number minimum 0.1 +---@return nil +function Spring.SetFeatureMaxHealth(featureID, maxHealth) end + +---@param featureID integer +---@param reclaimLeft number +---@return nil +function Spring.SetFeatureReclaim(featureID, reclaimLeft) end + +---@param featureID integer +---@param metal number +---@param energy number +---@param reclaimTime number? +---@param reclaimLeft number? +---@param featureDefMetal number? +---@param featureDefEnergy number? +---@return nil +function Spring.SetFeatureResources(featureID, metal, energy, reclaimTime, reclaimLeft, featureDefMetal, featureDefEnergy) end + +--- +---Second param can now be a number id instead of a string name, this also allows cancelling ressurection by passing -1. +---The level of progress can now be set via the additional 4th param. +---Possible values for facing are: +---"south" | "s" | 0 +---"east" | "e" | 1 +---"north" | "n" | 2 +---"west" | "w" | 3 +--- +---@param featureID integer +---@param unitDef string|number id or name +---@tparam +---@param progress number? +---@return nil +function Spring.SetFeatureResurrect(featureID, unitDef, progress) end + +--- +---Use this callout to control feature movement. The arg* arguments are parsed as follows and all optional: +--- +---If enable is true: +---[, velVector(x,y,z) * initial velocity for feature +---[, accVector(x,y,z) * acceleration added every frame]] +--- +---If enable is false: +---[, velocityMask(x,y,z) * dimensions in which velocity is allowed to build when not using MoveCtrl +---[, impulseMask(x,y,z) * dimensions in which impulse is allowed to apply when not using MoveCtrl +---[, movementMask(x,y,z) * dimensions in which feature is allowed to move when not using MoveCtrl]]] +--- +---It is necessary to unlock feature movement on x,z axis before changing feature physics. +--- +---For example use `Spring.SetFeatureMoveCtrl(featureID,false,1,1,1,1,1,1,1,1,1)` to unlock all movement prior to making `Spring.SetFeatureVelocity` calls. +--- +---@param featureID integer +---@param enable boolean? +---@param arg1 number? +---@param arg2 number? +---@param argn number? +---@return nil +function Spring.SetFeatureMoveCtrl(featureID, enable, arg1, arg2, argn) end + +---@param featureID integer +---@param posX number +---@param posY number +---@param posZ number +---@param velX number +---@param velY number +---@param velZ number +---@param rotX number +---@param rotY number +---@param rotZ number +---@param dragX number +---@param dragY number +---@param dragZ number +---@return nil +function Spring.SetFeaturePhysics(featureID, posX, posY, posZ, velX, velY, velZ, rotX, rotY, rotZ, dragX, dragY, dragZ) end + +---@param featureID integer +---@param mass number +---@return nil +function Spring.SetFeatureMass(featureID, mass) end + +---@param featureID integer +---@param x number +---@param y number +---@param z number +---@param snapToGround boolean? +---@return nil +function Spring.SetFeaturePosition(featureID, x, y, z, snapToGround) end + +---@param featureID integer +---@param rotX number +---@param rotY number +---@param rotZ number +---@return nil +function Spring.SetFeatureRotation(featureID, rotX, rotY, rotZ) end + +---@param featureID integer +---@param dirX number +---@param dirY number +---@param dirZ number +---@return nil +function Spring.SetFeatureDirection(featureID, dirX, dirY, dirZ) end + +--- +---Use this call to set up feature direction in a robust way. Heading (-32768 to 32767) represents a 2D (xz plane) feature orientation if feature was completely upright, new {upx,upy,upz} direction will be used as new "up" vector, the rotation set by "heading" will remain preserved. +--- +---@param featureID integer +---@param heading number +---@param upx number +---@param upy number +---@param upz number +---@return nil +function Spring.SetFeatureHeadingAndUpDir(featureID, heading, upx, upy, upz) end + +---@param featureID integer +---@param velX number +---@param velY number +---@param velZ number +---@return nil +function Spring.SetFeatureVelocity(featureID, velX, velY, velZ) end + +---@param featureID integer +---@param isBlocking boolean +---@param isSolidObjectCollidable boolean +---@param isProjectileCollidable boolean +---@param isRaySegmentCollidable boolean +---@param crushable boolean +---@param blockEnemyPushing boolean +---@param blockHeightChanges boolean +---@return nil +function Spring.SetFeatureBlocking(featureID, isBlocking, isSolidObjectCollidable, isProjectileCollidable, isRaySegmentCollidable, crushable, blockEnemyPushing, blockHeightChanges) end + +---@param featureID integer +---@param noSelect boolean +---@return nil +function Spring.SetFeatureNoSelect(featureID, noSelect) end + +--- +---Check `Spring.SetUnitMidAndAimPos` for further explanation of the arguments. +--- +---@param featureID integer +---@param mpX number +---@param mpY number +---@param mpZ number +---@param apX number +---@param apY number +---@param apZ number +---@param relative boolean? +---@return boolean success +function Spring.SetFeatureMidAndAimPos(featureID, mpX, mpY, mpZ, apX, apY, apZ, relative) end + +---@param featureID integer +---@param radius number +---@param height number +---@return boolean success +function Spring.SetFeatureRadiusAndHeight(featureID, radius, height) end + +--- +---Check `Spring.SetUnitCollisionVolumeData` for further explanation of the arguments. +--- +---@param featureID integer +---@param scaleX number +---@param scaleY number +---@param scaleZ number +---@param offsetX number +---@param offsetY number +---@param offsetZ number +---@param vType number +---@param tType number +---@param Axis number +---@return nil +function Spring.SetFeatureCollisionVolumeData(featureID, scaleX, scaleY, scaleZ, offsetX, offsetY, offsetZ, vType, tType, Axis) end + +---@param featureID integer +---@param pieceIndex number +---@param enable boolean +---@param scaleX number +---@param scaleY number +---@param scaleZ number +---@param offsetX number +---@param offsetY number +---@param offsetZ number +---@param Axis number +---@param volumeType number +---@param primaryAxis number? +---@return nil +function Spring.SetFeaturePieceCollisionVolumeData(featureID, pieceIndex, enable, scaleX, scaleY, scaleZ, offsetX, offsetY, offsetZ, Axis, volumeType, primaryAxis) end + +---@param featureID integer +---@param pieceIndex number +---@param visible boolean +---@return nil +function Spring.SetFeaturePieceVisible(featureID, pieceIndex, visible) end + +---Projectiles +--- +---@section projectiles + +---@class ProjectileParams +---@field pos float3 +---@field speed float3 +---@field spread float3 +---@field error float3 +---@field owner integer +---@field team integer +---@field ttl number +---@field gravity number +---@field tracking number +---@field maxRange number +---@field startAlpha number +---@field endAlpha number +---@field model string +---@field cegTag string +local ProjectileParams = {} + +---@param projectileID integer +---@param alwaysVisible boolean +---@return nil +function Spring.SetProjectileAlwaysVisible(projectileID, alwaysVisible) end + +---@param projectileID integer +---@param useAirLos boolean +---@return nil +function Spring.SetProjectileUseAirLos(projectileID, useAirLos) end + +---Disables engine movecontrol, so lua can fully control the physics. +--- +---@param projectileID integer +---@param enable boolean +---@return nil +function Spring.SetProjectileMoveControl(projectileID, enable) end + +---@param projectileID integer +---@param posX number? (Default: 0) +---@param posY number? (Default: 0) +---@param posZ number? (Default: 0) +---@return nil +function Spring.SetProjectilePosition(projectileID, posX, posY, posZ) end + +---@param projectileID integer +---@param velX number? (Default: 0) +---@param velY number? (Default: 0) +---@param velZ number? (Default: 0) +---@return nil +function Spring.SetProjectileVelocity(projectileID, velX, velY, velZ) end + +---@param projectileID integer +---@return nil +function Spring.SetProjectileCollision(projectileID) end + +--- +---targetTypeStr can be one of: +---'u' - unit +---'f' - feature +---'p' - projectile +---while targetTypeInt is one of: +---string.byte('g') := GROUND +---string.byte('u') := UNIT +---string.byte('f') := FEATURE +---string.byte('p') := PROJECTILE +--- +---@param projectileID integer +---@param arg1 number? (Default: 0) targetID or posX +---@param arg2 number? (Default: 0) targetType or posY +---@param posZ number? (Default: 0) +---@return boolean? validTarget +function Spring.SetProjectileTarget(projectileID, arg1, arg2, posZ) end + +---@param projectileID integer +---@return nil +function Spring.SetProjectileIsIntercepted(projectileID) end + +---@param unitID integer +---@param weaponNum number +---@param key string +---@param value number +---@return nil +function Spring.SetProjectileDamages(unitID, weaponNum, key, value) end + +---@param projectileID integer +---@param ignore boolean +---@return nil +function Spring.SetProjectileIgnoreTrackingError(projectileID, ignore) end + +---@param projectileID integer +---@param grav number? (Default: 0) +---@return nil +function Spring.SetProjectileGravity(projectileID, grav) end + +---@param projectileID integer +---@param explosionFlags number? +---@param spinAngle number? +---@param spinSpeed number? +---@param spinVectorX number? +---@param spinVectorY number? +---@param spinVectorZ number? +---@return nil +function Spring.SetPieceProjectileParams(projectileID, explosionFlags, spinAngle, spinSpeed, spinVectorX, spinVectorY, spinVectorZ) end + +---@param projectileID integer +---@param ceg_name string +---@return nil +function Spring.SetProjectileCEG(projectileID, ceg_name) end + +---Give Order +--- +---@section giveorder +---Options can also be a bitmask; e.g. 0 instead of an empty table (can avoid performance hit on table creation) +---See `Constants.CMD` for relevant constants. + +---@param unitID integer +function Spring.UnitFinishCommand(unitID) end + +---@param unitID integer +---@param cmdID integer +---@param params number[] +---@param options CommandOptions +---@return boolean unitOrdered +function Spring.GiveOrderToUnit(unitID, cmdID, params, options) end + +---@param unitMap table table with unitIDs as keys +---@param cmdID integer +---@param params number[] +---@param options CommandOptions +---@return number unitsOrdered +function Spring.GiveOrderToUnitMap(unitMap, cmdID, params, options) end + +---@param unitIDs number[] +---@param cmdID integer +---@param params number[] +---@param options CommandOptions +---@return number unitsOrdered +function Spring.GiveOrderToUnitArray(unitIDs, cmdID, params, options) end + +---@param unitID integer +---@param cmdArray Command[] +---@return boolean ordersGiven +function Spring.GiveOrderArrayToUnit(unitID, cmdArray) end + +---@param unitMap {[number]: any} table with unitIDs as keys +---@param commands Command[] +---@return number unitsOrdered +function Spring.GiveOrderArrayToUnitMap(unitMap, commands) end + +---@param unitArray number[] containing unitIDs +---@param commands Command[] +---@return nil +function Spring.GiveOrderArrayToUnitArray(unitArray, commands) end + +---Heightmap +--- +---@section heightmap +---Note that x & z coords are in worldspace (Game.mapSizeX/Z), still the heightmap resolution is Game.squareSize. + +---Set a certain height to a point or rectangle area on the world +--- +---@param x1 number +---@param z1 number +---@param x2_height number if y2 and height are nil then this parameter is the height +---@param z2 number? +---@param height number? +---@return nil +function Spring.LevelHeightMap(x1, z1, x2_height, z2, height) end + +---Add a certain height to a point or rectangle area on the world +--- +---@param x1 number +---@param y1 number +---@param x2_height number if y2 and height are nil then this parameter is the height +---@param y2 number? +---@param height number? +---@return nil +function Spring.AdjustHeightMap(x1, y1, x2_height, y2, height) end + +---Restore original map height to a point or rectangle area on the world +--- +---@param x1 number +---@param y1 number +---@param x2_factor number if y2 and factor are nil then this parameter is the factor +---@param y2 number? +---@param factor number? +---@return nil +function Spring.RevertHeightMap(x1, y1, x2_factor, y2, factor) end + +---Can only be called in `Spring.SetHeightMapFunc` +--- +---@param x number +---@param z number +---@param height number +---@return integer? newHeight +function Spring.AddHeightMap(x, z, height) end + +--- +---Can only be called in `Spring.SetHeightMapFunc`. The terraform argument is +--- +---@param x number +---@param z number +---@param height number +---@param terraform number? (Default: 1) a scaling factor. +---@return integer? absHeightDiff =0 nothing will be changed (the terraform starts) and if =1 the terraform will be finished. +function Spring.SetHeightMap(x, z, height, terraform) end + +--- +---Example code: +--- +---```lua +---function Spring.SetHeightMapFunc(function() +---for z=0,Game.mapSizeZ, Game.squareSize do +---for x=0,Game.mapSizeX, Game.squareSize do +---Spring.SetHeightMap( x, z, 200 + 20 * math.cos((x + z) / 90) ) +---end +---end +---end) +---``` +--- +---@param luaFunction function +---@param arg number +---@param ... number +---@return integer? absTotalHeightMapAmountChanged +function Spring.SetHeightMapFunc(luaFunction, arg, ...) end + +---Height Map/Smooth Mesh +--- +---@section heightmap + +---Set a height to a point or rectangle area to the original map height cache +--- +---@param x1 number +---@param y1 number +---@param x2_height number if y2 and height are nil then this parameter is the height +---@param y2 number? +---@param height number? +---@return nil +function Spring.LevelOriginalHeightMap(x1, y1, x2_height, y2, height) end + +---Add height to a point or rectangle area to the original map height cache +--- +---@param x1 number +---@param y1 number +---@param x2_height number if y2 and height are nil then this parameter is the height +---@param y2 number? +---@param height number? +---@return nil +function Spring.AdjustOriginalHeightMap(x1, y1, x2_height, y2, height) end + +---Restore original map height cache to a point or rectangle area on the world +--- +---@param x1 number +---@param y1 number +---@param x2_factor number if y2 and factor are nil then this parameter is the factor +---@param y2 number? +---@param factor number? +---@return nil +function Spring.RevertOriginalHeightMap(x1, y1, x2_factor, y2, factor) end + +--- +---Can only be called in `Spring.SetOriginalHeightMapFunc` +--- +---@param x number +---@param y number +---@param height number +---@return nil +function Spring.AddOriginalHeightMap(x, y, height) end + +--- +---Can only be called in `Spring.SetOriginalHeightMapFunc` +--- +---@param x number +---@param y number +---@param height number +---@param factor number? +---@return nil +function Spring.SetOriginalHeightMap(x, y, height, factor) end + +--- +---Cannot recurse on itself +--- +---@param heightMapFunc function +---@return nil +function Spring.SetOriginalHeightMapFunc(heightMapFunc) end + +--- +---Heightmap changes normally take up to 25s to propagate to the smooth mesh. +---Use to force a mapwide update immediately. +--- +---@return nil +function Spring.RebuildSmoothMesh() end + +---@param x1 number +---@param z1 number +---@param x2 number? +---@param z2 number? +---@param height number +---@return nil +function Spring.LevelSmoothMesh(x1, z1, x2, z2, height) end + +---@param x1 number +---@param z1 number +---@param x2 number? +---@param z2 number? +---@param height number +---@return nil +function Spring.AdjustSmoothMesh(x1, z1, x2, z2, height) end + +---@param x1 number +---@param z1 number +---@param x2 number? +---@param z2 number? +---@param origFactor number +---@return nil +function Spring.RevertSmoothMesh(x1, z1, x2, z2, origFactor) end + +---Can only be called in `Spring.SetSmoothMeshFunc`. +--- +---@param x number +---@param z number +---@param height number +---@return number? The new height, or `nil` if coordinates are invalid. +function Spring.AddSmoothMesh(x, z, height) end + +---Can only be called in `Spring.SetSmoothMeshFunc`. +--- +---@param x number +---@param z number +---@param height number +---@param terraform number? (Default: 1) +---@return number? The absolute height difference, or `nil` if coordinates are invalid. +function Spring.SetSmoothMesh(x, z, height, terraform) end + +---@param luaFunction function +---@param arg any? +---@param ... any? +---@return number? absTotalHeightMapAmountChanged +function Spring.SetSmoothMeshFunc(luaFunction, arg, ...) end + +---TerrainTypes +--- +---@section terraintypes + +---@param x number +---@param z number +---@param newType number +---@return integer? oldType +function Spring.SetMapSquareTerrainType(x, z, newType) end + +---@param typeIndex number +---@param speedTanks number? (Default: nil) +---@param speedKBOts number? (Default: nil) +---@param speedHovers number? (Default: nil) +---@param speedShips number? (Default: nil) +---@return boolean? true +function Spring.SetTerrainTypeData(typeIndex, speedTanks, speedKBOts, speedHovers, speedShips) end + +---@param x number +---@param z number +---@param mask number +---@return nil +--- +---See also buildingMask unitdef tag. +function Spring.SetSquareBuildingMask(x, z, mask) end + +---@param unitID integer +---@param weaponID integer +---@return nil +function Spring.UnitWeaponFire(unitID, weaponID) end + +---@param unitID integer +---@param weaponID integer +---@return nil +function Spring.UnitWeaponHoldFire(unitID, weaponID) end + +---Prevent collision checks from working on outdated data +--- +---There's a rare edge case that requires units to be in specific positions +---and being shot by specific weapons but which can result in shots ghosting +---through the unit. This is because the unit's collision volume is stale. +---The `movement.unitQuadPositionUpdateRate` modrule controls this behaviour +---and can guarantee 100% correctness if set to 1, but the default value is 3 +---and large-scale games generally don't want to set it so low. This function +---lets you guarantee success for important weapons regardless of how high +---the normal update rate is set. +--- +---@param unitID integer +---@return nil +function Spring.ForceUnitCollisionUpdate(unitID) end + +---@param transporterID integer +---@param passengerID integer +---@param pieceNum number +---@return nil +function Spring.UnitAttach(transporterID, passengerID, pieceNum) end + +---@param passengerID integer +---@return nil +function Spring.UnitDetach(passengerID) end + +---@param passengerID integer +---@return nil +function Spring.UnitDetachFromAir(passengerID) end + +---Disables collisions between the two units to allow colvol intersection during the approach. +--- +---@param passengerID integer +---@param transportID integer +---@return nil +function Spring.SetUnitLoadingTransport(passengerID, transportID) end + +---@param weaponDefID integer +---@param projectileParams ProjectileParams +---@return integer? projectileID +function Spring.SpawnProjectile(weaponDefID, projectileParams) end + +---Silently removes projectiles (no explosion). +--- +---@param projectileID integer +---@return nil +function Spring.DeleteProjectile(projectileID) end + +---Parameters for explosion. +--- +---Please note the explosion defaults to 1 damage regardless of what it's defined in the weaponDef. +---The weapondefID is only used for visuals and for passing into callins like UnitDamaged. +--- +---@class ExplosionParams +---@field weaponDef number +---@field owner number +---@field hitUnit number +---@field hitFeature number +---@field craterAreaOfEffect number +---@field damageAreaOfEffect number +---@field edgeEffectiveness number +---@field explosionSpeed number +---@field gfxMod number +---@field impactOnly boolean +---@field ignoreOwner boolean +---@field damageGround boolean +local ExplosionParams = {} + +---@param posX number? (Default: 0) +---@param posY number? (Default: 0) +---@param posZ number? (Default: 0) +---@param dirX number? (Default: 0) +---@param dirY number? (Default: 0) +---@param dirZ number? (Default: 0) +---@param explosionParams ExplosionParams +---@return nil +function Spring.SpawnExplosion(posX, posY, posZ, dirX, dirY, dirZ, explosionParams) end + +---@param cegname string +---@param posX number? (Default: 0) +---@param posY number? (Default: 0) +---@param posZ number? (Default: 0) +---@param dirX number? (Default: 0) +---@param dirY number? (Default: 0) +---@param dirZ number? (Default: 0) +---@param radius number? (Default: 0) +---@param damage number? (Default: 0) +---@return boolean? success +---@return number cegID +function Spring.SpawnCEG(cegname, posX, posY, posZ, dirX, dirY, dirZ, radius, damage) end + +---Equal to the UnitScript versions of EmitSFX, but takes position and direction arguments (in either unit- or piece-space) instead of a piece index. +--- +---@param unitID integer? (Default: 0) +---@param sfxID integer? (Default: 0) +---@param posX number? (Default: 0) +---@param posY number? (Default: 0) +---@param posZ number? (Default: 0) +---@param dirX number? (Default: 0) +---@param dirY number? (Default: 0) +---@param dirZ number? (Default: 0) +---@param radius number? (Default: 0) +---@param damage number? (Default: 0) +---@param absolute boolean? +---@return boolean? success +function Spring.SpawnSFX(unitID, sfxID, posX, posY, posZ, dirX, dirY, dirZ, radius, damage, absolute) end + +---Other +--- +---@section other + +---@param noPause boolean +---@return nil +function Spring.SetNoPause(noPause) end + +---Defines how often `Callins.UnitExperience` will be called. +--- +---@param expGrade number +---@param ExpPowerScale number? +---@param ExpHealthScale number? +---@param ExpReloadScale number? +---@return nil +function Spring.SetExperienceGrade(expGrade, ExpPowerScale, ExpHealthScale, ExpReloadScale) end + +---@param allyTeamID integer +---@param allyteamErrorSize number +---@param baseErrorSize number? +---@param baseErrorMult number? +---@return nil +function Spring.SetRadarErrorParams(allyTeamID, allyteamErrorSize, baseErrorSize, baseErrorMult) end + +---Command Descriptions +--- +---@section commanddescriptions +---Doesn't work in unsynced code! + +---@param unitID integer +---@param cmdDescID integer +---@param cmdArray CommandDescription +function Spring.EditUnitCmdDesc(unitID, cmdDescID, cmdArray) end + +---@param unitID integer +---@param cmdDescID integer? +---@param cmdArray CommandDescription +function Spring.InsertUnitCmdDesc(unitID, cmdDescID, cmdArray) end + +---@param unitID integer +---@param cmdDescID integer? +function Spring.RemoveUnitCmdDesc(unitID, cmdDescID) end \ No newline at end of file diff --git a/library/LuaSyncedMoveCtrl.lua b/library/LuaSyncedMoveCtrl.lua new file mode 100644 index 00000000000..d386e7c5a79 --- /dev/null +++ b/library/LuaSyncedMoveCtrl.lua @@ -0,0 +1,13 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaSyncedMoveCtrl.cpp +--- +---@meta + +---MoveCtrl +--- +---@see rts/Lua/LuaSyncedMoveCtrl.cpp \ No newline at end of file diff --git a/library/LuaSyncedRead.lua b/library/LuaSyncedRead.lua new file mode 100644 index 00000000000..6d1543d1bca --- /dev/null +++ b/library/LuaSyncedRead.lua @@ -0,0 +1,1700 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaSyncedRead.cpp +--- +---@meta + +---Synced Read +--- +---@see rts/Lua/LuaSyncedRead.cpp + +---Game States +--- +---@section gamestates + +---@return boolean enabled +function Spring.IsCheatingEnabled() end + +---@return boolean enabled +function Spring.IsGodModeEnabled() end + +---@return boolean enabled +function Spring.IsDevLuaEnabled() end + +---@return boolean enabled +function Spring.IsEditDefsEnabled() end + +---@return boolean enabled +function Spring.IsNoCostEnabled() end + +---@param teamID integer? +---@return boolean enabled +function Spring.GetGlobalLos(teamID) end + +---@return boolean enabled +function Spring.AreHelperAIsEnabled() end + +---@return boolean|nil enabled +function Spring.FixedAllies() end + +---@return boolean isGameOver +function Spring.IsGameOver() end + +---Speed/Time +--- +---@section speedtime + +---@return number t1 frameNum % dayFrames +---@return number t2 frameNum / dayFrames +function Spring.GetGameFrame() end + +---@return number seconds +function Spring.GetGameSeconds() end + +---Environment +--- +---@section environment + +---@return number tidalStrength +function Spring.GetTidal() end + +---@return number windStrength +function Spring.GetWind() end + +---Rules/Params +--- +---@section environment +--- +---The following functions allow to save data per game, team and unit. +---The advantage of it is that it can be read from anywhere (even from LuaUI and AIs!) + +---@class RulesParams : table +local RulesParams = {} + +---@return RulesParams rulesParams map with rules names as key and values as values +function Spring.GetGameRulesParams() end + +---@param teamID integer +---@return RulesParams rulesParams map with rules names as key and values as values +function Spring.GetTeamRulesParams(teamID) end + +---@param playerID integer +---@return RulesParams rulesParams map with rules names as key and values as values +function Spring.GetPlayerRulesParams(playerID) end + +---@param unitID integer +---@return RulesParams rulesParams map with rules names as key and values as values +function Spring.GetUnitRulesParams(unitID) end + +---@param featureID integer +---@return RulesParams rulesParams map with rules names as key and values as values +function Spring.GetFeatureRulesParams(featureID) end + +---@param ruleRef number|string the rule index or name +---@return number?|string value +function Spring.GetGameRulesParam(ruleRef) end + +---@param teamID integer +---@param ruleRef number|string the rule index or name +---@return nil|number|string value +function Spring.GetTeamRulesParam(teamID, ruleRef) end + +---@param playerID integer +---@param ruleRef number|string the rule index or name +---@return nil|number|string value +function Spring.GetPlayerRulesParam(playerID, ruleRef) end + +---@param unitID integer +---@param ruleRef number|string the rule index or name +---@return nil|number|string value +function Spring.GetUnitRulesParam(unitID, ruleRef) end + +---@param featureID integer +---@param ruleRef number|string the rule index or name +---@return nil|number|string value +function Spring.GetFeatureRulesParam(featureID, ruleRef) end + +---Mod and Map options +--- +---@section modmapoptions +--- +---*Warning*: boolean values are not transfered from C to Lua correctly. +---For this reason the respective option has to be converted to a number +---and checked accordingly via an IF statement as shown below: +--- +---if (tonumber(Spring.GetModOptions.exampleOption) == 1) then...end +--- +---The following check therefore is insufficient! +--- +---if (Spring.GetModOptions.exampleOption) then...end + +---@param mapOption string +---@return string value of mapOption +function Spring.GetMapOption(mapOption) end + +---@return [string] = string[] options map with options names as keys and values as values +function Spring.GetMapOptions() end + +---@param modOption string +---@return string value of modOption in option map +function Spring.GetModOption(modOption) end + +---@return [string] = string[] options map with options names as keys and values as values +function Spring.GetModOptions() end + +---Vectors +--- +---@section vectors + +---@param x number +---@param z number +---@return number heading +function Spring.GetHeadingFromVector(x, z) end + +---@param heading number +---@return number x +---@return number z +function Spring.GetVectorFromHeading(heading) end + +---@param heading number +---@return number facing +function Spring.GetFacingFromHeading(heading) end + +---@param facing number +---@return number heading +function Spring.GetHeadingFromFacing(facing) end + +---Sides and Factions +--- +---@section sidesfactions + +---Side spec +--- +---@class SideSpec +--- +---Used when returning arrays of side specifications, is itself an array with +---positional values as below: +---@field sideName string +---@field caseName string +---@field startUnit string +local SideSpec = {} + +---@param sideName string +---@return nil|string startUnit +---@return string caseSensitiveSideName +function Spring.GetSideData(sideName) end + +---@param sideID integer +---@return nil|string sideName +---@return string startUnit +---@return string caseSensitiveSideName +function Spring.GetSideData(sideID) end + +---@return SideSpec[] sideArray +function Spring.GetSideData() end + +---Teams +--- +---@section Teams + +---@return number teamID +function Spring.GetGaiaTeamID() end + +---@param allyID integer +---@return number? xMin +---@return number? zMin +---@return number? xMax +---@return number? zMax +function Spring.GetAllyTeamStartBox(allyID) end + +---@param teamID integer +---@return number? x +---@return number? y +---@return number? x +function Spring.GetTeamStartPosition(teamID) end + +---@return float3[] array of positions indexed by teamID +function Spring.GetMapStartPositions() end + +---@return number[] list of allyTeamIDs +function Spring.GetAllyTeamList() end + +---@param allyTeamID integer? (Default: -1) to filter teams belonging to when >= 0 +---@return number[]? list of teamIDs +function Spring.GetTeamList(allyTeamID) end + +---@param teamID integer? (Default: -1) to filter by when >= 0 +---@param active boolean? (Default: false) whether to filter only active teams +---@return number[]? list of playerIDs +function Spring.GetPlayerList(teamID, active) end + +---@param teamID integer +---@param getTeamKeys boolean? (Default: true) whether to return the customTeamKeys table +---@return number? teamID +---@return number leader +---@return number isDead +---@return number hasAI +---@return string side +---@return number allyTeam +---@return number incomeMultiplier +---@return table customTeamKeys when getTeamKeys is true, otherwise nil +function Spring.GetTeamInfo(teamID, getTeamKeys) end + +---@param teamID integer +---@return integer? allyTeamID +function Spring.GetTeamAllyTeamID(teamID) end + +---@param teamID integer +---@param resource ResourceName +---@return number? currentLevel +---@return number storage +---@return number pull +---@return number income +---@return number expense +---@return number share +---@return number sent +---@return number received +---@return number excess +function Spring.GetTeamResources(teamID, resource) end + +---@param teamID integer +---@return number? killed +---@return number died +---@return number capturedBy +---@return number capturedFrom +---@return number received +---@return number sent +function Spring.GetTeamUnitStats(teamID) end + +---@param teamID integer +---@param resource ResourceName +---@return number? used +---@return number produced +---@return number excessed +---@return number received +---@return number sent +function Spring.GetTeamResourceStats(teamID, resource) end + +---Gets team damage dealt/received totals +--- +---Returns a team's damage stats. Note that all damage is counted, +---including self-inflicted and unconfirmed out-of-sight. +--- +---@param teamID integer +---@return number damageDealt +---@return number damageReceived +function Spring.GetTeamDamageStats(teamID) end + +---@class TeamStats +---@field time number +---@field frame number +---@field metalUsed number +---@field metalProduced number +---@field metalExcess number +---@field metalReceived number +---@field metalSent number +---@field energyUsed number +---@field energyProduced number +---@field energyExcess number +---@field energyReceived number +---@field energySent number +---@field damageDealt number +---@field damageReceived number +---@field unitsProduced integer +---@field unitsDied integer +---@field unitsReceived integer +---@field unitsSent integer +---@field unitsCaptured integer +---@field unitsOutCaptured integer +local TeamStats = {} + +---Get the number of history entries. +--- +---@param teamID integer +---@return integer? historyCount The number of history entries, or `nil` if unable to resolve team. +function Spring.GetTeamStatsHistory(teamID) end + +---Get team stats history. +--- +---@param teamID integer +---@param startIndex integer +---@param endIndex integer? (Default: startIndex) +---@return TeamStats[] The team stats history, or `nil` if unable to resolve team. +function Spring.GetTeamStatsHistory(teamID, startIndex, endIndex) end + +---@param teamID integer +---@return string +function Spring.GetTeamLuaAI(teamID) end + +---Returns a team's unit cap. +--- +---Also returns the current unit count for readable teams as the 2nd value. +--- +---@param teamID integer +---@return number maxUnits +---@return number? currentUnits +function Spring.GetTeamMaxUnits(teamID) end + +---@param playerID integer +---@param getPlayerOpts boolean? (Default: true) whether to return custom player options +---@return string name +---@return boolean active +---@return boolean spectator +---@return number teamID +---@return number allyTeamID +---@return number pingTime +---@return number cpuUsage +---@return string country +---@return number rank +---@return boolean hasSkirmishAIsInTeam +---@return {[string]: string} playerOpts when playerOpts is true +---@return boolean desynced +function Spring.GetPlayerInfo(playerID, getPlayerOpts) end + +---Returns unit controlled by player on FPS mode +--- +---@param playerID integer +---@return number? +function Spring.GetPlayerControlledUnit(playerID) end + +---@param teamID integer +---@return number skirmishAIID +---@return string name +---@return number hostingPlayerID +---@return string shortName when synced "SYNCED_NOSHORTNAME", otherwise the AI shortname or "UNKNOWN" +---@return string version when synced "SYNCED_NOVERSION", otherwise the AI version or "UNKNOWN" +---@return table options +function Spring.GetAIInfo(teamID) end + +---@param allyTeamID integer +---@return nil|table +function Spring.GetAllyTeamInfo(allyTeamID) end + +---@param teamID1 number +---@param teamID2 number +---@return nil|boolean +function Spring.AreTeamsAllied(teamID1, teamID2) end + +---@param playerID1 number +---@param playerID2 number +---@return nil|boolean +function Spring.ArePlayersAllied(playerID1, playerID2) end + +---Unit queries +--- +---@section unit_queries + +---Get a list of all unitIDs +--- +---Note that when called from a widget, this also returns units that are only +---radar blips. +--- +---For units that are radar blips, you may want to check if they are in los, +---as GetUnitDefID() will still return true if they have previously been seen. +--- +---@see UnsyncedRead.GetVisibleUnits +---@return number[] unitIDs +function Spring.GetAllUnits() end + +---@param teamID integer +---@return number[]? unitIDs +function Spring.GetTeamUnits(teamID) end + +---@param teamID integer +---@return table unitsByDef A table where keys are unitDefIDs and values are unitIDs +function Spring.GetTeamUnitsSorted(teamID) end + +---@param teamID integer +---@return table? countByUnit A table where keys are unitDefIDs and values are counts. +function Spring.GetTeamUnitsCounts(teamID) end + +---@param teamID integer +---@param unitDefIDs number|number[] +---@return number[]? unitIDs +function Spring.GetTeamUnitsByDefs(teamID, unitDefIDs) end + +---@param teamID integer +---@param unitDefID integer +---@return number? count +function Spring.GetTeamUnitDefCount(teamID, unitDefID) end + +---@param teamID integer +---@return number? count +function Spring.GetTeamUnitCount(teamID) end + +---Spatial unit queries +--- +---@section spatial_unit_queries +--- +---For the allegiance parameters: AllUnits = -1, MyUnits = -2, AllyUnits = -3, EnemyUnits = -4 + +---@param xmin number +---@param zmin number +---@param xmax number +---@param zmax number +---@param allegiance number? +---@return number[] unitIDs +function Spring.GetUnitsInRectangle(xmin, zmin, xmax, zmax, allegiance) end + +---@param xmin number +---@param ymin number +---@param zmin number +---@param xmax number +---@param ymax number +---@param zmax number +---@param allegiance number? +---@return number[] unitIDs +function Spring.GetUnitsInBox(xmin, ymin, zmin, xmax, ymax, zmax, allegiance) end + +---@param x number +---@param z number +---@param radius number +---@return number[] unitIDs +function Spring.GetUnitsInCylinder(x, z, radius) end + +---@param x number +---@param y number +---@param z number +---@param radius number +---@return number[] unitIDs +function Spring.GetUnitsInSphere(x, y, z, radius) end + +---@class Plane +---@field normalVecX number +---@field normalVecY number +---@field normalVecZ number +---@field d number +local Plane = {} + +--- +---Plane normals point towards accepted space, so the acceptance criteria for each plane is: +--- +---``` +---radius = unit radius +---px, py, pz = unit position +---[(nx * px) + (ny * py) + (nz * pz) + (d - radius)] <= 0 +---``` +--- +---@param planes Plane[] +---@param allegiance integer? +---@return integer[] unitIDs +function Spring.GetUnitsInPlanes(planes, allegiance) end + +---Returns the centroid of an array of units +--- +---Returns nil for an empty array +--- +---@param units table { unitID, unitID, ... } +---@return number centerX +---@return number centerY +---@return number centerZ +function Spring.GetUnitArrayCentroid(units) end + +---Returns the centroid of a map of units +--- +---Returns nil for an empty map +--- +---@param units table { [unitID] = true, [unitID] = true, ... } +---@return number centerX +---@return number centerY +---@return number centerZ +function Spring.GetUnitMapCentroid(units) end + +---@param unitID integer +---@param range number? (Default: 1.0e9f) +---@return number? unitID +function Spring.GetUnitNearestAlly(unitID, range) end + +---@param unitID integer +---@param range number? (Default: 1.0e9f) +---@param useLOS boolean? (Default: true) +---@return number? unitID +function Spring.GetUnitNearestEnemy(unitID, range, useLOS) end + +---Spatial feature queries +--- +---@section spatial_feature_queries + +---@param xmin number +---@param zmin number +---@param xmax number +---@param zmax number +---@return number[] featureIDs +function Spring.GetFeaturesInRectangle(xmin, zmin, xmax, zmax) end + +---@param x number +---@param y number +---@param z number +---@param radius number +---@return number[] featureIDs +function Spring.GetFeaturesInSphere(x, y, z, radius) end + +---@param x number +---@param z number +---@param radius number +---@param allegiance number? +---@return number[] featureIDs +function Spring.GetFeaturesInCylinder(x, z, radius, allegiance) end + +---@param xmin number +---@param zmin number +---@param xmax number +---@param zmax number +---@param excludeWeaponProjectiles boolean? (Default: false) +---@param excludePieceProjectiles boolean? (Default: false) +---@return number[] projectileIDs +function Spring.GetProjectilesInRectangle(xmin, zmin, xmax, zmax, excludeWeaponProjectiles, excludePieceProjectiles) end + +---Unit state +--- +---@section unit_state + +---@param unitID integer +---@return boolean +function Spring.ValidUnitID(unitID) end + +---@class UnitState +---@field firestate number +---@field movestate number +---@field repeat boolean +---@field cloak boolean +---@field active boolean +---@field trajectory boolean +---@field autoland boolean? +---@field autorepairlevel number? +---@field loopbackattack boolean? +local UnitState = {} + +---@param unitID integer +---@return UnitState[] +function Spring.GetUnitStates(unitID) end + +---@param unitID integer +---@return nil|boolean armored +---@return number armorMultiple +function Spring.GetUnitArmored(unitID) end + +---@param unitID integer +---@return boolean? isActive +function Spring.GetUnitIsActive(unitID) end + +---@param unitID integer +---@return boolean? isCloaked +function Spring.GetUnitIsCloaked(unitID) end + +---@param unitID integer +---@return number? seismicSignature +function Spring.GetUnitSeismicSignature(unitID) end + +---@param unitID integer +---@return integer? selfDTime +function Spring.GetUnitSelfDTime(unitID) end + +---@param unitID integer +---@return integer? numStockpiled +---@return integer? numStockpileQued +---@return number? buildPercent +function Spring.GetUnitStockpile(unitID) end + +---@param unitID integer +---@param type string one of los, airLos, radar, sonar, seismic, radarJammer, sonarJammer +---@return number? radius +function Spring.GetUnitSensorRadius(unitID, type) end + +---@param unitID integer +---@param allyTeamID integer? +---@return number? posErrorVectorX +---@return number posErrorVectorY +---@return number posErrorVectorZ +---@return number posErrorDeltaX +---@return number posErrorDeltaY +---@return number posErrorDeltaZ +---@return number nextPosErrorUpdatebaseErrorMult +---@return boolean posErrorBit +function Spring.GetUnitPosErrorParams(unitID, allyTeamID) end + +---@param unitID integer +---@return nil|string +function Spring.GetUnitTooltip(unitID) end + +---@param unitID integer +---@return number? +function Spring.GetUnitDefID(unitID) end + +---@param unitID integer +---@return number? +function Spring.GetUnitTeam(unitID) end + +---@param unitID integer +---@return number? +function Spring.GetUnitAllyTeam(unitID) end + +---Checks if a unit is neutral (NOT Gaia!) +--- +---Note that a "neutral" unit can belong to any ally-team (ally, enemy, Gaia). +---To check if a unit is Gaia, check its owner team. +--- +---@param unitID integer +---@return nil|boolean +function Spring.GetUnitNeutral(unitID) end + +---@param unitID integer +---@return number? health +---@return number maxHealth +---@return number paralyzeDamage +---@return number captureProgress +---@return number buildProgress between 0.0-1.0 +function Spring.GetUnitHealth(unitID) end + +---@param unitID integer +---@return nil|boolean +function Spring.GetUnitIsDead(unitID) end + +---Checks whether a unit is disabled and can't act +--- +---The first return value is a simple OR of the following ones, +---any of those conditions is sufficient to disable the unit. +--- +---Note that EMP and being transported are mechanically the same and thus lumped together. +---Use other callouts to differentiate them if you need to. +--- +---@param unitID integer +---@return nil|boolean stunnedOrBuilt unit is disabled +---@return boolean stunned unit is either stunned via EMP or being transported by a non-fireplatform +---@return boolean beingBuilt unit is under construction +function Spring.GetUnitIsStunned(unitID) end + +---@param unitID integer +---@return boolean beingBuilt +---@return number buildProgress +function Spring.GetUnitIsBeingBuilt(unitID) end + +---@param unitID integer +---@return number? metalMake +---@return number metalUse +---@return number energyMake +---@return number energyUse +function Spring.GetUnitResources(unitID) end + +---@param unitID integer +---@return number? buildTime +---@return number metalCost +---@return number energyCost +function Spring.GetUnitCosts(unitID) end + +---@class ResourceCost +---@field metal number +---@field energy number +local ResourceCost = {} + +---@param unitID integer +---@return ResourceCost? cost The cost of the unit, or `nil` if invalid. +---@return number? buildTime The build time the unit, or `nil` if invalid. +function Spring.GetUnitCostTable(unitID) end + +---@param unitID integer +---@return number? metalExtraction +function Spring.GetUnitMetalExtraction(unitID) end + +---@param unitID integer +---@return number xp [0.0; +∞) +---@return number limXp [0.0; 1.0) as experience approaches infinity +function Spring.GetUnitExperience(unitID) end + +---@param unitID integer +---@return number? +function Spring.GetUnitHeight(unitID) end + +---@param unitID integer +---@return number? +function Spring.GetUnitRadius(unitID) end + +--- +---Gets the unit's radius for when targeted by build, repair, reclaim-type commands. +--- +---@param unitID integer +---@return number? +function Spring.GetUnitBuildeeRadius(unitID) end + +---@param unitID integer +---@return number? +function Spring.GetUnitMass(unitID) end + +---@param unitID integer +---@param midPos boolean? (Default: false) return midpoint as well +---@param aimPos boolean? (Default: false) return aimpoint as well +---@return number? basePointX +---@return number basePointY +---@return number basePointZ +---@return number? midPointX +---@return number midPointY +---@return number midPointZ +---@return number? aimPointX +---@return number aimPointY +---@return number aimPointZ +function Spring.GetUnitPosition(unitID, midPos, aimPos) end + +---@param unitID integer +---@return number? posX +---@return number posY +---@return number posZ +function Spring.GetUnitBasePosition(unitID) end + +---@param unitID integer +---@return float3? front +---@return float3 up +---@return float3 right +function Spring.GetUnitVectors(unitID) end + +---@param unitID integer +---@return number? pitch Rotation in X axis +---@return number? yaw Rotation in Y axis +---@return number? roll Rotation in Z axis +function Spring.GetUnitRotation(unitID) end + +---@param unitID integer +---@return number? dirX +---@return number? dirY +---@return number? dirZ +function Spring.GetUnitDirection(unitID) end + +---@param unitID integer +---@param convertToRadians boolean? (Default: false) +---@return number heading +function Spring.GetUnitHeading(unitID, convertToRadians) end + +---@param unitID integer +function Spring.GetUnitVelocity(unitID) end + +---@param unitID integer +function Spring.GetUnitBuildFacing(unitID) end + +---Checks whether a unit is currently building another (NOT for checking if it's a structure) +--- +---Works for both mobile builders and factories. +--- +---@param unitID integer +---@return number buildeeUnitID or nil +function Spring.GetUnitIsBuilding(unitID) end + +---Checks a builder's current task +--- +---Checks what a builder is currently doing. This is not the same as `Spring.GetUnitCurrentCommand`, +---because you can have a command at the front of the queue and not be doing it (for example because +---the target is still too far away), and on the other hand you can also be doing a task despite not +---having it in front of the queue (for example you're Guarding another builder who does). Also, it +---resolves the Repair command into either actual repair, or construction assist (in which case it +---returns the appropriate "build" command). Only build-related commands are returned (no Move or any +---custom commands). +--- +---The possible commands returned are repair, reclaim, resurrect, capture, restore, +---and build commands (negative buildee unitDefID). +--- +---@param unitID integer +---@return number cmdID of the relevant command +---@return number targetID if applicable (all except RESTORE) +function Spring.GetUnitWorkerTask(unitID) end + +--- +---Useful for setting move goals manually. +--- +---@param unitID integer +---@param buildeeDefID integer or nil +---@return number effectiveBuildRange counted to the center of prospective buildee; buildRange if buildee nil +function Spring.GetUnitEffectiveBuildRange(unitID, buildeeDefID) end + +---@param unitID integer +function Spring.GetUnitCurrentBuildPower(unitID) end + +---Get a unit's carried resources +--- +---Checks resources being carried internally by the unit. +--- +---@param unitID integer +---@return number storedMetal +---@return number maxStoredMetal +---@return number storedEnergy +---@return number maxStoredEnergy +function Spring.GetUnitHarvestStorage(unitID) end + +---@param unitID integer +function Spring.GetUnitBuildParams(unitID) end + +---Is builder in build stance +--- +---Checks if a builder is in build stance, i.e. can create nanoframes. +---Returns nil for non-builders. +--- +---@param unitID integer +---@return boolean inBuildStance +function Spring.GetUnitInBuildStance(unitID) end + +---Get construction FX attachment points +--- +---Returns an array of pieces which represent construction +---points. Default engine construction FX (nano spray) will +---originate there. +--- +---Only works on builders and factories, returns nil (NOT empty table) +---for other units. +--- +---@param unitID integer +---@return integer[] pieceArray +function Spring.GetUnitNanoPieces(unitID) end + +---Get the transport carrying the unit +--- +---Returns the unit ID of the transport, if any. +---Returns nil if the unit is not being transported. +--- +---@param unitID integer +---@return number|nil transportUnitID +function Spring.GetUnitTransporter(unitID) end + +---Get units being transported +--- +---@param unitID integer +---@return integer[]? transporteeArray +---An array of unitIDs being transported by this unit, or `nil` if not a transport. +function Spring.GetUnitIsTransporting(unitID) end + +---@param unitID integer +---@param weaponNum number? Optional if the unit has just one shield +---@return number isEnabled Warning, number not boolean. 0 or 1 +---@return number currentPower +function Spring.GetUnitShieldState(unitID, weaponNum) end + +---@param unitID integer +function Spring.GetUnitFlanking(unitID) end + +---Get a unit's engagement range +--- +---Returns the range at which a unit will stop to engage. +---By default this is the highest among the unit's weapon ranges (hence name), +---but can be changed dynamically. Also note that unarmed units ignore this. +--- +---@param unitID integer +---@return number maxRange +function Spring.GetUnitMaxRange(unitID) end + +---Unit weapon state +--- +---@section unit_weapon_state + +---Check the state of a unit's weapon +--- +---Available states to poll: +---"reloadFrame" (frame on which the weapon will be ready to fire), +---"reloadSpeed" (reload time in seconds), +---"range" (in elmos), +---"autoTargetRangeBoost" (predictive aiming range buffer, in elmos), +---"projectileSpeed" (in elmos/frame), +---"reloadTimeXP" (reload time after XP bonus, in seconds), +---"reaimTime" (frames between AimWeapon calls), +---"burst" (shots in a burst), +---"burstRate" (delay between shots in a burst, in seconds), +---"projectiles" (projectiles per shot), +---"salvoLeft" (shots remaining in ongoing burst), +---"nextSalvo" (simframe of the next shot in an ongoing burst), +---"accuracy" (INaccuracy after XP bonus), +---"sprayAngle" (spray angle after XP bonus), +---"targetMoveError" (extra inaccuracy against moving targets, after XP bonus) +---"avoidFlags" (bitmask for targeting avoidance), +---"collisionFlags" (bitmask for collisions). +--- +---The state "salvoError" is an exception and returns a table: {x, y, z}, +---which represents the inaccuracy error of the ongoing burst. +--- +---@param unitID integer +---@param weaponNum number +---@param stateName string +---@return number stateValue +function Spring.GetUnitWeaponState(unitID, weaponNum, stateName) end + +---@param unitID integer +function Spring.GetUnitWeaponDamages(unitID) end + +---@param unitID integer +function Spring.GetUnitWeaponVectors(unitID) end + +---@param unitID integer +function Spring.GetUnitWeaponTryTarget(unitID) end + +---@param unitID integer +function Spring.GetUnitWeaponTestTarget(unitID) end + +---@param unitID integer +function Spring.GetUnitWeaponTestRange(unitID) end + +---@param unitID integer +function Spring.GetUnitWeaponHaveFreeLineOfFire(unitID) end + +---@param unitID integer +function Spring.GetUnitWeaponCanFire(unitID) end + +---@alias TargetType +---| 0 # none +---| 1 # unit +---| 2 # position +---| 3 # projectile + +---Checks a weapon's target +--- +---Note that this doesn't need to reflect the unit's Attack orders or such, and +---that weapons can aim individually unless slaved. +--- +---@param unitID integer +---@param weaponNum integer +---@return 0 TargetType none +---@return boolean isUserTarget +function Spring.GetUnitWeaponTarget(unitID, weaponNum) end + +---Checks a weapon's target +--- +---Note that this doesn't need to reflect the unit's Attack orders or such, and +---that weapons can aim individually unless slaved. +--- +---@param unitID integer +---@param weaponNum integer +---@return 1 TargetType unit +---@return boolean isUserTarget +---@return integer targetUnitID +function Spring.GetUnitWeaponTarget(unitID, weaponNum) end + +---Checks a weapon's target +--- +---Note that this doesn't need to reflect the unit's Attack orders or such, and +---that weapons can aim individually unless slaved. +--- +---@param unitID integer +---@param weaponNum integer +---@return 2 TargetType position +---@return boolean isUserTarget +---@return float3 targetPosition +function Spring.GetUnitWeaponTarget(unitID, weaponNum) end + +---Checks a weapon's target +--- +---Note that this doesn't need to reflect the unit's Attack orders or such, and +---that weapons can aim individually unless slaved. +--- +---@param unitID integer +---@param weaponNum integer +---@return 3 TargetType projectileID +---@return boolean isUserTarget +---@return integer targetProjectileId +function Spring.GetUnitWeaponTarget(unitID, weaponNum) end + +---Misc +--- +---@section misc + +---@param unitID integer +function Spring.GetUnitEstimatedPath(unitID) end + +---@param unitID integer +function Spring.GetUnitLastAttacker(unitID) end + +---@param unitID integer +function Spring.GetUnitLastAttackedPiece(unitID) end + +---@param unitID integer +function Spring.GetUnitCollisionVolumeData(unitID) end + +---@param unitID1 number +---@param unitID2 number +---@param direction boolean? (Default: false) to subtract from, default unitID1 - unitID2 +---@param subtractRadii boolean? (Default: false) whether units radii should be subtracted from the total +---@return number? +function Spring.GetUnitSeparation(unitID1, unitID2, direction, subtractRadii) end + +---@param unitID integer +function Spring.GetUnitFeatureSeparation(unitID) end + +---@param unitDefID integer +function Spring.GetUnitDefDimensions(unitDefID) end + +function Spring.GetCEGID() end + +---@param unitID integer +---@return nil|boolean isBlocking +---@return boolean isSolidObjectCollidable +---@return boolean isProjectileCollidable +---@return boolean isRaySegmentCollidable +---@return boolean crushable +---@return boolean blockEnemyPushing +---@return boolean blockHeightChanges +function Spring.GetUnitBlocking(unitID) end + +---@param unitID integer +function Spring.GetUnitMoveTypeData(unitID) end + +function Spring.GetUnitCurrentCommand() end + +---Get the commands for a unit. +--- +---Same as `Spring.GetCommandQueue` +--- +---@param unitID integer +---@param count integer Number of commands to return, `-1` returns all commands, `0` returns command count. +---@return Command[] commands +function Spring.GetUnitCommands(unitID, count) end + +---Get the count of commands for a unit. +--- +---Same as `Spring.GetCommandQueue` +--- +---@param unitID integer +---@param count 0 Returns the number of commands in the units queue. +---@return integer The number of commands in the unit queue. +function Spring.GetUnitCommands(unitID, count) end + +---Get the number or list of commands for a factory +--- +---@param unitID integer +---@param count number when 0 returns the number of commands in the units queue, when -1 returns all commands, number of commands to return otherwise +---@return number|Command[] commands +function Spring.GetFactoryCommands(unitID, count) end + +---@param unitID integer +function Spring.GetFactoryBuggerOff(unitID) end + +---Gets the build queue of a factory +--- +---@param unitID integer +---@param count integer? (Default: -1) Number of commands to retrieve, `-1` for all. +---@param addCmds boolean? (Default: false) Retrieve commands other than buildunit +---@return table? counts Build queue count by `unitDefID` or `-cmdID`, or `nil` if unit is not found. +function Spring.GetFactoryCounts(unitID, count, addCmds) end + +---Get the commands for a unit. +--- +---Same as `Spring.GetUnitCommands` +--- +---@param unitID integer +---@param count integer Number of commands to return, `-1` returns all commands, `0` returns command count. +---@return Command[] commands +function Spring.GetCommandQueue(unitID, count) end + +---Get the count of commands for a unit. +--- +---Same as `Spring.GetUnitCommands` +--- +---@param unitID integer +---@param count 0 Returns the number of commands in the units queue. +---@return integer The number of commands in the unit queue. +function Spring.GetCommandQueue(unitID, count) end + +---Returns the build queue +--- +---@param unitID integer +---@return nil|table buildqueue indexed by unitDefID with count values +function Spring.GetFullBuildQueue(unitID) end + +---Returns the build queue cleaned of things the unit can't build itself +--- +---@param unitID integer +---@return nil|table buildqueue indexed by unitDefID with count values +function Spring.GetRealBuildQueue(unitID) end + +---@param unitID integer +function Spring.GetUnitCmdDescs(unitID) end + +---@param unitID integer +function Spring.FindUnitCmdDesc(unitID) end + +---@param featureID integer +---@return boolean +function Spring.ValidFeatureID(featureID) end + +function Spring.GetAllFeatures() end + +---@param featureID integer +---@return number? +function Spring.GetFeatureDefID(featureID) end + +---@param featureID integer +---@return number? +function Spring.GetFeatureTeam(featureID) end + +---@param featureID integer +---@return number? +function Spring.GetFeatureAllyTeam(featureID) end + +---@param featureID integer +---@return number? health +---@return number defHealth +---@return number resurrectProgress +function Spring.GetFeatureHealth(featureID) end + +---@param featureID integer +---@return number? +function Spring.GetFeatureHeight(featureID) end + +---@param featureID integer +---@return number? +function Spring.GetFeatureRadius(featureID) end + +---@param featureID integer +---@return number? +function Spring.GetFeatureMass(featureID) end + +---@param featureID integer +function Spring.GetFeaturePosition(featureID) end + +---@param featureID1 number +---@param featureID2 number +---@param direction boolean? (Default: false) to subtract from, default featureID1 - featureID2 +---@return number? +function Spring.GetFeatureSeparation(featureID1, featureID2, direction) end + +---@param featureID integer +---@return number? pitch Rotation in X axis +---@return number? yaw Rotation in Y axis +---@return number? roll Rotation in Z axis +function Spring.GetFeatureRotation(featureID) end + +---@param featureID integer +---@return number? dirX +---@return number? dirY +---@return number? dirZ +function Spring.GetFeatureDirection(featureID) end + +---@param featureID integer +function Spring.GetFeatureVelocity(featureID) end + +---@param featureID integer +function Spring.GetFeatureHeading(featureID) end + +---@param featureID integer +---@return number? metal +---@return number defMetal +---@return number energy +---@return number defEnergy +---@return number reclaimLeft +---@return number reclaimTime +function Spring.GetFeatureResources(featureID) end + +---@param featureID integer +---@return nil|boolean isBlocking +---@return boolean isSolidObjectCollidable +---@return boolean isProjectileCollidable +---@return boolean isRaySegmentCollidable +---@return boolean crushable +---@return boolean blockEnemyPushing +---@return boolean blockHeightChanges +function Spring.GetFeatureBlocking(featureID) end + +---@param featureID integer +---@return nil|boolean +function Spring.GetFeatureNoSelect(featureID) end + +---@param featureID integer +function Spring.GetFeatureResurrect(featureID) end + +---@param featureID integer +function Spring.GetFeatureLastAttackedPiece(featureID) end + +---@param featureID integer +function Spring.GetFeatureCollisionVolumeData(featureID) end + +---@param featureID integer +function Spring.GetFeaturePieceCollisionVolumeData(featureID) end + +---Projectile state +--- +---@section projectile_state + +---@param projectileID integer +---@return number? posX +---@return number posY +---@return number posZ +function Spring.GetProjectilePosition(projectileID) end + +---@param projectileID integer +---@return number? dirX +---@return number dirY +---@return number dirZ +function Spring.GetProjectileDirection(projectileID) end + +---@param projectileID integer +---@return number? velX +---@return number velY +---@return number velZ +---@return number velW +function Spring.GetProjectileVelocity(projectileID) end + +---@param projectileID integer +---@return number? +function Spring.GetProjectileGravity(projectileID) end + +---@param projectileID integer +---@return number? explosionFlags encoded bitwise with SHATTER = 1, EXPLODE = 2, EXPLODE_ON_HIT = 2, FALL = 4, SMOKE = 8, FIRE = 16, NONE = 32, NO_CEG_TRAIL = 64, NO_HEATCLOUD = 128 +---@return number spinAngle +---@return number spinSpeed +---@return number spinVectorX +---@return number spinVectorY +---@return number spinVectorZ +function Spring.GetPieceProjectileParams(projectileID) end + +---@param projectileID integer +---@return number? targetTypeInt where +---string.byte('g') := GROUND +---string.byte('u') := UNIT +---string.byte('f') := FEATURE +---string.byte('p') := PROJECTILE +---@return number|float3 target targetID or targetPos when targetTypeInt == string.byte('g') +function Spring.GetProjectileTarget(projectileID) end + +---@param projectileID integer +---@return nil|boolean +function Spring.GetProjectileIsIntercepted(projectileID) end + +---@param projectileID integer +---@return number? +function Spring.GetProjectileTimeToLive(projectileID) end + +---@param projectileID integer +---@return number? +function Spring.GetProjectileOwnerID(projectileID) end + +---@param projectileID integer +---@return number? +function Spring.GetProjectileTeamID(projectileID) end + +---@param projectileID integer +---@return number? +function Spring.GetProjectileAllyTeamID(projectileID) end + +---@param projectileID integer +---@return nil|boolean weapon +---@return boolean piece +function Spring.GetProjectileType(projectileID) end + +--- +---Using this to get a weaponDefID is HIGHLY preferred to indexing WeaponDefNames via GetProjectileName +--- +---@param projectileID integer +---@return number? +function Spring.GetProjectileDefID(projectileID) end + +---@param projectileID integer +---@param tag string one of: +---"paralyzeDamageTime" +---"impulseFactor" +---"impulseBoost" +---"craterMult" +---"craterBoost" +---"dynDamageExp" +---"dynDamageMin" +---"dynDamageRange" +---"dynDamageInverted" +---"craterAreaOfEffect" +---"damageAreaOfEffect" +---"edgeEffectiveness" +---"explosionSpeed" +---- or - +---an armor type index to get the damage against it. +---@return number? +function Spring.GetProjectileDamages(projectileID, tag) end + +---Ground +--- +---@section ground + +---@param x number +---@param z number +---@return boolean inPlayArea whether the position is in the active play area +---@return boolean inMap whether the position is in the full map area (currently this is the same as above) +function Spring.IsPosInMap(x, z) end + +---Get ground height +--- +---On sea, this returns the negative depth of the seafloor +--- +---@param x number +---@param z number +---@return number +function Spring.GetGroundHeight(x, z) end + +---Get water plane height +--- +---Water may at some point become shaped (rivers etc) but for now it is always a flat plane. +---Use this function instead of GetWaterLevel to denote you are relying on that assumption. +--- +---@see Spring.GetWaterLevel +---@return number waterPlaneLevel +function Spring.GetWaterPlaneLevel() end + +---Get water level in a specific position +--- +---Water is currently a flat plane, so this returns the same value regardless of XZ. +---However water may become more dynamic at some point so by using this you are future-proof. +--- +---@param x number +---@param z number +---@return number waterLevel +function Spring.GetWaterLevel(x, z) end + +---Get ground height as it was at game start +--- +---Returns the original height before the ground got deformed +--- +---@param x number +---@param z number +---@return number +function Spring.GetGroundOrigHeight(x, z) end + +---@param x number +---@param z number +---@param smoothed boolean? (Default: false) raw or smoothed center normal +---@return number normalX +---@return number normalY +---@return number normalZ +---@return number slope +function Spring.GetGroundNormal(x, z, smoothed) end + +---@param x number +---@param z number +---@return number ix +---@return number iz +---@return number terrainTypeIndex +---@return string name +---@return number metalExtraction +---@return number hardness +---@return number tankSpeed +---@return number kbotSpeed +---@return number hoverSpeed +---@return number shipSpeed +---@return boolean receiveTracks +function Spring.GetGroundInfo(x, z) end + +function Spring.GetGroundBlocked() end + +---@return number initMinHeight +---@return number initMaxHeight +---@return number currMinHeight +---@return number currMaxHeight +function Spring.GetGroundExtremes() end + +---@param terrainTypeInfo number +---@return number index +---@return string name +---@return number hardness +---@return number tankSpeed +---@return number kbotSpeed +---@return number hoverSpeed +---@return number shipSpeed +---@return boolean receiveTracks +function Spring.GetTerrainTypeData(terrainTypeInfo) end + +---@param x number +---@param z number +---@return number +function Spring.GetGrass(x, z) end + +---@param x number +---@param z number +---@return number height +function Spring.GetSmoothMeshHeight(x, z) end + +---Tests +--- +---@section tests + +---@param unitDefID integer +---@param pos float3 +---@param dir float3? (Default: `{ x: 0, y: 0, z: 0 }`) +---@param testTerrain boolean? (Default: true) +---@param testObjects boolean? (Default: true) +---@param centerOnly boolean? (Default: false) +---@return boolean +function Spring.TestMoveOrder(unitDefID, pos, dir, testTerrain, testObjects, centerOnly) end + +---@alias BuildOrderBlockedStatus +---| 0 # blocked +---| 1 # mobile unit on the way +---| 2 # reclaimable +---| 3 # open + +---@param unitDefID integer +---@param x number +---@param y number +---@param z number +---@param facing 0|"s"|1|"e"|2|"n"|3|"w" +---@return BuildOrderBlockedStatus blocking +---@return integer? featureID A reclaimable feature in the way. +function Spring.TestBuildOrder(unitDefID, x, y, z, facing) end + +---Snaps a position to the building grid +--- +---@param unitDefID integer +---@param posX number +---@param posY number +---@param posZ number +---@param buildFacing number? (Default: 0) one of SOUTH = 0, EAST = 1, NORTH = 2, WEST = 3 +---@return number buildPosX +---@return number buildPosY +---@return number buildPosZ +function Spring.Pos2BuildPos(unitDefID, posX, posY, posZ, buildFacing) end + +---@param teamID integer +---@param unitDefID integer +---@param posX number +---@param posY number +---@param posZ number +---@param searchRadius number +---@param minDistance number +---@param buildFacing number one of SOUTH = 0, EAST = 1, NORTH = 2, WEST = 3 +---@return number buildPosX +---@return number buildPosY +---@return number buildPosZ +function Spring.ClosestBuildPos(teamID, unitDefID, posX, posY, posZ, searchRadius, minDistance, buildFacing) end + +---Visibility +--- +---@section visibility + +---@param posX number +---@param posY number +---@param posZ number +---@param allyTeamID integer? +---@return boolean inLosOrRadar +---@return boolean inLos +---@return boolean inRadar +---@return boolean inJammer +function Spring.GetPositionLosState(posX, posY, posZ, allyTeamID) end + +---@param posX number +---@param posY number +---@param posZ number +---@param allyTeamID integer? +---@return boolean +function Spring.IsPosInLos(posX, posY, posZ, allyTeamID) end + +---@param posX number +---@param posY number +---@param posZ number +---@param allyTeamID integer? +---@return boolean +function Spring.IsPosInRadar(posX, posY, posZ, allyTeamID) end + +---@param posX number +---@param posY number +---@param posZ number +---@param allyTeamID integer? +---@return boolean +function Spring.IsPosInAirLos(posX, posY, posZ, allyTeamID) end + +---@param unitID integer +---@param allyTeamID integer? +---@param raw true Return a bitmask. +---@return integer? bitmask +---A bitmask integer, or `nil` if `unitID` is invalid. +--- +---Bitmask bits: +---- `1`: `LOS_INLOS` the unit is currently in the los of the allyteam, +---- `2`: `LOS_INRADAR` the unit is currently in radar from the allyteam, +---- `4`: `LOS_PREVLOS` the unit has previously been in los from the allyteam, +---- `8`: `LOS_CONTRADAR` the unit has continuously been in radar since it was last inlos by the allyteam +function Spring.GetUnitLosState(unitID, allyTeamID, raw) end + +---@param unitID integer +---@param allyTeamID integer? +---@param raw false? Return a bitmask. +---@return { los: boolean, radar: boolean, typed: boolean }? los +---A table of LOS state, or `nil` if `unitID` is invalid. +function Spring.GetUnitLosState(unitID, allyTeamID, raw) end + +---@param unitID integer +---@param allyTeamID integer +---@return boolean inLos +function Spring.IsUnitInLos(unitID, allyTeamID) end + +---@param unitID integer +---@param allyTeamID integer +---@return boolean inAirLos +function Spring.IsUnitInAirLos(unitID, allyTeamID) end + +---@param unitID integer +---@param allyTeamID integer +---@return boolean inRadar +function Spring.IsUnitInRadar(unitID, allyTeamID) end + +---@param unitID integer +---@param allyTeamID integer +---@return boolean inJammer +function Spring.IsUnitInJammer(unitID, allyTeamID) end + +---Piece/Script +--- +---@section piecescript + +---@class PieceInfo +---@field name string +---@field parent string +---@field children string[] names +---@field empty boolean +---@field min [number,number,number] (x,y,z) +---@field max [number,number,number] (x,y,z) +---@field offset [number,number,number] (x,y,z) +local PieceInfo = {} + +---@param modelName string +---@return number index of the root piece +function Spring.GetModelRootPiece(modelName) end + +---@param modelName string +---@return nil|table pieceInfos where keys are piece names and values are indices +function Spring.GetModelPieceMap(modelName) end + +---@param modelName string +---@return nil|string[] pieceNames +function Spring.GetModelPieceList(modelName) end + +---@param unitID integer +---@return number index of the root piece +function Spring.GetUnitRootPiece(unitID) end + +---@param unitID integer +---@return nil|table pieceInfos where keys are piece names and values are indices +function Spring.GetUnitPieceMap(unitID) end + +---@param unitID integer +---@return string[] pieceNames +function Spring.GetUnitPieceList(unitID) end + +---@param unitID integer +---@param pieceIndex integer +---@return PieceInfo? pieceInfo +function Spring.GetUnitPieceInfo(unitID, pieceIndex) end + +---@param unitID integer +---@param pieceIndex integer +---@return number|nil posX +---@return number posY +---@return number posZ +---@return number dirX +---@return number dirY +---@return number dirZ +function Spring.GetUnitPiecePosDir(unitID, pieceIndex) end + +---@param unitID integer +---@param pieceIndex integer +---@return number|nil posX +---@return number posY +---@return number posZ +function Spring.GetUnitPiecePosition(unitID, pieceIndex) end + +---@param unitID integer +---@param pieceIndex integer +---@return number|nil dirX +---@return number dirY +---@return number dirZ +function Spring.GetUnitPieceDirection(unitID, pieceIndex) end + +---@param unitID integer +---@return number|nil m11 +---@return number m12 +---@return number m13 +---@return number m14 +---@return number m21 +---@return number m22 +---@return number m23 +---@return number m24 +---@return number m31 +---@return number m32 +---@return number m33 +---@return number m34 +---@return number m41 +---@return number m42 +---@return number m43 +---@return number m44 +function Spring.GetUnitPieceMatrix(unitID) end + +---@param featureID integer +---@return number index of the root piece +function Spring.GetFeatureRootPiece(featureID) end + +---@param featureID integer +---@return table pieceInfos where keys are piece names and values are indices +function Spring.GetFeaturePieceMap(featureID) end + +---@param featureID integer +---@return string[] pieceNames +function Spring.GetFeaturePieceList(featureID) end + +---@param featureID integer +---@param pieceIndex integer +---@return PieceInfo? pieceInfo +function Spring.GetFeaturePieceInfo(featureID, pieceIndex) end + +---@param featureID integer +---@param pieceIndex integer +---@return number|nil posX +---@return number posY +---@return number posZ +---@return number dirX +---@return number dirY +---@return number dirZ +function Spring.GetFeaturePiecePosDir(featureID, pieceIndex) end + +---@param featureID integer +---@param pieceIndex integer +---@return number|nil posX +---@return number posY +---@return number posZ +function Spring.GetFeaturePiecePosition(featureID, pieceIndex) end + +---@param featureID integer +---@param pieceIndex integer +---@return number|nil dirX +---@return number dirY +---@return number dirZ +function Spring.GetFeaturePieceDirection(featureID, pieceIndex) end + +---@param featureID integer +---@return number|nil m11 +---@return number m12 +---@return number m13 +---@return number m14 +---@return number m21 +---@return number m22 +---@return number m23 +---@return number m24 +---@return number m31 +---@return number m32 +---@return number m33 +---@return number m34 +---@return number m41 +---@return number m42 +---@return number m43 +---@return number m44 +function Spring.GetFeaturePieceMatrix(featureID) end + +---@param unitID integer +---@return integer[] pieceIndices +function Spring.GetUnitScriptPiece(unitID) end + +---@param unitID integer +---@param scriptPiece integer +---@return integer pieceIndex +function Spring.GetUnitScriptPiece(unitID, scriptPiece) end + +---@param unitID integer +---@return table where keys are piece names and values are piece indices +function Spring.GetUnitScriptNames(unitID) end + +---Misc +--- +---@section misc + +---@param allyTeamID integer +---@return number? radarErrorSize actual radar error size (when allyTeamID is allied to current team) or base radar error size +---@return number baseRadarErrorSize +---@return number baseRadarErrorMult +function Spring.GetRadarErrorParams(allyTeamID) end \ No newline at end of file diff --git a/library/LuaSyncedTable.lua b/library/LuaSyncedTable.lua new file mode 100644 index 00000000000..59532480b5b --- /dev/null +++ b/library/LuaSyncedTable.lua @@ -0,0 +1,10 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaSyncedTable.cpp +--- +---@meta + diff --git a/library/LuaTextures.lua b/library/LuaTextures.lua new file mode 100644 index 00000000000..56e12e4ada9 --- /dev/null +++ b/library/LuaTextures.lua @@ -0,0 +1,10 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaTextures.cpp +--- +---@meta + diff --git a/library/LuaUI.lua b/library/LuaUI.lua new file mode 100644 index 00000000000..2db5d7bb4e4 --- /dev/null +++ b/library/LuaUI.lua @@ -0,0 +1,11 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaUI.cpp +--- +---@meta + +function ConfigureLayout() end \ No newline at end of file diff --git a/library/LuaUICommand.lua b/library/LuaUICommand.lua new file mode 100644 index 00000000000..34d9caa0518 --- /dev/null +++ b/library/LuaUICommand.lua @@ -0,0 +1,10 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaUICommand.cpp +--- +---@meta + diff --git a/library/LuaUnitDefs.lua b/library/LuaUnitDefs.lua new file mode 100644 index 00000000000..4182611dc4e --- /dev/null +++ b/library/LuaUnitDefs.lua @@ -0,0 +1,10 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaUnitDefs.cpp +--- +---@meta + diff --git a/library/LuaUnsyncedCtrl.lua b/library/LuaUnsyncedCtrl.lua new file mode 100644 index 00000000000..ed7cba867d6 --- /dev/null +++ b/library/LuaUnsyncedCtrl.lua @@ -0,0 +1,1302 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaUnsyncedCtrl.cpp +--- +---@meta + +---Callouts to set state +--- +---@see rts/Lua/LuaUnsyncedCtrl.cpp + +---Ingame Console +--- +---@section console + +---Send a ping request to the server +--- +---@param pingTag number +---@return nil +function Spring.Ping(pingTag) end + +---Useful for debugging. +--- +---Prints values in the spring chat console. +---Hint: the default print() writes to STDOUT. +--- +---@param arg any +---@param ... any +---@return nil +function Spring.Echo(arg, ...) end + +---@alias LogLevel +---| integer +---| "debug" # LOG.DEBUG +---| "info" # LOG.INFO +---| "notice" # LOG.NOTICE (engine default) +---| "warning" # LOG.WARNING +---| "error" # LOG.ERROR +---| "fatal" # LOG.FATAL + +---@param section string +---@param logLevel LogLevel? (Default: "notice") +---@param ... string messages +---@return nil +function Spring.Log(section, logLevel, ...) end + +---@param commands string[] +function Spring.SendCommands(commands) end + +---@param command string +---@param ... string additional commands +---@return nil +function Spring.SendCommands(command, ...) end + +---Messages +--- +---@section messages + +---@param message string +---@return nil +function Spring.SendMessage(message) end + +---@param message string `` (with # being a playerid) inside the string will be replaced with the players name - i.e. : Spring.SendMessage ("`` did something") might display as "ProRusher did something" +---@return nil +function Spring.SendMessageToSpectators(message) end + +---@param playerID number +---@param message string +---@return nil +function Spring.SendMessageToPlayer(playerID, message) end + +---@param teamID number +---@param message string +---@return nil +function Spring.SendMessageToTeam(teamID, message) end + +---@param allyID number +---@param message string +---@return nil +function Spring.SendMessageToAllyTeam(allyID, message) end + +---Sounds +--- +---@section sounds + +---Loads a SoundDefs file, the format is the same as in `gamedata/sounds.lua`. +--- +---@param soundfile string +---@return boolean success +function Spring.LoadSoundDef(soundfile) end + +---@alias SoundChannel +---| "general" # 0 +---| "battle" # Same as `"sfx" | 1` +---| "sfx" # Same as `"battle" | 1` +---| "unitreply" # Same as `"voice" | 2` +---| "voice" # Same as `"unitreply" | 2` +---| "userinterface" # Same as "ui" | 3` +---| "ui" # Same as "userinterface" | 3` +---| 0 # General +---| 1 # SFX +---| 2 # Voice +---| 3 # User interface + +---@param soundfile string +---@param volume number? (Default: 1.0) +---@param posx number? +---@param posy number? +---@param posz number? +---@param speedx number? +---@param speedy number? +---@param speedz number? +---@param channel SoundChannel? (Default: `0|"general"`) +---@return boolean playSound +function Spring.PlaySoundFile(soundfile, volume, posx, posy, posz, speedx, speedy, speedz, channel) end + +---Allows to play an Ogg Vorbis (.OGG) and mp3 compressed sound file. +--- +---Multiple sound streams may be played at once. +--- +---@param oggfile string +---@param volume number? (Default: 1.0) +---@param enqueue boolean? +---@return boolean success +function Spring.PlaySoundStream(oggfile, volume, enqueue) end + +---Terminates any SoundStream currently running. +--- +---@return nil +function Spring.StopSoundStream() end + +---Pause any SoundStream currently running. +--- +---@return nil +function Spring.PauseSoundStream() end + +---Set volume for SoundStream +--- +---@param volume number +---@return nil +function Spring.SetSoundStreamVolume(volume) end + +function Spring.SetSoundEffectParams() end + +---@param cmdID number +---@param posX number +---@param posY number +---@param posZ number +---@return nil +function Spring.AddWorldIcon(cmdID, posX, posY, posZ) end + +---@param text string +---@param posX number +---@param posY number +---@param posZ number +---@return nil +function Spring.AddWorldText(text, posX, posY, posZ) end + +---@param unitDefID number +---@param posX number +---@param posY number +---@param posZ number +---@param teamID number +---@param facing number +---@return nil +function Spring.AddWorldUnit(unitDefID, posX, posY, posZ, teamID, facing) end + +---@param unitID number +---@return nil +function Spring.DrawUnitCommands(unitID) end + +---@param units table array of unit ids +---@param tableOrArray boolean? (Default: false] when true `units` is interpreted as a table in the format `{ [unitID) = arg1, ... }` +---@return nil +function Spring.DrawUnitCommands(units, tableOrArray) end + +---Camera +--- +---@section camera + +---Parameters for camera state +--- +---Highly dependent on the type of the current camera controller +--- +---@class camState +---@field name "ta"|"spring"|"rot"|"ov"|"free"|"fps"|"dummy" +---@field mode number the camera mode: 0 (fps), 1 (ta), 2 (spring), 3 (rot), 4 (free), 5 (ov), 6 (dummy) +---@field fov number +---@field px number Position X of the ground point in screen center +---@field py number Position Y of the ground point in screen center +---@field pz number Position Z of the ground point in screen center +---@field dx number Camera direction vector X +---@field dy number Camera direction vector Y +---@field dz number Camera direction vector Z +---@field rx number Camera rotation angle on X axis (spring) +---@field ry number Camera rotation angle on Y axis (spring) +---@field rz number Camera rotation angle on Z axis (spring) +---@field angle number Camera rotation angle on X axis (aka tilt/pitch) (ta) +---@field flipped number -1 for when south is down, 1 for when north is down (ta) +---@field dist number Camera distance from the ground (spring) +---@field height number Camera distance from the ground (ta) +---@field oldHeight number Camera distance from the ground, cannot be changed (rot) +local camState = {} + +---For Spring Engine XZ represents horizontal, from north west corner of map and Y vertical, from water level and rising. +--- +---@param x number +---@param y number +---@param z number +---@param transTime number? +---@return nil +function Spring.SetCameraTarget(x, y, z, transTime) end + +---@param posX number? (Default: 0) +---@param posY number? (Default: 0) +---@param posZ number? (Default: 0) +---@param tiltX number? (Default: 0) +---@param tiltY number? (Default: 0) +---@param tiltZ number? (Default: 0) +---@return nil +function Spring.SetCameraOffset(posX, posY, posZ, tiltX, tiltY, tiltZ) end + +---Sets camera state +--- +---The fields in `camState` must be consistent with the name/mode and current/new camera mode +--- +---@param camState camState +---@param transitionTime number? (Default: 0) in nanoseconds +---@param transitionTimeFactor number? +---multiplicative factor applied to this and all subsequent transition times for +---this camera mode. +--- +---Defaults to "CamTimeFactor" springsetting unless set previously. +---@param transitionTimeExponent number? +---tween factor applied to this and all subsequent transitions for this camera +---mode. +--- +---Defaults to "CamTimeExponent" springsetting unless set previously. +---@return boolean set +function Spring.SetCameraState(camState, transitionTime, transitionTimeFactor, transitionTimeExponent) end + +---Runs Dolly Camera +--- +---@param runtime number in milliseconds +---@return nil +function Spring.RunDollyCamera(runtime) end + +---Pause Dolly Camera +--- +---@param fraction number fraction of the total runtime to pause at, 0 to 1 inclusive. A null value pauses at current percent +---@return nil +function Spring.PauseDollyCamera(fraction) end + +---Resume Dolly Camera +--- +---@return nil +function Spring.ResumeDollyCamera() end + +---Sets Dolly Camera Position +--- +---@param x number +---@param y number +---@param z number +---@return nil +function Spring.SetDollyCameraPosition(x, y, z) end + +---Sets Dolly Camera movement Curve +--- +---@param degree number +---@param cpoints table NURBS control point positions {{x,y,z,weight}, ...} +---@param knots table +---@return nil +function Spring.SetDollyCameraCurve(degree, cpoints, knots) end + +---Sets Dolly Camera movement mode +--- +---@param mode number 1 static position, 2 nurbs curve +---@return nil +function Spring.SetDollyCameraMode(mode) end + +---Sets Dolly Camera movement curve to world relative or look target relative +--- +---@param relativeMode number 1 world, 2 look target +---@return nil +function Spring.SetDollyCameraRelativeMode(relativeMode) end + +---Sets Dolly Camera Look Curve +--- +---@param degree number +---@param cpoints table NURBS control point positions {{x,y,z,weight}, ...} +---@param knots table +---@return nil +function Spring.SetDollyCameraLookCurve(degree, cpoints, knots) end + +---Sets Dolly Camera Look Position +--- +---@param x number +---@param y number +---@param z number +---@return nil +function Spring.SetDollyCameraLookPosition(x, y, z) end + +---Sets target unit for Dolly Camera to look towards +--- +---@param unitID number the unit to look at +---@return nil +function Spring.SetDollyCameraLookUnit(unitID) end + +---Unit Selection +--- +---@section unit_selection + +---Selects a single unit +--- +---@param unitID number or nil +---@param append boolean? (Default: false) append to current selection +---@return nil +function Spring.SelectUnit(unitID, append) end + +---@param unitID number +---@return nil +function Spring.DeselectUnit(unitID) end + +---Deselects multiple units. +--- +---@param unitIDs table Table with unit IDs as value. +---@return nil +function Spring.DeselectUnitArray(unitIDs) end + +---Deselects multiple units. +--- +---@param unitMap table Table with unit IDs as keys. +---@return nil +function Spring.DeselectUnitMap(unitMap) end + +---Selects multiple units, or appends to selection. Accepts a table with unitIDs as values +--- +---@param unitMap table Table with unit IDs as values. +---@param append boolean? (Default: false) append to current selection +---@return nil +function Spring.SelectUnitArray(unitMap, append) end + +---Selects multiple units, or appends to selection. Accepts a table with unitIDs as keys +--- +---@param unitMap table Table with unit IDs as keys. +---@param append boolean? (Default: false) append to current selection +---@return nil +function Spring.SelectUnitMap(unitMap, append) end + +---Lighting +--- +---@section lighting + +---Parameters for lighting +--- +---@class LightParams +---@field position { px: number, py: number, pz: number } +---@field direction { dx: number, dy: number, dz: number } +---@field ambientColor { red: number, green: number, blue: number } +---@field diffuseColor { red: number, green: number, blue: number } +---@field specularColor { red: number, green: number, blue: number } +---@field intensityWeight { ambientWeight: number, diffuseWeight: number, specularWeight: number } +---@field ambientDecayRate { ambientRedDecay: number, ambientGreenDecay: number, ambientBlueDecay: number } +---Per-frame decay of `ambientColor` (spread over TTL frames) +---@field diffuseDecayRate { diffuseRedDecay: number, diffuseGreenDecay: number, diffuseBlueDecay: number } +---Per-frame decay of `diffuseColor` (spread over TTL frames) +---@field specularDecayRate { specularRedDecay: number, specularGreenDecay: number, specularBlueDecay: number } +---Per-frame decay of `specularColor` (spread over TTL frames) +---@field decayFunctionType { ambientDecayType: number, diffuseDecayType: number, specularDecayType: number } +---If value is `0.0` then the `*DecayRate` values will be interpreted as linear, otherwise exponential. +---@field radius number +---@field fov number +---@field ttl number +---@field priority number +---@field ignoreLOS boolean +local LightParams = {} + +--- +---requires MaxDynamicMapLights > 0 +--- +---@param lightParams LightParams +---@return integer lightHandle +function Spring.AddMapLight(lightParams) end + +--- +---requires MaxDynamicMapLights > 0 +--- +---@param lightParams LightParams +---@return number lightHandle +function Spring.AddModelLight(lightParams) end + +---@param lightHandle number +---@param lightParams LightParams +---@return boolean success +function Spring.UpdateMapLight(lightHandle, lightParams) end + +---@param lightHandle number +---@param lightParams LightParams +---@return boolean success +function Spring.UpdateModelLight(lightHandle, lightParams) end + +function Spring.AddLightTrackingTarget() end + +---Set a map-illuminating light to start/stop tracking the position of a moving object (unit or projectile) +--- +---@param lightHandle number +---@param unitOrProjectileID number +---@param enableTracking boolean +---@param unitOrProjectile boolean +---@return boolean success +function Spring.SetMapLightTrackingState(lightHandle, unitOrProjectileID, enableTracking, unitOrProjectile) end + +---Set a model-illuminating light to start/stop tracking the position of a moving object (unit or projectile) +--- +---@param lightHandle number +---@param unitOrProjectileID number +---@param enableTracking boolean +---@param unitOrProjectile boolean +---@return boolean success +function Spring.SetModelLightTrackingState(lightHandle, unitOrProjectileID, enableTracking, unitOrProjectile) end + +---Ingame Console +--- +---@section console + +--- +---The ID's must refer to valid programs returned by `gl.CreateShader`. +---Passing in a value of 0 will cause the respective shader to revert back to its engine default. +---Custom map shaders that declare a uniform ivec2 named "texSquare" can sample from the default diffuse texture(s), which are always bound to TU 0. +--- +---@param standardShaderID number +---@param deferredShaderID number +---@return nil +function Spring.SetMapShader(standardShaderID, deferredShaderID) end + +---@param texSqrX number +---@param texSqrY number +---@param luaTexName string +---@return boolean success +function Spring.SetMapSquareTexture(texSqrX, texSqrY, luaTexName) end + +---@param texType string +---@param texName string +---@return boolean success +---@usage Spring.SetMapShadingTexture("$ssmf_specular", "name_of_my_shiny_texture") +function Spring.SetMapShadingTexture(texType, texName) end + +---@param texName string +---@return nil +function Spring.SetSkyBoxTexture(texName) end + +---Unit custom rendering +--- +---@section unitcustomrendering + +---@param unitID number +---@param noDraw boolean +---@return nil +function Spring.SetUnitNoDraw(unitID, noDraw) end + +---@param unitID number +---@param drawMask number +---@return nil +function Spring.SetUnitEngineDrawMask(unitID, drawMask) end + +---@param unitID number +---@param alwaysUpdateMatrix boolean +---@return nil +function Spring.SetUnitAlwaysUpdateMatrix(unitID, alwaysUpdateMatrix) end + +---@param unitID number +---@param unitNoMinimap boolean +---@return nil +function Spring.SetUnitNoMinimap(unitID, unitNoMinimap) end + +---@param unitID number +---@param unitNoSelect boolean whether unit can be selected or not +---@return nil +function Spring.SetUnitNoSelect(unitID, unitNoSelect) end + +---@param unitID number +---@param unitLeaveTracks boolean whether unit leaves tracks on movement +---@return nil +function Spring.SetUnitLeaveTracks(unitID, unitLeaveTracks) end + +---@param unitID number +---@param featureID number +---@param scaleX number +---@param scaleY number +---@param scaleZ number +---@param offsetX number +---@param offsetY number +---@param offsetZ number +---@param vType number +---@param tType number +---@param Axis number +---@return nil +function Spring.SetUnitSelectionVolumeData(unitID, featureID, scaleX, scaleY, scaleZ, offsetX, offsetY, offsetZ, vType, tType, Axis) end + +---Features +--- +---@section features + +---@param featureID number +---@param noDraw boolean +---@return nil +function Spring.SetFeatureNoDraw(featureID, noDraw) end + +---@param featureID number +---@param engineDrawMask number +---@return nil +function Spring.SetFeatureEngineDrawMask(featureID, engineDrawMask) end + +---@param featureID number +---@param alwaysUpdateMat number +---@return nil +function Spring.SetFeatureAlwaysUpdateMatrix(featureID, alwaysUpdateMat) end + +---Control whether a feature will fade or not when zoomed out. +--- +---@param featureID number +---@param allow boolean +---@return nil +function Spring.SetFeatureFade(featureID, allow) end + +---@param featureID number +---@param scaleX number +---@param scaleY number +---@param scaleZ number +---@param offsetX number +---@param offsetY number +---@param offsetZ number +---@param vType number +---@param tType number +---@param Axis number +---@return nil +function Spring.SetFeatureSelectionVolumeData(featureID, scaleX, scaleY, scaleZ, offsetX, offsetY, offsetZ, vType, tType, Axis) end + +---Unit Icons +--- +---@section unit_icons + +---@param iconName string +---@param texFile string +---@param size number? +---@param dist number? +---@param radAdjust number? +---@return boolean added +function Spring.AddUnitIcon(iconName, texFile, size, dist, radAdjust) end + +---@param iconName string +---@return boolean? freed +function Spring.FreeUnitIcon(iconName) end + +---@param unitID number +---@param drawIcon boolean +---@return nil +function Spring.UnitIconSetDraw(unitID, drawIcon) end + +---@param unitDefID number +---@param iconName string +---@return nil +function Spring.SetUnitDefIcon(unitDefID, iconName) end + +---@param unitDefID number +---@param image string luaTexture|texFile +---@return nil +function Spring.SetUnitDefImage(unitDefID, image) end + +---Virtual File System +--- +---@section vfs +--- +---Prefer using `VFS` whenever possible + +---@param modfile string +---@return boolean extracted +function Spring.ExtractModArchiveFile(modfile) end + +---@param path string +---@return boolean? dirCreated +function Spring.CreateDir(path) end + +---@param narr number hint for count of array elements +---@param nrec number hint for count of record elements +---@return table +function Spring.AllocateTable(narr, nrec) end + +---GUI +--- +---@section gui + +---@param action string +---@param actionExtra string? +---@return boolean? commandSet +function Spring.SetActiveCommand(action, actionExtra) end + +---@param cmdIndex number +---@param button number? (Default: 1) +---@param leftClick boolean? +---@param rightClick boolean? +---@param alt boolean? +---@param ctrl boolean? +---@param meta boolean? +---@param shift boolean? +---@return boolean? commandSet +function Spring.SetActiveCommand(cmdIndex, button, leftClick, rightClick, alt, ctrl, meta, shift) end + +---@param config string +---@return nil +function Spring.LoadCmdColorsConfig(config) end + +---@param config string +---@return nil +function Spring.LoadCtrlPanelConfig(config) end + +---@return nil +function Spring.ForceLayoutUpdate() end + +---Disables the "Selected Units x" box in the GUI. +--- +---@param enable boolean +---@return nil +function Spring.SetDrawSelectionInfo(enable) end + +---@param state boolean +---@return nil +function Spring.SetBoxSelectionByEngine(state) end + +---@param teamID number +---@param r number +---@param g number +---@param b number +---@return nil +function Spring.SetTeamColor(teamID, r, g, b) end + +---Changes/creates the cursor of a single CursorCmd. +--- +---@param cmdName string +---@param iconFileName string not the full filename, instead it is like this: +---Wanted filename: Anims/cursorattack_0.bmp +---=> iconFileName: cursorattack +---@param overwrite boolean? (Default: true) +---@param hotSpotTopLeft boolean? (Default: false) +---@return boolean? assigned +function Spring.AssignMouseCursor(cmdName, iconFileName, overwrite, hotSpotTopLeft) end + +---Mass replace all occurrences of the cursor in all CursorCmds. +--- +---@param oldFileName string +---@param newFileName string +---@param hotSpotTopLeft boolean? (Default: false) +---@return boolean? assigned +function Spring.ReplaceMouseCursor(oldFileName, newFileName, hotSpotTopLeft) end + +---Register your custom cmd so it gets visible in the unit's cmd queue +--- +---@param cmdID number +---@tparam +---@return boolean? assigned +function Spring.SetCustomCommandDrawData(cmdID) end + +---Mouse +--- +---@section mouse + +---@param x number +---@param y number +---@return nil +function Spring.WarpMouse(x, y) end + +---@param cursorName string +---@param cursorScale number? (Default: 1.0) +---@return nil +function Spring.SetMouseCursor(cursorName, cursorScale) end + +---LOS Colors +--- +---@section loscolors + +---@param always table {r,g,b} +---@param LOS table = {r,g,b} +---@param radar table = {r,g,b} +---@param jam table = {r,g,b} +---@param radar2 table = {r,g,b} +---@return nil +function Spring.SetLosViewColors(always, LOS, radar, jam, radar2) end + +---@param rotVal number? (Default: 0) in degrees +---@param rotVel number? (Default: 0) in degrees +---@param rotAcc number? (Default: 0) in degrees +---@param rotValRng number? (Default: 0) in degrees +---@param rotVelRng number? (Default: 0) in degrees +---@param rotAccRng number? (Default: 0) in degrees +---@return nil +function Spring.SetNanoProjectileParams(rotVal, rotVel, rotAcc, rotValRng, rotVelRng, rotAccRng) end + +---Engine Config +--- +---@section engineconfig +--- +---The following functions read the engine configs saved in `Springsettings.cfg`, a version-ed instance of these or a custom file supplied on the command line. + +---@param name string +---@param value number +---@param useOverlay boolean? (Default: false) the value will only be set in memory, and not be restored for the next game. +---@return nil +function Spring.SetConfigInt(name, value, useOverlay) end + +---@param name string +---@param value number +---@param useOverla boolean? (Default: false) the value will only be set in memory, and not be restored for the next game.y +---@return nil +function Spring.SetConfigFloat(name, value, useOverla) end + +---@param name string +---@param value number +---@param useOverlay boolean? (Default: false) the value will only be set in memory, and not be restored for the next game. +---@return nil +function Spring.SetConfigString(name, value, useOverlay) end + +---Closes the application +--- +---@return nil +function Spring.Quit() end + +---Unit Group +--- +---@section unitgroup + +---@param unitID number +---@param groupID number the group number to be assigned, or -1 for deassignment +---@return nil +function Spring.SetUnitGroup(unitID, groupID) end + +---Give Order +--- +---@section giveorder + +---Command Options params +--- +---@class cmdOpts +--- +---Can be specified as a table, or as an array containing any of the keys +---below. +---@field right boolean Right mouse key pressed +---@field alt boolean Alt key pressed +---@field ctrl boolean Ctrl key pressed +---@field shift boolean Shift key pressed +---@field meta boolean Meta (windows/mac/mod4) key pressed +local cmdOpts = {} + +---@param cmdID number +---@param params table +---@param options cmdOpts +---@return nil|true +function Spring.GiveOrder(cmdID, params, options) end + +---@param unitID number +---@param cmdID number +---@param params table +---@param options cmdOpts +---@return nil|true +function Spring.GiveOrderToUnit(unitID, cmdID, params, options) end + +---@param unitMap table { [unitID] = arg1, ... } +---@param cmdID number +---@param params table +---@param options cmdOpts +---@return nil|true +function Spring.GiveOrderToUnitMap(unitMap, cmdID, params, options) end + +---@param unitArray number[] array of unit ids +---@param cmdID number +---@param params table +---@param options cmdOpts +---@return nil|true +function Spring.GiveOrderToUnitArray(unitArray, cmdID, params, options) end + +---@param unitID number +---@param cmdArray Command[] +---@return boolean ordersGiven +function Spring.GiveOrderArrayToUnit(unitID, cmdArray) end + +---@param unitMap table { [unitID] = arg1, ... } +---@param cmdArray Command[] +---@return boolean ordersGiven +function Spring.GiveOrderArrayToUnitMap(unitMap, cmdArray) end + +---@param unitArray number[] array of unit ids +---@param cmdArray Command[] +---@tparam When true, assign commands according to index between units and cmds arrays. +--- +---If len(unitArray) < len(cmdArray) only the first len(unitArray) commands +---will be assigned, and vice-versa. +---@return nil|boolean +function Spring.GiveOrderArrayToUnitArray(unitArray, cmdArray) end + +---@param spacing number +---@return nil +function Spring.SetBuildSpacing(spacing) end + +---@param facing number +---@return nil +function Spring.SetBuildFacing(facing) end + +---UI +--- +---@section ui +---Very important! (allows synced inter-lua-enviroment communications) + +---@param message string +---@param mode string "s"/"specs" | "a"/"allies" +---@return nil +function Spring.SendLuaUIMsg(message, mode) end + +---@param message string +---@return nil +function Spring.SendLuaGaiaMsg(message) end + +---@param message string +---@return nil +function Spring.SendLuaRulesMsg(message) end + +---@param msg string +function Spring.SendLuaMenuMsg(msg) end + +---Sharing +--- +---@section sharing + +---@param resource string metal | energy +---@param shareLevel number +---@return nil +function Spring.SetShareLevel(resource, shareLevel) end + +---@param teamID number +---@param units string +---@return nil +function Spring.ShareResources(teamID, units) end + +---@param teamID number +---@param resource string metal | energy +---@param amount number +---@return nil +function Spring.ShareResources(teamID, resource, amount) end + +---UI +--- +---@section ui + +---@param x number +---@param y number +---@param z number +---@return nil +function Spring.SetLastMessagePosition(x, y, z) end + +---Markers +--- +---@section markers + +---@param x number +---@param y number +---@param z number +---@param text string? (Default: "") +---@param localOnly boolean? +---@return nil +function Spring.MarkerAddPoint(x, y, z, text, localOnly) end + +---@param x1 number +---@param y1 number +---@param z1 number +---@param x2 number +---@param y2 number +---@param z2 number +---@param localOnly boolean? (Default: false) +---@param playerId number? +---@return nil +function Spring.MarkerAddLine(x1, y1, z1, x2, y2, z2, localOnly, playerId) end + +--- +---Issue an erase command for markers on the map. +--- +---@param x number +---@param y number +---@param z number +---@param unused nil This argument is ignored. +---@param localOnly boolean? (Default: false) do not issue a network message, erase only for the current player +---@param playerId number? when not specified it uses the issuer playerId +---@param alwaysErase boolean? (Default: false) erase any marker when `localOnly` and current player is spectating. Allows spectators to erase players markers locally +---@return nil +function Spring.MarkerErasePosition(x, y, z, unused, localOnly, playerId, alwaysErase) end + +---Sun +--- +---@section sun + +---@class AtmosphereParams +---@field fogStart number +---@field fogEnd number +---@field sunColor rgba +---@field skyColor rgba +---@field cloudColor rgba +local AtmosphereParams = {} + +---It can be used to modify the following atmosphere parameters +--- +---Usage: +---```lua +---Spring.SetAtmosphere({ fogStart = 0, fogEnd = 0.5, fogColor = { 0.7, 0.2, 0.2, 1 }}) +---``` +--- +---@param params AtmosphereParams +function Spring.SetAtmosphere(params) end + +---@param dirX number +---@param dirY number +---@param dirZ number +---@param intensity number? (Default: `1.0`) +---@return nil +function Spring.SetSunDirection(dirX, dirY, dirZ, intensity) end + +---Modify sun lighting parameters. +--- +---```lua +---Spring.SetSunLighting({groundAmbientColor = {1, 0.1, 1}, groundDiffuseColor = {1, 0.1, 1} }) +---``` +--- +---@param params { groundAmbientColor: rgb, groundDiffuseColor: rgb } +function Spring.SetSunLighting(params) end + +---Map rendering params +--- +---@class MapRenderingParams +---@field splatTexMults rgba +---@field splatTexScales rgba +---@field voidWater boolean +---@field voidGround boolean +---@field splatDetailNormalDiffuseAlpha boolean +local MapRenderingParams = {} + +---Allows to change map rendering params at runtime. +--- +---@param params MapRenderingParams +---@return nil +function Spring.SetMapRenderingParams(params) end + +---@param normal boolean? (Default: true) +---@param shadow boolean? (Default: false) +---@return boolean updated +function Spring.ForceTesselationUpdate(normal, shadow) end + +---AI +--- +---@section ai + +---@param aiTeam number +---@param message string +---@return boolean? ai_processed +function Spring.SendSkirmishAIMessage(aiTeam, message) end + +---Developers +--- +---@section developers + +---@param sectionName string +---@param logLevel ?string|number +---@return nil +function Spring.SetLogSectionFilterLevel(sectionName, logLevel) end + +---@int +---@int +---@int +---@int +---@param minLoopRunTime number? +---@param maxLoopRunTime number? +---@param baseRunTimeMult number? +---@param baseMemLoadMult number? +---@return nil +function Spring.GarbageCollectCtrl(minLoopRunTime, maxLoopRunTime, baseRunTimeMult, baseMemLoadMult) end + +---@param drawSky boolean +---@return nil +function Spring.SetDrawSky(drawSky) end + +---@param drawWater boolean +---@return nil +function Spring.SetDrawWater(drawWater) end + +---@param drawGround boolean +---@return nil +function Spring.SetDrawGround(drawGround) end + +---@param drawGroundDeferred boolean +---@param drawGroundForward boolean? allows disabling of the forward pass +---treturn nil +function Spring.SetDrawGroundDeferred(drawGroundDeferred, drawGroundForward) end + +---@param drawUnitsDeferred boolean +---@param drawFeaturesDeferred boolean +---@param drawUnitsForward boolean? allows disabling of the respective forward passes +---@param drawFeaturesForward boolean? allows disabling of the respective forward passes +---@return nil +function Spring.SetDrawModelsDeferred(drawUnitsDeferred, drawFeaturesDeferred, drawUnitsForward, drawFeaturesForward) end + +---This doesn't actually record the game in any way, it just regulates the framerate and interpolations. +--- +---@param allowCaptureMode boolean +---@return nil +function Spring.SetVideoCapturingMode(allowCaptureMode) end + +---@param timeOffset boolean +---@return nil +function Spring.SetVideoCapturingTimeOffset(timeOffset) end + +---Water params +--- +---@class WaterParams +---@field absorb rgb +---@field baseColor rgb +---@field minColor rgb +---@field surfaceColor rgb +---@field diffuseColor rgb +---@field specularColor rgb +---@field planeColor rgb +---@field texture string file +---@field foamTexture string file +---@field normalTexture string file +---@field damage number +---@field repeatX number +---@field repeatY number +---@field surfaceAlpha number +---@field ambientFactor number +---@field diffuseFactor number +---@field specularFactor number +---@field specularPower number +---@field fresnelMin number +---@field fresnelMax number +---@field fresnelPower number +---@field reflectionDistortion number +---@field blurBase number +---@field blurExponent number +---@field perlinStartFreq number +---@field perlinLacunarity number +---@field perlinAmplitude number +---@field windSpeed number +---@field waveOffsetFactor number +---@field waveLength number +---@field waveFoamDistortion number +---@field waveFoamIntensity number +---@field causticsResolution number +---@field causticsStrength number +---@field numTiles integer +---@field shoreWaves boolean +---@field forceRendering boolean +---@field hasWaterPlane boolean +local WaterParams = {} + +---Does not need cheating enabled. +--- +---Allows to change water params (mostly `BumpWater` ones) at runtime. You may +---want to set `BumpWaterUseUniforms` in your `springrc` to 1, then you don't even +---need to restart `BumpWater` via `/water 4`. +--- +---@param waterParams WaterParams +---@return nil +function Spring.SetWaterParams(waterParams) end + +---Preload +--- +---@section preload + +--- +---Allow the engine to load the unit's model (and texture) in a background thread. +---Wreckages and buildOptions of a unit are automatically preloaded. +--- +---@param unitDefID number +---@return nil +function Spring.PreloadUnitDefModel(unitDefID) end + +---@param featureDefID number +---@return nil +function Spring.PreloadFeatureDefModel(featureDefID) end + +---@param name string +---@return nil +function Spring.PreloadSoundItem(name) end + +---@param modelName string +---@return boolean? success +function Spring.LoadModelTextures(modelName) end + +---Decals +--- +---@section decals + +---@return nil|number decalID +function Spring.CreateGroundDecal() end + +---@param decalID number +---@return boolean delSuccess +function Spring.DestroyGroundDecal(decalID) end + +---@param decalID number +---@param midPosX number? (Default: currMidPosX) +---@param midPosZ number? (Default: currMidPosZ) +---@param sizeX number? (Default: currSizeX) +---@param sizeZ number? (Default: currSizeZ) +---@param projCubeHeight number? (Default: calculateProjCubeHeight) +---@return boolean decalSet +function Spring.SetGroundDecalPosAndDims(decalID, midPosX, midPosZ, sizeX, sizeZ, projCubeHeight) end + +---@class xz +---@field x number +---@field y number +local xz = {} + +--- +---Use for non-rectangular decals +--- +---@param decalID integer +---@param posTL xz? (Default: currPosTL) +---@param posTR xz? (Default: currPosTR) +---@param posBR xz? (Default: currPosBR) +---@param posBL xz? (Default: currPosBL) +---@param projCubeHeight number? (Default: calculateProjCubeHeight) +---@return boolean decalSet +function Spring.SetGroundDecalQuadPosAndHeight(decalID, posTL, posTR, posBR, posBL, projCubeHeight) end + +---@param decalID number +---@param rot number? (Default: random) in radians +---@return boolean decalSet +function Spring.SetGroundDecalRotation(decalID, rot) end + +---@param decalID number +---@param textureName string The texture has to be on the atlas which seems to mean it's defined as an explosion, unit tracks, or building plate decal on some unit already (no arbitrary textures) +---@param isMainTex boolean? (Default: true) If false, it sets the normals/glow map +---@return nil|boolean decalSet +function Spring.SetGroundDecalTexture(decalID, textureName, isMainTex) end + +---@param decalID number +---@param texWrapDistance number? (Default: currTexWrapDistance) if non-zero sets the mode to repeat the texture along the left-right direction of the decal every texWrapFactor elmos +---@param texTraveledDistance number? (Default: currTexTraveledDistance) shifts the texture repetition defined by texWrapFactor so the texture of a next line in the continuous multiline can start where the previous finished. For that it should collect all elmo lengths of the previously set multiline segments. +---@return nil|boolean decalSet +function Spring.SetGroundDecalTextureParams(decalID, texWrapDistance, texTraveledDistance) end + +---@param decalID number +---@param alpha number? (Default: currAlpha) Between 0 and 1 +---@param alphaFalloff number? (Default: currAlphaFalloff) Between 0 and 1, per second +---@return boolean decalSet +function Spring.SetGroundDecalAlpha(decalID, alpha, alphaFalloff) end + +--- +---Sets projection cube normal to orient in 3D space. +---In case the normal (0,0,0) then normal is picked from the terrain +--- +---@param decalID number +---@param normalX number? (Default: 0) +---@param normalY number? (Default: 0) +---@param normalZ number? (Default: 0) +---@return boolean decalSet +function Spring.SetGroundDecalNormal(decalID, normalX, normalY, normalZ) end + +--- +---Sets the tint of the ground decal. Color = 2 * textureColor * tintColor +---Respectively a color of (0.5, 0.5, 0.5, 0.5) is effectively no tint +--- +---@param decalID number +---@param tintColR number? (Default: curTintColR) +---@param tintColG number? (Default: curTintColG) +---@param tintColB number? (Default: curTintColB) +---@param tintColA number? (Default: curTintColA) +---@return boolean decalSet +function Spring.SetGroundDecalTint(decalID, tintColR, tintColG, tintColB, tintColA) end + +--- +---Sets varios secondary parameters of a decal +--- +---@param decalID number +---@param dotElimExp number? (Default: curValue) pow(max(dot(decalProjVector, SurfaceNormal), 0.0), dotElimExp), used to reduce decal artifacts on surfaces non-collinear with the projection vector +---@param refHeight number? (Default: curValue) +---@param minHeight number? (Default: curValue) +---@param maxHeight number? (Default: curValue) +---@param forceHeightMode number? (Default: curValue) in case forceHeightMode==1.0 ==> force relative height: midPoint.y = refHeight + clamp(midPoint.y - refHeight, minHeight); forceHeightMode==2.0 ==> force absolute height: midPoint.y = midPoint.y, clamp(midPoint.y, minHeight, maxHeight); other forceHeightMode values do not enforce the height of the center position +---@return boolean decalSet +function Spring.SetGroundDecalMisc(decalID, dotElimExp, refHeight, minHeight, maxHeight, forceHeightMode) end + +--- +---Use separate min and max for "gradient" style decals such as tank tracks +--- +---@param decalID number +---@param creationFrameMin number? (Default: currCreationFrameMin) +---@param creationFrameMax number? (Default: currCreationFrameMax) +---@return boolean decalSet +function Spring.SetGroundDecalCreationFrame(decalID, creationFrameMin, creationFrameMax) end + +---SDL Text +--- +---@section sdltext + +---@param x number +---@param y number +---@param width number +---@param height number +---@return nil +function Spring.SDLSetTextInputRect(x, y, width, height) end + +---@return nil +function Spring.SDLStartTextInput() end + +---@return nil +function Spring.SDLStopTextInput() end + +---Window Management +--- +---@section window + +---@param displayIndex number +---@param winRelPosX number +---@param winRelPosY number +---@param winSizeX number +---@param winSizeY number +---@param fullScreen boolean +---@param borderless boolean +---@return nil +function Spring.SetWindowGeometry(displayIndex, winRelPosX, winRelPosY, winSizeX, winSizeY, fullScreen, borderless) end + +---@return boolean minimized +function Spring.SetWindowMinimized() end + +---@return boolean maximized +function Spring.SetWindowMaximized() end + +---Misc +--- +---@section misc + +---@param startScript string the CONTENT of the script.txt spring should use to start. +---@return nil +function Spring.Reload(startScript) end + +--- +---If this call returns, something went wrong +--- +---@param commandline_args string commandline arguments passed to spring executable. +---@param startScript string +---@return nil +function Spring.Restart(commandline_args, startScript) end + +---Launches a new Spring instance without terminating the existing one. +--- +---If this call returns, something went wrong +--- +---@param commandline_args string commandline arguments passed to spring executable. +---@param startScript string the CONTENT of the script.txt spring should use to start (if empty, no start-script is added, you can still point spring to your custom script.txt when you add the file-path to commandline_args. +---@return nil +function Spring.Start(commandline_args, startScript) end + +---Sets the icon for the process which is seen in the OS task-bar and other places (default: spring-logo). +--- +---Note: has to be 24bit or 32bit. +---Note: on windows, it has to be 32x32 pixels in size (recommended for cross-platform) +---Note: *.bmp images have to be in BGR format (default for m$ ones). +---Note: *.ico images are not supported. +--- +---@param iconFileName string +---@return nil +function Spring.SetWMIcon(iconFileName) end + +---Sets the window title for the process (default: "Spring "). +--- +---The shortTitle is displayed in the OS task-bar (default: "Spring "). +--- +---NOTE: shortTitle is only ever possibly used under X11 (Linux & OS X), but not with QT (KDE) and never under Windows. +--- +---@param title string +---@param titleShort string? (Default: title) +---@return nil +function SetWMCaption(title, titleShort) end + +---@param threadName string? (Default: main) +---@return nil +function Spring.ClearWatchDogTimer(threadName) end + +---@param text string +---@return nil +function Spring.SetClipboard(text) end + +---Relinquish control of the game loading thread and OpenGL context back to the UI (LuaIntro). +--- +---Should be called after each widget/unsynced gadget is loaded in widget/gadget handler. Use it to draw screen updates and process windows events. +--- +---@usage local wantYield = Spring.Yield and Spring.Yield() -- nil check: not present in synced +---for wupget in pairs(wupgetsToLoad) do +---loadWupget(wupget) +---wantYield = wantYield and Spring.Yield() +---end +---@return boolean when true caller should continue calling `Spring.Yield` during the widgets/gadgets load, when false it shouldn't call it any longer. +function Spring.Yield() end \ No newline at end of file diff --git a/library/LuaUnsyncedRead.lua b/library/LuaUnsyncedRead.lua new file mode 100644 index 00000000000..c627ccd2193 --- /dev/null +++ b/library/LuaUnsyncedRead.lua @@ -0,0 +1,1033 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaUnsyncedRead.cpp +--- +---@meta + +---Callouts to get state +--- +---@see rts/Lua/LuaUnsyncedRead.cpp + +---Replay +--- +---@section replay + +---@return boolean? isReplay +function Spring.IsReplay() end + +---@return number? timeInSeconds +function Spring.GetReplayLength() end + +---Game/Menu Name +--- +---@section gamename + +---@return string name +function Spring.GetGameName() end + +---@return string name name .. version from Modinfo.lua. E.g. "Spring: 1944 test-5640-ac2d15b". +function Spring.GetMenuName() end + +---Profiling +--- +---@section profiling + +---@param profilerName string +---@param frameData boolean? (Default: false) +---@return number total in ms +---@return number current in ms +---@return number max_dt +---@return number time_pct +---@return number peak_pct +---@return table? frameData Table where key is the frame index and value is duration. +function Spring.GetProfilerTimeRecord(profilerName, frameData) end + +---@return string[] profilerNames +function Spring.GetProfilerRecordNames() end + +---@return number luaHandleAllocedMem in kilobytes +---@return number luaHandleNumAllocs divided by 1000 +---@return number luaGlobalAllocedMem in kilobytes +---@return number luaGlobalNumAllocs divided by 1000 +---@return number luaUnsyncedGlobalAllocedMem in kilobytes +---@return number luaUnsyncedGlobalNumAllocs divided by 1000 +---@return number luaSyncedGlobalAllocedMem in kilobytes +---@return number luaSyncedGlobalNumAllocs divided by 1000 +function Spring.GetLuaMemUsage() end + +---@return number usedMem in MB +---@return number availableMem in MB +function Spring.GetVidMemUsage() end + +---Get a timer with millisecond resolution +--- +---@return integer +function Spring.GetTimer() end + +---Get a timer with microsecond resolution +--- +---@return integer +function Spring.GetTimerMicros() end + +---Get a timer for the start of the frame +--- +---This should give better results for camera interpolations +--- +---@param lastFrameTime boolean? (Default: false) whether to use last frame time instead of last frame start +---@return integer +function Spring.GetFrameTimer(lastFrameTime) end + +---@param endTimer integer +---@param startTimer integer +---@param returnMs boolean? (Default: false) whether to return `timeAmount` in milliseconds as opposed to seconds +---@param fromMicroSecs boolean? (Default: false) whether timers are in microseconds instead of milliseconds +---@return number timeAmount +function Spring.DiffTimers(endTimer, startTimer, returnMs, fromMicroSecs) end + +---Screen/Rendering Info +--- +---@section screeninfo + +---@return number numDisplays as returned by `SDL_GetNumVideoDisplays` +function Spring.GetNumDisplays() end + +---Get main view geometry (map and game rendering) +--- +---@return number viewSizeX in px +---@return number viewSizeY in px +---@return number viewPosX offset from leftmost screen left border in px +---@return number viewPosY offset from bottommost screen bottom border in px +function Spring.GetViewGeometry() end + +---Get dual view geometry (minimap when enabled) +--- +---@return number dualViewSizeX in px +---@return number dualViewSizeY in px +---@return number dualViewPosX offset from leftmost screen left border in px +---@return number dualViewPosY offset from bottommost screen bottom border in px +function Spring.GetDualViewGeometry() end + +---Get main window geometry +--- +---@return number winSizeX in px +---@return number winSizeY in px +---@return number winPosX in px +---@return number winPosY in px +---@return number windowBorderTop in px +---@return number windowBorderLeft in px +---@return number windowBorderBottom in px +---@return number windowBorderRight in px +function Spring.GetWindowGeometry() end + +---Get main window display mode +--- +---@return number width in px +---@return number height in px +---@return number bits per pixel +---@return number refresh rate in Hz +function Spring.GetWindowDisplayMode() end + +---Get screen geometry +--- +---@param displayIndex number? (Default: -1) +---@param queryUsable boolean? (Default: false) +---@return number screenSizeX in px +---@return number screenSizeY in px +---@return number screenPosX in px +---@return number screenPosY in px +---@return number windowBorderTop in px +---@return number windowBorderLeft in px +---@return number windowBorderBottom in px +---@return number windowBorderRight in px +---@return number? screenUsableSizeX in px +---@return number? screenUsableSizeY in px +---@return number? screenUsablePosX in px +---@return number? screenUsablePosY in px +function Spring.GetScreenGeometry(displayIndex, queryUsable) end + +---Get minimap geometry +--- +---@return number minimapPosX in px +---@return number minimapPosY in px +---@return number minimapSizeX in px +---@return number minimapSizeY in px +---@return boolean minimized +---@return boolean maximized +function Spring.GetMiniMapGeometry() end + +---Get minimap rotation +--- +---@return number amount in radians +function Spring.GetMiniMapRotation() end + +---@return string|false position "left"|"right" when dual screen is enabled, false when not +function Spring.GetMiniMapDualScreen() end + +---Get vertices from currently active selection box +--- +---Returns nil when selection box is inactive +--- +---@return number? left +---@return number? top +---@return number? right +---@return number? bottom +---@see Spring.GetUnitsInScreenRectangle +function Spring.GetSelectionBox() end + +---@return boolean +function Spring.GetDrawSelectionInfo() end + +---@param x number +---@param y number +---@return boolean isAbove +function Spring.IsAboveMiniMap(x, y) end + +---@return number low_16bit +---@return number high_16bit +function Spring.GetDrawFrame() end + +--- +---Ideally, when running 30hz sim, and 60hz rendering, the draw frames should +---have and offset of either 0.0 frames, or 0.5 frames. +--- +---When draw frames are not integer multiples of sim frames, some interpolation +---happens, and this timeoffset shows how far along it is. +--- +---@return number? offset of the current draw frame from the last sim frame, expressed in fractions of a frame +function Spring.GetFrameTimeOffset() end + +---Gets game time for drawing purposes +--- +---Returns the game time, taking the interpolated draw frame into account. +--- +---@return number game time in seconds + +---@return number? lastUpdateSeconds +function Spring.GetLastUpdateSeconds() end + +---@return boolean allowRecord +function Spring.GetVideoCapturingMode() end + +---Unit attributes +--- +---@section unitattributes + +---@param unitID integer +---@return boolean? isAllied nil with unitID cannot be parsed +function Spring.IsUnitAllied(unitID) end + +---@param unitID integer +---@return boolean? isSelected nil when unitID cannot be parsed +function Spring.IsUnitSelected(unitID) end + +---@param unitID integer +---@return boolean? draw nil when unitID cannot be parsed +function Spring.GetUnitLuaDraw(unitID) end + +---@param unitID integer +---@return boolean? nil when unitID cannot be parsed +function Spring.GetUnitNoDraw(unitID) end + +---@param unitID integer +---@return boolean? nil when unitID cannot be parsed +function Spring.GetUnitEngineDrawMask(unitID) end + +---@param unitID integer +---@return boolean? nil when unitID cannot be parsed +function Spring.GetUnitAlwaysUpdateMatrix(unitID) end + +---@param unitID integer +---@return number? nil when unitID cannot be parsed +function Spring.GetUnitDrawFlag(unitID) end + +---@param unitID integer +---@return boolean? nil when unitID cannot be parsed +function Spring.GetUnitNoMinimap(unitID) end + +---@param unitID integer +---@return boolean? nil when unitID cannot be parsed +function Spring.GetUnitNoSelect(unitID) end + +---@param unitID integer +---@return boolean? drawIcon +---`true` if icon is being drawn, `nil` when unitID is invalid, otherwise `false`. +function Spring.UnitIconGetDraw(unitID) end + +---@param unitID integer +---@return number? scaleX nil when unitID cannot be parsed +---@return number scaleY +---@return number scaleZ +---@return number offsetX +---@return number offsetY +---@return number offsetZ +---@return number volumeType +---@return number useContHitTest +---@return number getPrimaryAxis +---@return boolean ignoreHits +function Spring.GetUnitSelectionVolumeData(unitID) end + +---Feature attributes +--- +---@section featureattributes + +---@param featureID integer +---@return boolean? nil when featureID cannot be parsed +function Spring.GetFeatureLuaDraw(featureID) end + +---@param featureID integer +---@return boolean? nil when featureID cannot be parsed +function Spring.GetFeatureNoDraw(featureID) end + +---@param featureID integer +---@return boolean? nil when featureID cannot be parsed +function Spring.GetFeatureEngineDrawMask(featureID) end + +---@param featureID integer +---@return boolean? nil when featureID cannot be parsed +function Spring.GetFeatureAlwaysUpdateMatrix(featureID) end + +---@param featureID integer +---@return number? nil when featureID cannot be parsed +function Spring.GetFeatureDrawFlag(featureID) end + +---@param featureID integer +---@return number? scaleX nil when unitID cannot be parsed +---@return number scaleY +---@return number scaleZ +---@return number offsetX +---@return number offsetY +---@return number offsetZ +---@return number volumeType +---@return number useContHitTest +---@return number getPrimaryAxis +---@return boolean ignoreHits +function Spring.GetFeatureSelectionVolumeData(featureID) end + +---Misc +--- +---@section misc + +---@param unitID integer +---@return number? m11 nil when unitID cannot be parsed +---@return number m12 +---@return number m13 +---@return number m14 +---@return number m21 +---@return number m22 +---@return number m23 +---@return number m24 +---@return number m31 +---@return number m32 +---@return number m33 +---@return number m34 +---@return number m41 +---@return number m42 +---@return number m43 +---@return number m44 +function Spring.GetUnitTransformMatrix(unitID) end + +---@param featureID integer +---@return number? m11 nil when featureID cannot be parsed +---@return number m12 +---@return number m13 +---@return number m14 +---@return number m21 +---@return number m22 +---@return number m23 +---@return number m24 +---@return number m31 +---@return number m32 +---@return number m33 +---@return number m34 +---@return number m41 +---@return number m42 +---@return number m43 +---@return number m44 +function Spring.GetFeatureTransformMatrix(featureID) end + +---Inview +--- +---@section inview + +---@param unitID integer +---@return boolean? inView nil when unitID cannot be parsed +function Spring.IsUnitInView(unitID) end + +---@param unitID integer +---@param radius number? unitRadius when not specified +---@param checkIcon boolean +---@return boolean? isVisible nil when unitID cannot be parsed +function Spring.IsUnitVisible(unitID, radius, checkIcon) end + +---@param unitID integer +---@return boolean? isUnitIcon nil when unitID cannot be parsed +function Spring.IsUnitIcon(unitID) end + +---@param minX number +---@param minY number +---@param minZ number +---@param maxX number +---@param maxY number +---@param maxZ number +---@return boolean inView +function Spring.IsAABBInView(minX, minY, minZ, maxX, maxY, maxZ) end + +---@param posX number +---@param posY number +---@param posZ number +---@param radius number? (Default: 0) +---@return boolean inView +function Spring.IsSphereInView(posX, posY, posZ, radius) end + +---@param unitID integer +---@param midPos boolean? (Default: false) +---@return number? x nil when unitID cannot be parsed +---@return number y +---@return number z +function Spring.GetUnitViewPosition(unitID, midPos) end + +---@param teamID integer? (Default: -1) +---@param radius number? (Default: 30) +---@param icons boolean? (Default: true) +---@return nil|number[] unitIDs +function Spring.GetVisibleUnits(teamID, radius, icons) end + +---@param teamID integer? (Default: -1) +---@param radius number? (Default: 30) +---@param icons boolean? (Default: true) +---@param geos boolean? (Default: true) +---@return nil|number[] featureIDs +function Spring.GetVisibleFeatures(teamID, radius, icons, geos) end + +---@param allyTeamID integer? (Default: -1) +---@param addSyncedProjectiles boolean? (Default: true) +---@param addWeaponProjectiles boolean? (Default: true) +---@param addPieceProjectiles boolean? (Default: true) +---@return nil|number[] projectileIDs +function Spring.GetVisibleProjectiles(allyTeamID, addSyncedProjectiles, addWeaponProjectiles, addPieceProjectiles) end + +function Spring.GetRenderUnits() end + +function Spring.GetRenderUnitsDrawFlagChanged() end + +function Spring.GetRenderFeatures() end + +function Spring.GetRenderFeaturesDrawFlagChanged() end + +---@return nil +function Spring.ClearUnitsPreviousDrawFlag() end + +---@return nil +function Spring.ClearFeaturesPreviousDrawFlag() end + +---Get units inside a rectangle area on the map +--- +---@param left number +---@param top number +---@param right number +---@param bottom number +---@param allegiance number? (Default: -1) teamID when > 0, when < 0 one of AllUnits = -1, MyUnits = -2, AllyUnits = -3, EnemyUnits = -4 +---@return nil|number[] unitIDs +function Spring.GetUnitsInScreenRectangle(left, top, right, bottom, allegiance) end + +---Get features inside a rectangle area on the map +--- +---@param left number +---@param top number +---@param right number +---@param bottom number +---@return nil|number[] featureIDs +function Spring.GetFeaturesInScreenRectangle(left, top, right, bottom) end + +---@return number playerID +function Spring.GetLocalPlayerID() end + +---@return number teamID +function Spring.GetLocalTeamID() end + +---@return number allyTeamID +function Spring.GetLocalAllyTeamID() end + +---@return boolean spectating +---@return boolean spectatingFullView +---@return boolean spectatingFullSelect +function Spring.GetSpectatingState() end + +---@return number[] unitIDs +function Spring.GetSelectedUnits() end + +---Get selected units aggregated by unitDefID +--- +---@return table where keys are unitDefIDs and values are unitIDs +---@return integer the number of unitDefIDs +function Spring.GetSelectedUnitsSorted() end + +---Get an aggregate count of selected units per unitDefID +--- +---@return table unitsCounts where keys are unitDefIDs and values are counts +---@return integer the number of unitDefIDs +function Spring.GetSelectedUnitsCounts() end + +---Returns the amount of selected units +--- +---@return number selectedUnitsCount +function Spring.GetSelectedUnitsCount() end + +---Get if selection box is handled by engine +--- +---@return boolean when true engine won't select units inside selection box when released +---@see Spring.GetSelectionBox +---@see Spring.SetBoxSelectionByEngine +function Spring.GetBoxSelectionByEngine() end + +---@return boolean +function Spring.IsGUIHidden() end + +---@return boolean shadowsLoaded +function Spring.HaveShadows() end + +---@return boolean useAdvShading +---@return boolean groundUseAdvShading +function Spring.HaveAdvShading() end + +---@return number waterRendererID +---@return string waterRendererName +---@see rts/Rendering/Env/IWater.h +function Spring.GetWaterMode() end + +---@return "normal"|"height"|"metal"|"pathTraversability"|"los" +function Spring.GetMapDrawMode() end + +---@param texSquareX number +---@param texSquareY number +---@param lodMin number +---@param luaTexName string +---@param lodMax number? (Default: lodMin) +---@return boolean? success +function Spring.GetMapSquareTexture(texSquareX, texSquareY, lodMin, luaTexName, lodMax) end + +---@return rgb always +---@return rgb LOS +---@return rgb radar +---@return rgb jam +---@return rgb radar2 +function Spring.GetLosViewColors() end + +---@return number rotVal in degrees +---@return number rotVel in degrees +---@return number rotAcc in degrees +---@return number rotValRng in degrees +---@return number rotVelRng in degrees +---@return number rotAccRng in degrees +function Spring.GetNanoProjectileParams() end + +---Get available cameras. +--- +---@return table Table where where keys are names and values are indices. +function Spring.GetCameraNames() end + +---@param useReturns false +---@return CameraState cameraState +function Spring.GetCameraState(useReturns) end + +---@param useReturns true? (Default: `true`) Return multiple values instead of a table. +---@return "ta"|"spring"|"rot"|"ov"|"free"|"fps"|"dummy" name +---@return any Fields depending on current controller mode. +function Spring.GetCameraState(useReturns) end + +---@return number posX +---@return number posY +---@return number posZ +function Spring.GetCameraPosition() end + +---@return number dirX +---@return number dirY +---@return number dirZ +function Spring.GetCameraDirection() end + +---@return number rotX in radians +---@return number rotY in radians +---@return number rotZ in radians +function Spring.GetCameraRotation() end + +---@return number vFOV +---@return number hFOV +function Spring.GetCameraFOV() end + +---@class CameraVectors +---@field forward xyz +---@field up xyz +---@field right xyz +---@field topFrustumPlane xyz +---@field botFrustumPlane xyz +---@field lftFrustumPlane xyz +---@field rgtFrustumPlane xyz +local CameraVectors = {} + +---@return CameraVectors +function Spring.GetCameraVectors() end + +---@param x number +---@param y number +---@param z number +---@return number viewPortX +---@return number viewPortY +---@return number viewPortZ +function Spring.WorldToScreenCoords(x, y, z) end + +---Get information about a ray traced from screen to world position +--- +---Extended to allow a custom plane, parameters are (0, 1, 0, D=0) where D is the offset D can be specified in the third argument (if all the bools are false) or in the seventh (as shown). +--- +---Intersection coordinates are returned in t[4],t[5],t[6] when the ray goes offmap and includeSky is true), or when no unit or feature is hit (or onlyCoords is true). +--- +---This will only work for units & objects with the default collission sphere. Per Piece collission and custom collission objects are not supported. +--- +---The unit must be selectable, to appear to a screen trace ray. +--- +---@param screenX number position on x axis in mouse coordinates (origin on left border of view) +---@param screenY number position on y axis in mouse coordinates (origin on top border of view) +---@param onlyCoords boolean? (Default: false) return only description (1st return value) and coordinates (2nd return value) +---@param useMinimap boolean? (Default: false) if position arguments are contained by minimap, use the minimap corresponding world position +---@param includeSky boolean? (Default: false) +---@param ignoreWater boolean? (Default: false) +---@param heightOffset number? (Default: 0) +---@return nil|string description of traced position +---@return nil|number|string|xyz unitID or feature, position triple when onlyCoords=true +---@return nil|number|string featureID or ground +---@return nil|xyz coords +function Spring.TraceScreenRay(screenX, screenY, onlyCoords, useMinimap, includeSky, ignoreWater, heightOffset) end + +---@param x number +---@param y number +---@return number dirX +---@return number dirY +---@return number dirZ +function Spring.GetPixelDir(x, y) end + +---@param teamID integer +---@return number? r factor from 0 to 1 +---@return number? g factor from 0 to 1 +---@return number? b factor from 0 to 1 +---@return number? a factor from 0 to 1 +function Spring.GetTeamColor(teamID) end + +---@param teamID integer +---@return number? r factor from 0 to 1 +---@return number? g factor from 0 to 1 +---@return number? b factor from 0 to 1 +---@return number? a factor from 0 to 1 +function Spring.GetTeamOrigColor(teamID) end + +---@return integer Time in seconds +function Spring.GetDrawSeconds() end + +---Sound +--- +---@section sound + +---@return number playTime +---@return number time +function Spring.GetSoundStreamTime() end + +function Spring.GetSoundEffectParams() end + +---Game Speed +--- +---@section gamespeed + +---@return number fps +function Spring.GetFPS() end + +---@return number wantedSpeedFactor +---@return number speedFactor +---@return boolean paused +function Spring.GetGameSpeed() end + +---@param maxLatency number? (Default: 500) used for `isSimLagging` return parameter +---@return boolean doneLoading +---@return boolean isSavedGame +---@return boolean isClientPaused +---@return boolean isSimLagging +function Spring.GetGameState(maxLatency) end + +---Commands +--- +---@section commands + +---@return number? cmdIndex +---@return number? cmdID +---@return number? cmdType +---@return nil|string cmdName +function Spring.GetActiveCommand() end + +---@return number? cmdIndex +---@return number? cmdID +---@return number? cmdType +---@return nil|string cmdName +function Spring.GetDefaultCommand() end + +---@return CommandDescription[] cmdDescs +function Spring.GetActiveCmdDescs() end + +---@param cmdIndex integer +---@return CommandDescription? +function Spring.GetActiveCmdDesc(cmdIndex) end + +---@param cmdID integer +---@return integer? cmdDescIndex +function Spring.GetCmdDescIndex(cmdID) end + +---@alias Facing +---| 0 # South +---| 1 # East +---| 2 # North +---| 3 # West + +---@return Facing buildFacing +function Spring.GetBuildFacing() end + +---@return number buildSpacing +function Spring.GetBuildSpacing() end + +---@return number gatherMode +function Spring.GetGatherMode() end + +---@return number activePage +---@return number maxPage +function Spring.GetActivePage() end + +---Mouse State +--- +---@section mousestate + +---@return number x +---@return number y +---@return number lmbPressed left mouse button pressed +---@return number mmbPressed middle mouse button pressed +---@return number rmbPressed right mouse button pressed +---@return boolean offscreen +---@return boolean mmbScroll +function Spring.GetMouseState() end + +---@return string cursorName +---@return number cursorScale +function Spring.GetMouseCursor() end + +---@param button number +---@return number x +---@return number y +---@return number camPosX +---@return number camPosY +---@return number camPosZ +---@return number dirX +---@return number dirY +---@return number dirZ +function Spring.GetMouseStartPosition(button) end + +---Text +--- +---@section text + +---@return string text +function Spring.GetClipboard() end + +---@return boolean +function Spring.IsUserWriting() end + +---Console +--- +---@section console + +---@return xyz[] message positions +function Spring.GetLastMessagePositions() end + +---@param maxLines number +---@return { text: string, priority: integer }[] buffer +function Spring.GetConsoleBuffer(maxLines) end + +---@return string tooltip +function Spring.GetCurrentTooltip() end + +---Key Input +--- +---@section keyinput + +---@param scanSymbol string +---@return string keyName +function Spring.GetKeyFromScanSymbol(scanSymbol) end + +---@param keyCode number +---@return boolean pressed +function Spring.GetKeyState(keyCode) end + +---@return boolean alt +---@return boolean ctrl +---@return boolean meta +---@return boolean shift +function Spring.GetModKeyState() end + +---@return table where keys are keyCodes or key names +function Spring.GetPressedKeys() end + +---@return table where keys are scanCodes or scan names +function Spring.GetPressedScans() end + +---@return number? queueKey +function Spring.GetInvertQueueKey() end + +---@param keySym string +---@return number keyCode +function Spring.GetKeyCode(keySym) end + +---@param keyCode number +---@return string keyCodeName +---@return string keyCodeDefaultName name when there are not aliases +function Spring.GetKeySymbol(keyCode) end + +---@param scanCode number +---@return string scanCodeName +---@return string scanCodeDefaultName name when there are not aliases +function Spring.GetScanSymbol(scanCode) end + +---Keybinding +--- +---Contains data about a keybinding +--- +---@class KeyBinding +---@field command string +---@field extra string +---@field boundWith string +local KeyBinding = {} + +---@param keySet1 string? filters keybindings bound to this keyset +---@param keySet2 string? OR bound to this keyset +---@return KeyBinding[] +function Spring.GetKeyBindings(keySet1, keySet2) end + +---@param actionName string +---@return string[]? hotkeys +function Spring.GetActionHotKeys(actionName) end + +---Unit Groups +--- +---@section unitgroups + +---@return nil|table where keys are groupIDs and values are counts +function Spring.GetGroupList() end + +---@return number groupID -1 when no group selected +function Spring.GetSelectedGroup() end + +---@param unitID integer +---@return number? groupID +function Spring.GetUnitGroup(unitID) end + +---@param groupID integer +---@return nil|number[] unitIDs +function Spring.GetGroupUnits(groupID) end + +---@param groupID integer +---@return nil|table where keys are unitDefIDs and values are unitIDs +function Spring.GetGroupUnitsSorted(groupID) end + +---@param groupID integer +---@return nil|table where keys are unitDefIDs and values are counts +function Spring.GetGroupUnitsCounts(groupID) end + +---@param groupID integer +---@return number? groupSize +function Spring.GetGroupUnitsCount(groupID) end + +---Team/Player Info +--- +---@section teamplayerinfo + +---Roster +--- +---Contains data about a player +--- +---@class Roster +---@field name string +---@field playerID integer +---@field teamID integer +---@field allyTeamID integer +---@field spectator boolean +---@field cpuUsage number in order to find the progress, use: cpuUsage&0x1 if it's PC or BO, cpuUsage& 0xFE to get path res, (cpuUsage>>8)*1000 for the progress +---@field pingTime number if -1, the player is pathfinding +local Roster = {} + +---@param sortType number? return unsorted if unspecified. Disabled = 0, Allies = 1, TeamID = 2, PlayerName = 3, PlayerCPU = 4, PlayerPing = 5 +---@param showPathingPlayers boolean? (Default: false) +---@return Roster[]? playerTable +function Spring.GetPlayerRoster(sortType, showPathingPlayers) end + +---@param playerID integer +---@param packetID integer? +---@return number traffic +function Spring.GetPlayerTraffic(playerID, packetID) end + +---@param playerID integer +---@return number? mousePixels nil when invalid playerID +---@return number mouseClicks +---@return number keyPresses +---@return number numCommands +---@return number unitCommands +function Spring.GetPlayerStatistics(playerID) end + +---Configuration +--- +---@section configuration + +---Configuration +--- +---Contains data about a configuration, only name and type are guaranteed +--- +---@class Configuration +---@field name string +---@field type string +---@field description string +---@field defaultValue string +---@field minimumValue string +---@field maximumValue string +---@field safemodeValue string +---@field declarationFile string +---@field declarationLine string +---@field readOnly boolean +local Configuration = {} + +---@return Configuration[] +function Spring.GetConfigParams() end + +---@param name string +---@tparam +---@return number? configInt +function Spring.GetConfigInt(name) end + +---@param name string +---@tparam +---@return number? configFloat +function Spring.GetConfigFloat(name) end + +---@param name string +---@tparam +---@return number? configString +function Spring.GetConfigString(name) end + +---@return table sections where keys are names and loglevel are values. E.g. `{ "KeyBindings" = LOG.INFO, "Font" = LOG.INFO, "Sound" = LOG.WARNING, ... }` +function Spring.GetLogSections() end + +---Decals +--- +---@section decals + +---@return number[] decalIDs +function Spring.GetAllGroundDecals() end + +---@param decalID integer +---@return number? posX +---@return number posZ +function Spring.GetGroundDecalMiddlePos(decalID) end + +---@param decalID integer +---@return number? posTL.x +---@return number posTL.z +---@return number posTR.x +---@return number posTR.z +---@return number posBR.x +---@return number posBR.z +---@return number posBL.x +---@return number posBL.z +function Spring.GetDecalQuadPos(decalID) end + +---@param decalID integer +---@return number? sizeX +---@return number sizeY +---@return number projCubeHeight +function Spring.GetGroundDecalSizeAndHeight(decalID) end + +---@param decalID integer +---@return number? rotation in radians +function Spring.GetGroundDecalRotation(decalID) end + +---@param decalID integer +---@param isMainTex boolean? (Default: true) If false, it gets the normals/glow map +---@return nil|string texture +function Spring.GetGroundDecalTexture(decalID, isMainTex) end + +---@param isMainTex boolean? (Default: true) If false, it gets the texture for normals/glow maps +---@return string[] textureNames All textures on the atlas and available for use in SetGroundDecalTexture +function Spring.GetDecalTextures(isMainTex) end + +---@param decalID integer +---@return number? texWrapDistance if non-zero sets the mode to repeat the texture along the left-right direction of the decal every texWrapFactor elmos +---@return number texTraveledDistance shifts the texture repetition defined by texWrapFactor so the texture of a next line in the continuous multiline can start where the previous finished. For that it should collect all elmo lengths of the previously set multiline segments. +function Spring.SetGroundDecalTextureParams(decalID) end + +---@param decalID integer +---@return number? alpha Between 0 and 1 +---@return number alphaFalloff Between 0 and 1, per second +function Spring.GetGroundDecalAlpha(decalID) end + +--- +---If all three equal 0, the decal follows the normals of ground at midpoint +--- +---@param decalID integer +---@return number? normal.x +---@return number normal.y +---@return number normal.z +function Spring.GetGroundDecalNormal(decalID) end + +--- +---Gets the tint of the ground decal. +---A color of (0.5, 0.5, 0.5, 0.5) is effectively no tint +--- +---@param decalID integer +---@return number? tintR +---@return number tintG +---@return number tintB +---@return number tintA +function Spring.GetGroundDecalTint(decalID) end + +--- +---Returns less important parameters of a ground decal +--- +---@param decalID integer +---@return number? dotElimExp +---@return number refHeight +---@return number minHeight +---@return number maxHeight +---@return number forceHeightMode +function Spring.GetGroundDecalMisc(decalID) end + +--- +---Min can be not equal to max for "gradient" style decals, e.g. unit tracks +--- +---@param decalID integer +---@return number? creationFrameMin +---@return number creationFrameMax +function Spring.GetGroundDecalCreationFrame(decalID) end + +---@param decalID integer +---@return number? unitID|number featureID(+MAX_UNITS) +function Spring.GetGroundDecalOwner(decalID) end + +---@param decalID integer +---@return nil|string type "explosion"|"plate"|"lua"|"track"|"unknown" +function Spring.GetGroundDecalType(decalID) end + +---Misc +--- +---@section misc + +---@param collectGC boolean? (Default: false) collect before returning metric +---@return number? GC values are expressed in Kbytes: #bytes/2^10 +function Spring.GetSyncedGCInfo(collectGC) end + +---@param groupID integer +---@return number[]? unitIDs +function Spring.SolveNURBSCurve(groupID) end \ No newline at end of file diff --git a/library/LuaUtils.lua b/library/LuaUtils.lua new file mode 100644 index 00000000000..c0cae17abbc --- /dev/null +++ b/library/LuaUtils.lua @@ -0,0 +1,10 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaUtils.cpp +--- +---@meta + diff --git a/library/LuaVAO.lua b/library/LuaVAO.lua new file mode 100644 index 00000000000..e0094100337 --- /dev/null +++ b/library/LuaVAO.lua @@ -0,0 +1,20 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaVAO.cpp +--- +---@meta + +---@see rts/Lua/LuaVAO.cpp + +---Example: +---``` +---local myVAO = gl.GetVAO() +---if myVAO == nil then Spring.Echo("Failed to get VAO") end +---``` +--- +---@return VAO? vao The VAO ref on success, else `nil` +function gl.GetVAO() end \ No newline at end of file diff --git a/library/LuaVAOImpl.lua b/library/LuaVAOImpl.lua new file mode 100644 index 00000000000..6a072c1406e --- /dev/null +++ b/library/LuaVAOImpl.lua @@ -0,0 +1,77 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaVAOImpl.cpp +--- +---@meta + +---Vertex Array Object +--- +---@class VAO +---@see LuaVAO.GetVAO +---@see rts/Lua/LuaVAOImpl.cpp +VAO = {} + +---@return nil +function VAO:Delete() end + +---Attachs a VBO to be used as a vertex buffer +--- +---@param vbo VBO +---@return nil +function VAO:AttachVertexBuffer(vbo) end + +---Attachs a VBO to be used as an instance buffer +--- +---@param vbo VBO +---@return nil +function VAO:AttachInstanceBuffer(vbo) end + +---Attachs a VBO to be used as an index buffer +--- +---@param vbo VBO +---@return nil +function VAO:AttachIndexBuffer(vbo) end + +---@param glEnum number primitivesMode +---@param vertexCount number? +---@param vertexFirst number? +---@param instanceCount number? +---@param instanceFirst number? +---@return nil +function VAO:DrawArrays(glEnum, vertexCount, vertexFirst, instanceCount, instanceFirst) end + +---@param glEnum number primitivesMode +---@param drawCount number? +---@param baseIndex number? +---@param instanceCount number? +---@param baseVertex number? +---@param baseInstance number? +---@return nil +function VAO:DrawElements(glEnum, drawCount, baseIndex, instanceCount, baseVertex, baseInstance) end + +---@param unitIDs number|number[] +---@return number submittedCount +function VAO:AddUnitsToSubmission(unitIDs) end + +---@param featureIDs number|number[] +---@return number submittedCount +function VAO:AddFeaturesToSubmission(featureIDs) end + +---@param unitDefIDs number|number[] +---@return number submittedCount +function VAO:AddUnitDefsToSubmission(unitDefIDs) end + +---@param featureDefIDs number|number[] +---@return number submittedCount +function VAO:AddFeatureDefsToSubmission(featureDefIDs) end + +---@param index number +---@return nil +function VAO:RemoveFromSubmission(index) end + +---@return nil +function VAO:Submit() end \ No newline at end of file diff --git a/library/LuaVBO.lua b/library/LuaVBO.lua new file mode 100644 index 00000000000..95eb976aa60 --- /dev/null +++ b/library/LuaVBO.lua @@ -0,0 +1,37 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaVBO.cpp +--- +---@meta + +---@see rts/Lua/LuaVBO.cpp + +---@alias GLBufferType +---| GL.ARRAY_BUFFER +---| GL.ELEMENT_ARRAY_BUFFER +---| GL.UNIFORM_BUFFER +---| GL.SHADER_STORAGE_BUFFER + +---Example: +--- +---```lua +---local myVBO = gl.GetVBO() +---if myVBO == nil then Spring.Echo("Failed to get VBO") end +---``` +--- +---@param bufferType GLBufferType? (Default: GL.ARRAY_BUFFER) +--- +---Use `GL.ARRAY_BUFFER` for vertex data and +---`GL.ELEMENT_ARRAY_BUFFER` for vertex indices. +---@param freqUpdated boolean? (Default: true) +--- +---`true` to updated frequently, `false` to update only once. +---@return VBO? VBO +--- +---The VBO ref on success, or nil if not supported or an error occurred. +---@see GL.OpenGL_Buffer_Types +function gl.GetVBO(bufferType, freqUpdated) end \ No newline at end of file diff --git a/library/LuaVBOImpl.lua b/library/LuaVBOImpl.lua new file mode 100644 index 00000000000..7442e4bdbe8 --- /dev/null +++ b/library/LuaVBOImpl.lua @@ -0,0 +1,268 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaVBOImpl.cpp +--- +---@meta + +---Vertex Buffer Object +--- +---@class VBO +---@see LuaVBO.GetVBO +---@see rts/Lua/LuaVBOImpl.cpp +local VBO = {} + +---@return nil +function VBO:Delete() end + +---@alias VBODataType +---| GL.BYTE +---| GL.UNSIGNED_BYTE +---| GL.SHORT +---| GL.UNSIGNED_SHORT +---| GL.INT +---| GL.UNSIGNED_INT +---| GL.FLOAT + +---@class VBOAttributeDef +---@field id integer +---The location in the vertex shader layout e.g.: layout (location = 0) in vec2 +---aPos. optional attrib, specifies location in the vertex shader. If not +---specified the implementation will increment the counter starting from 0. +---There can be maximum 16 attributes (so id of 15 is max). +---@field name string +--- +---The name for this VBO, only used for debugging. +---@field size integer? +--- +---Defaults to to 4 for VBO. The number of floats that constitute 1 element in +---this buffer. e.g. for the previous layout (location = 0) in vec2 aPos, it +---would be size = 2. +---@field type VBODataType (Default: `GL.FLOAT`) +--- +---The datatype of this element. +---@field normalized boolean? (Defaults: `false`) +--- +---It's possible to submit say normal without normalizing them first, normalized +---will make sure data is normalized. +local VBOAttributeDef = {} + +---Specify the kind of VBO you will be using. +--- +---```lua +--- +---@usage terrainVertexVBO:Define(numPoints, {{ id = 0, name = "pos", size = 2 }}) +---``` +--- +---It is usually an array of vertex/color/uv data, but can also be an array of +---instance uniforms. +--- +---If you want to specify multiple instances of something to render, you will +---need to create another VBO, which also specifies the number of instances you +---wish to render, and the size of the data passed to each instance. +--- +---If you want say 5 elements, and each element is defined in the layout: +--- +---```lua +---{id = 0, name = "first", size = 1},{id = 1, name = "second", size = 2}} +---``` +--- +---Then the total size of your VBO will be `5 * (1 + 2)`. +--- +---They will be laid out consecutively: `[1,2],[1,2],[1,2],[1,2],[1,2]`. +--- +---This is important for when you call `VBO:Upload`, you need to make sure you +---enter your data into the Lua array correctly. +---@param size number The maximum number of elements this VBO can have. +---@param attribs number|VBOAttributeDef[] +--- +---When number, the maximum number of elements this VBO can have. +--- +---Otherwise, an array of arrays specifying the layout. +---@return nil +---@see GL.OpenGL_Data_Types +---@see VBO:Upload +function VBO:Define(size, attribs) end + +---@return number elementsCount +---@return number bufferSizeInBytes +---@return number size +function VBO:GetBufferSize() end + +---Uploads the data (array of floats) into the VBO +--- +---```lua +---vbo:Upload(posArray, 0, 1) +----- 0 is offset into vbo (on GPU) in this case no offset +----- 1 is lua index index into the Lua table, in this case it's same as default +----- Upload will upload from luaOffset to end of lua array +---``` +--- +---```lua +--- +---@usage rectInstanceVBO:Upload({1},0) +---``` +---@param vboData number[] a lua array of values to upload into the VBO +---@param attributeIndex integer? (Default: -1) +--- +---If supplied with non-default value then the data from vboData will only be +---used to upload the data to this particular attribute. +--- +---The whole vboData is expected to contain only attributeIndex data. +--- +---Otherwise all attributes get updated sequentially across attributes and elements. +---@param elemOffset integer? (Default: 0) Which VBO element to start uploading data from Lua array into. +---@param luaStartIndex integer? (Default: 1) Start uploading from that element in supplied Lua array. +---@param luaFinishIndex integer? Consider this element the last element in Lua array. +---@return number[] indexData +---@return integer elemOffset +---@return integer|[integer,integer,integer,integer] attrID +---@see VBO:Define +function VBO:Upload(vboData, attributeIndex, elemOffset, luaStartIndex, luaFinishIndex) end + +---@param attributeIndex integer? (Default: -1) when supplied with non-default value: only data +---from specified attribute will be downloaded - otherwise all attributes are +---downloaded +---@param elementOffset integer? (Default: 0) download data starting from this element +---@param elementCount number? number of elements to download +---@param forceGPURead boolean? (Default: false) force downloading the data from GPU buffer as opposed +---to using shadow RAM buffer +---@return [number, ...][] vboData +function VBO:Download(attributeIndex, elementOffset, elementCount, forceGPURead) end + +---Binds engine side vertex or index VBO containing models (units, features) data. +--- +---Also fills in VBO definition data as they're set for engine models (no need to do VBO:Define()). +--- +---@return nil|number buffer size in bytes +function VBO:ModelsVBO() end + +---Fills in attribute data for each specified unitDefID +--- +---The instance data in that attribute will contain the offset to bind position +---matrix in global matrices SSBO and offset to uniform buffer structure in +---global per unit/feature uniform SSBO (unused for Unit/FeatureDefs), as +---well as some auxiliary data ushc as draw flags and team index. +--- +---Data Layout: +---``` +---SInstanceData: +---, matOffset{ matOffset_ } // updated during the following draw frames +---, uniOffset{ uniOffset_ } // updated during the following draw frames +---, info{ teamIndex, drawFlags, 0, 0 } // not updated during the following draw frames +---, aux1 { 0u } +---``` +--- +---@param unitDefIDs number|number[] +---@param attrID integer +---@param teamIdOpt integer? +---@param elementOffset integer? +---@return [number,number,number,number] instanceData +---@return integer elementOffset +---@return integer attrID +function VBO:InstanceDataFromUnitDefIDs(unitDefIDs, attrID, teamIdOpt, elementOffset) end + +---Fills in attribute data for each specified featureDefID +--- +---The instance data in that attribute will contain the offset to bind position +---matrix in global matrices SSBO and offset to uniform buffer structure in +---global per unit/feature uniform SSBO (unused for Unit/FeatureDefs), as +---well as some auxiliary data ushc as draw flags and team index. +--- +---Data Layout +---``` +---SInstanceData: +---, matOffset{ matOffset_ } // updated during the following draw frames +---, uniOffset{ uniOffset_ } // updated during the following draw frames +---, info{ teamIndex, drawFlags, 0, 0 } // not updated during the following draw frames +---, aux1 { 0u } +---``` +--- +---@param featureDefIDs number|number[] +---@param attrID integer +---@param teamIdOpt integer? +---@param elementOffset integer? +---@return [number,number,number,number] instanceData +---@return integer elementOffset +---@return integer attrID +function VBO:InstanceDataFromFeatureDefIDs(featureDefIDs, attrID, teamIdOpt, elementOffset) end + +---Fills in attribute data for each specified unitID +--- +---The instance data in that attribute will contain the offset to bind position +---matrix in global matrices SSBO and offset to uniform buffer structure in +---global per unit/feature uniform SSBO (unused for Unit/FeatureDefs), as +---well as some auxiliary data ushc as draw flags and team index. +--- +---Data Layout +--- +---``` +---SInstanceData: +---, matOffset{ matOffset_ } // updated during the following draw frames +---, uniOffset{ uniOffset_ } // updated during the following draw frames +---, info{ teamIndex, drawFlags, 0, 0 } // not updated during the following draw frames +---, aux1 { 0u } +---``` +--- +---@param unitIDs number|number[] +---@param attrID integer +---@param teamIdOpt integer? +---@param elementOffset integer? +---@return [number,number,number,number] instanceData +---@return integer elementOffset +---@return integer attrID +function VBO:InstanceDataFromUnitIDs(unitIDs, attrID, teamIdOpt, elementOffset) end + +---Fills in attribute data for each specified featureID +--- +---The instance data in that attribute will contain the offset to bind position +---matrix in global matrices SSBO and offset to uniform buffer structure in +---global per unit/feature uniform SSBO (unused for Unit/FeatureDefs), as +---well as some auxiliary data ushc as draw flags and team index. +--- +---@param featureIDs number|number[] +---@param attrID integer +---@param teamIdOpt integer? +---@param elementOffset integer? +---@return [number,number,number,number] instanceData +---@return integer elementOffset +---@return integer attrID +function VBO:InstanceDataFromFeatureIDs(featureIDs, attrID, teamIdOpt, elementOffset) end + +---@param projectileIDs integer|integer[] +---@param attrID integer +---@param teamIdOpt integer? +---@param elementOffset integer? +---@return number[] matDataVec 4x4 matrix +---@return integer elemOffset +---@return integer|[integer,integer,integer,integer] attrID +function VBO:MatrixDataFromProjectileIDs(projectileIDs, attrID, teamIdOpt, elementOffset) end + +---Bind a range within a buffer object to an indexed buffer target +--- +---Generally mimics +---https://registry.khronos.org/OpenGL-Refpages/gl4/html/glBindBufferRange.xhtml +---except offset and size are specified in number of elements / element indices. +--- +---@param index integer should be in the range between +---`5 < index < GL_MAX_UNIFORM_BUFFER_BINDINGS` value (usually 31) +---@param elementOffset integer? +---@param elementCount number? +---@param target number? glEnum +---@return integer bindingIndex when successful, -1 otherwise +function VBO:BindBufferRange(index, elementOffset, elementCount, target) end + +---@param index integer +---@param elementOffset integer? +---@param elementCount number? +---@param target number? glEnum +---@return number bindingIndex when successful, -1 otherwise +function VBO:UnbindBufferRange(index, elementOffset, elementCount, target) end + +---Logs the definition of the VBO to the console +--- +---@return nil +function VBO:DumpDefinition() end \ No newline at end of file diff --git a/library/LuaVFS.lua b/library/LuaVFS.lua new file mode 100644 index 00000000000..5e23fd76165 --- /dev/null +++ b/library/LuaVFS.lua @@ -0,0 +1,13 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaVFS.cpp +--- +---@meta + +---Virtual File System +--- +---@see rts/Lua/LuaVFS.cpp \ No newline at end of file diff --git a/library/LuaVFSDownload.lua b/library/LuaVFSDownload.lua new file mode 100644 index 00000000000..ad9065945f9 --- /dev/null +++ b/library/LuaVFSDownload.lua @@ -0,0 +1,10 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaVFSDownload.cpp +--- +---@meta + diff --git a/library/LuaWeaponDefs.lua b/library/LuaWeaponDefs.lua new file mode 100644 index 00000000000..51338014092 --- /dev/null +++ b/library/LuaWeaponDefs.lua @@ -0,0 +1,10 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaWeaponDefs.cpp +--- +---@meta + diff --git a/library/LuaZip.lua b/library/LuaZip.lua new file mode 100644 index 00000000000..ac2a53be30b --- /dev/null +++ b/library/LuaZip.lua @@ -0,0 +1,61 @@ + +---!!! DO NOT MANUALLY EDIT THIS FILE !!! +---Generated by lua-doc-extractor 0.0.1 +---https://github.com/rhys-vdw/lua-doc-extractor +--- +---Date: Wed, 20 Nov 2024 13:06:36 GMT +---Source: rts/Lua/LuaZip.cpp +--- +---@meta + +---LuaZip +--- +---@see rts/Lua/LuaZip.cpp + +---@class LuaZipFileWriter +---@brief A Lua userdatum to write zip files +--- +---This class defines functions for a Lua userdatum to write to zip files. +---Such a userdatum supports the following methods: +---- close() : close the zipFile, after this open and write raise an error +---- open(name) : opens a new file within the zipFile (for writing) +---- write(...) : writes data to the open file within the zipFile (similar to io.write) +local LuaZipFileWriter = {} + +---@class LuaZipFileReader +---@brief A Lua userdatum to read zip files +--- +---This class defines functions for a Lua userdatum to read archive files. +---The type is currently forced to a zip-file, while allowing any file extension. +---Such a userdatum supports the following methods: +---- close() : close the archive, after this open and read raise an error +---- open(name) : opens a new file within the archive (for reading) +---- read(...) : reads data from the open file within the archive (similar to io.read) +local LuaZipFileReader = {} + +---@brief Pushes a new ZipFileWriter userdatum on the Lua stack. +--- +---If zip != nullptr: +---- the userdatum is made to point to the zipFile, +---- the zipFile will never be closed by Lua (close()->no-op, GC->no-op) +---Otherwise: +---- a new zipFile is opened (without overwrite, with directory creation) +---- this zipFile may be closed by Lua (close() or GC) + +---@brief Pushes a new ZipFileReader userdatum on the Lua stack. +--- +---If archive != nullptr: +---- the userdatum is made to point to the archive, +---- the archive will never be closed by Lua (close()->no-op, GC->no-op) +---Otherwise: +---- a new archive is opened +---- the type is currently forced to a zip-file, while allowing any file extension +---- this archive may be closed by Lua (close() or GC) + +---Similar to Lua's built-in (I/O library) read function. +--- +---Except that "*number" and *line" aren't supported; only "*all" and \ are +---supported. The special case read(0) (test for end of file) is handled. +--- +---Note that reading is only possible after a chunk has been opened using +---openchunk(). \ No newline at end of file diff --git a/library/Types.lua b/library/Types.lua new file mode 100644 index 00000000000..005270b9666 --- /dev/null +++ b/library/Types.lua @@ -0,0 +1,120 @@ +---@meta + +-------------------------------------------------------------------------------- +-- Vectors +-------------------------------------------------------------------------------- + +---Cartesian triple (XYZ) +--- +---@class xyz +---@field x number +---@field y number +---@field z number + +---@alias float3 xyz + +-------------------------------------------------------------------------------- +-- Color +-------------------------------------------------------------------------------- + +---Color triple (RGB) +--- +---@class rgb +---@field r number +---@field g number +---@field b number + +---Color quadruple (RGBA) +--- +---@class rgba +---@field r number +---@field g number +---@field b number +---@field a number + +-------------------------------------------------------------------------------- +-- Camera +-------------------------------------------------------------------------------- + +---@alias CameraMode +---| 0 # fps +---| 1 # ta +---| 2 # spring +---| 3 # rot +---| 4 # free +---| 5 # ov +---| 6 # dummy + +---Parameters for camera state +--- +---@class CameraState +--- +---Highly dependent on the type of the current camera controller +---@field name "ta"|"spring"|"rot"|"ov"|"free"|"fps"|"dummy" +---@field mode CameraMode The camera mode +---@field fov number? +---@field px number? Position X of the ground point in screen center +---@field py number? Position Y of the ground point in screen center +---@field pz number? Position Z of the ground point in screen center +---@field dx number? Camera direction vector X +---@field dy number? Camera direction vector Y +---@field dz number? Camera direction vector Z +---@field rx number? Camera rotation angle on X axis (spring) +---@field ry number? Camera rotation angle on Y axis (spring) +---@field rz number? Camera rotation angle on Z axis (spring) +---@field angle number? Camera rotation angle on X axis (aka tilt/pitch) (ta) +---@field flipped number? -1 for when south is down, 1 for when north is down (ta) +---@field dist number? Camera distance from the ground (spring) +---@field height number? Camera distance from the ground (ta) +---@field oldHeight number? Camera distance from the ground, cannot be changed (rot) + +-------------------------------------------------------------------------------- +-- Commands +-------------------------------------------------------------------------------- + +---Parameters for command options +--- +---@class CommandOptions +---@field coded integer +---@field alt boolean +---@field ctrl boolean +---@field shift boolean +---@field right boolean +---@field meta boolean +---@field internal boolean + +---Used when assigning multiple commands at once +--- +---@class Command +---@field cmdID integer +---@field params number[] +---@field options CommandOptions + +---Command Description +--- +---Contains data about a command. +--- +---@class CommandDescription +---@field id integer? +---@field type integer? +---@field name string? +---@field action string? +---@field tooltip string? +---@field texture string? +---@field cursor string? +---@field queueing boolean? +---@field hidden boolean? +---@field disabled boolean? +---@field showUnique boolean? +---@field onlyTexture boolean? +---@field params table? + +-------------------------------------------------------------------------------- +-- Resources +-------------------------------------------------------------------------------- + +---@alias ResourceName "metal"|"energy"|"m"|"e" + +---@alias StorageName "metalStorage"|"energyStorage"|"ms"|"es" + +---@alias ResourceUsage table \ No newline at end of file diff --git a/luamocks/SpringLuaApi.lua b/luamocks/SpringLuaApi.lua deleted file mode 100644 index 3101303d8ed..00000000000 --- a/luamocks/SpringLuaApi.lua +++ /dev/null @@ -1,3293 +0,0 @@ ---================================================================================================== --- Copyright (C) <2016> ---This program is free software: you can redistribute it and/or modify ---it under the terms of the GNU General Public License as published by ---the Free Software Foundation, either version 3 of the License, or ---(at your option) any later version. ---This program is distributed in the hope that it will be useful, ---but WITHOUT ANY WARRANTY; without even the implied warranty of ---MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ---GNU General Public License for more details. --- You should have received a copy of the GNU General Public License ---along with this program. If not, see . ---================================================================================================== ---Variables for the MockUp - ----@meta ----@type number -numberMock =42 -stringMock ="TestString" -tableMock ={exampletable= true} -arrayMock = {} -booleanMock =true -functionMock =function (bar) return bar; end - -Spring ={} -Game = {} -Engine = {} -VFS = {} -GL = { - SRC_ALPHA = stringMock, - ONE_MINUS_SRC_ALPHA = stringMock, - ONE = stringMock, - DST_ALPHA = stringMock, - ONE_MINUS_SRC_COLOR = stringMock, -} -gl = {} ---================================================================================================== - -Game = { - armorTypes = arrayMock, - gameID = numberMock, - gameSpeed = numberMock, - gameName = stringMock, - gameShortName = stringMock, - gameVersion = stringMock, - gravity = numberMock, - mapName = stringMock, - mapX = numberMock, - mapY = numberMock, - mapZ = numberMock, - mapSizeX = numberMock, - mapSizeY = numberMock, - mapSizeZ = numberMock, - modName = stringMock, - squareSize = numberMock, - version = stringMock, - startPosType = numberMock, - tidal = numberMock, - waterDamage = numberMock, - windMin = numberMock, - windMax = numberMock, - commEnds = booleanMock, - limitDGun = booleanMock, - diminishingMetal = booleanMock, -} - -Engine = { - version = stringMock, - versionFull = stringMock, -} - ----@param path string -function VFS.Include(path) - assert(type(path) == "string", "Argument path is of invalid type - expected string"); - return numberMock -end - ---TODO Move markup examples to another filename ----Produces syntax highlighted code block within the tooltip ---- ``` ---- assert(type(teamID) == "number","Argument teamID is of invalid type - expected number"); ---- assert(type(resourceType) == "string","Argument metal is of invalid type - expected string"); ---- assert(type(amount) == "number","Argument amount is of invalid type - expected number"); ---- ``` - ---================================================================================================== --- Teams ---================================================================================================== - ----Change the value of the (one-sided) alliance between: firstAllyTeamID -> secondAllyTeamID ----@param firstAllyTeamID number ----@param secondAllyTeamID number ----@param ally boolean ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetAlly) -function Spring.SetAlly ( firstAllyTeamID, secondAllyTeamID, ally) -assert(type(firstAllyTeamID) == "number","Argument firstAllyTeamID is of invalid type - expected number"); -assert(type(secondAllyTeamID) == "number","Argument secondAllyTeamID is of invalid type - expected number"); -assert(type(ally) == "boolean","Argument ally is of invalid type - expected boolean"); -return numberMock -end - ----Assigns player playerID to team teamID ----@param playerID number ----@param teamID number ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.AssignPlayerToTeam) -function Spring.AssignPlayerToTeam ( playerID, teamID) -assert(type(playerID) == "number","Argument playerID is of invalid type - expected number"); -assert(type(teamID) == "number","Argument teamID is of invalid type - expected number"); -return boolMock -end - ----Changes access to global line of sight for a team and its allies. ----@param playerID number ----@param globallos boolean ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetGlobalLos) -function Spring.SetGlobalLos (playerID, globallos) -return nil -end - ---================================================================================================== --- Game End ---================================================================================================== - - ----Will declare a team to be dead (no further orders can be assigned to such teams units) ----@param teamID number #Gaia team cannot be killed. ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.KillTeam) -function Spring.KillTeam(teamID) - return nil -end - ----Will declare game over. ----@param AllyTeamID1 number ----@param AllyTeamID2 number ----@param AllyTeamIDn number ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.GameOver) -function Spring.GameOver(AllyTeamID1, AllyTeamID2, AllyTeamIDn) - return nil -end - ---================================================================================================== --- Resources ---================================================================================================== - ----Set tidal Strength ----@param strength number ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetTidal) -function Spring.SetTidal(strength) - assert(type(strength) == "number", "Argument strength is of invalid type - expected number") - return nil -end - ----Sets wind strength ----@param minStrength number ----@param maxStrength number ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetWind) -function Spring.SetWind(minStrength, maxStrength) - assert(type(minStrength) == "number", "Argument minStrength is of invalid type - expected number") - assert(type(maxStrength) == "number", "Argument maxStrength is of invalid type - expected number") - return nil -end - ----@param teamID number ----@param resourceType resourceTypes ----@param amount number ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.AddTeamResource) -function Spring.AddTeamResource ( teamID, resourceType, amount) -assert(type(teamID) == "number","Argument teamID is of invalid type - expected number"); -assert(type(resourceType) == "string","Argument resourceType is of invalid type - expected string"); -assert(type(amount) == "number","Argument amount is of invalid type - expected number"); -return nil -end - ----@alias resourceTypes ----| "metal" ----| "energy" - --- Consumes metal and/or energy resources of the specified team. ----@param teamID number ----@param type resourceTypes ----@param amount number ----@return boolean | nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.UseTeamResource) -function Spring.UseTeamResource ( teamID, type, amount ) -return booleanMock -end - ----@alias resValues ----| "m" # metal ----| "e" # energy ----| "ms" # metalStorage ----| "es" # energyStorage - ----Sets team resources to given absolute value ----@param teamID number ----@param res resValues ----@param amount any ----@return integer ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetTeamResource) -function Spring.SetTeamResource ( teamID, res, amount) -assert(type(teamID) == "number","Argument teamID is of invalid type - expected number"); -assert(type(res) == "string","Argument res is of invalid type - expected string"); -assert(type(amount) == "number","Argument amount is of invalid type - expected number"); -return numberMock -end - ----Changes the resource amount for a team beyond which resources aren't stored but transferred to other allied teams if possible ----@param teamID number ----@param resourceType resourceTypes ----@param amount number ----@return integer ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetTeamShareLevel) -function Spring.SetTeamShareLevel (teamID, resourceType, amount) -assert(type(teamID) == "number","Argument teamID is of invalid type - expected number"); -assert(type(resourceType) == "string","Argument metal is of invalid type - expected string"); -assert(type(amount) == "number","Argument amount is of invalid type - expected number"); -return numberMock -end - ---- Transfers resources between two teams ----@param teamID_src number source team ----@param teamID_rec number recieving team ----@param resourceType resourceTypes ----@param amount number ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.ShareTeamResource) -function Spring.ShareTeamResource ( teamID_src, teamID_rec, resourceType, amount ) -assert(type(teamID_src) == "number","Argument teamID_src is of invalid type - expected number"); -assert(type(teamID_rec) == "number","Argument teamID_rec is of invalid type - expected number"); -assert(type(resourceType) == "string", "Argument resourceType is of invalid type - expected string"); -assert(type(amount) == "number","Argument amount is of invalid type - expected number"); -return numberMock -end - ---================================================================================================== --- GameRulesParameter ---================================================================================================== - - ---- If one condition is fulfilled all beneath it are too (e.g. if an unit is in LOS it can read params with `inradar=true` even if the param has `inlos=false`) All GameRulesParam are public, TeamRulesParams can just be `private`,`allied` and/or `public` You can read RulesParams from any Lua enviroments! With those losAccess policies you can limit their access. ---- Fields: ---- private bool only readable by the ally (default) ---- allied bool readable by ally + ingame allied ---- typed bool readable if the unit is type (= in radar and was once in LOS) ---- inlos bool readable if the unit is in LOS ---- inradar bool readable if the unit is in AirLOS ---- public bool readable by all - ----@alias losAccess ----| "private" #only readable by the ally (default) ----| "allied" #readable by ally + ingame allied ----| "inlos" #readable if the unit is in LOS ----| "typed" #readable if the unit is type (= in radar and was once in LOS) ----| "inradar" #readable if the unit is in AirLOS ----| "public" #readable by all - ----@param paramName string ----@param paramValue number | string #numeric paramValues in quotes will be converted to number. ----@param losAccess? losAccess # not typically used in GameRules, see GetGameRulesParams, it will be ignored. ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetGameRulesParam)
----[losAccess parameter details](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#losAccess) -function Spring.SetGameRulesParam ( paramName, paramValue, losAccess ) - assert(type(paramName) == "string","Argument paramName is of invalid type - expected string"); - assert(losAccess == "private" | losAccess == "allied" | losAccess == "inlos" | losAccess == "inradar" - | losAccess == "public" | losAccess == "typed" , "Argument losAccess is invalid"); -return nil -end - ----@param teamID number ----@param paramName string ----@param paramValue number | string #numeric paramValues in quotes will be converted to number. ----@param losAccess? losAccess # while valid arguments, inLos, inRdar, typed, are not meaningful for team rules. ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetTeamRulesParam) -function Spring.SetTeamRulesParam (teamID, paramName, paramValue, losAccess) - assert(type(teamID) == "number","Argument teamID is of invalid type - expected number"); - assert(type(paramName) == "string" or type(paramName) == "number","Argument paramName is of invalid type - expected string or number"); - assert(type(paramValue) == "string" | type(paramName) == "number","Argument paramName is of invalid type - expected string or number"); - assert(type((losAccess) == "string" | type(losAccess) == "table") & (losAccess == "private" | losAccess == "allied" | losAccess == "inlos" | losAccess == "inradar" - | losAccess == "public" | losAccess == "typed") , "Argument losAccess is invalid"); - return nil -end - ----@param unitID number ----@param paramName string ----@param paramValue number | string #numeric paramValues in quotes will be converted to number. ----@param losAccess? losAccess ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitRulesParam) -function Spring.SetUnitRulesParam (unitID, paramName, paramValue, losAccess) - assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); - assert(type(paramName) == "string", "invalid type for argument paramName, expected String") - assert(type(paramValue) == "string" | type(paramName) == "number","Argument paramName is of invalid type - expected string or number"); - assert(type((losAccess) == "string" | type(losAccess) == "table") & (losAccess == "private" | losAccess == "allied" | losAccess == "inlos" | losAccess == "inradar" - | losAccess == "public" | losAccess == "typed") , "Argument losAccess is invalid"); - return nil -end - ----@param featureID number ----@param paramName string ----@param paramValue number | string ----@param losAccess? losAccess ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetFeatureRulesParam) -function Spring.SetFeatureRulesParam(featureID, paramName, paramValue, losAccess) - assert(type(featureID) == "number","Argument featureID is of invalid type - expected number"); - assert(type(paramName)) - assert(type(paramValue)) - assert(type((losAccess) == "string" | type(losAccess) == "table") & (losAccess == "private" | losAccess == "allied" | losAccess == "inlos" | losAccess == "inradar" - | losAccess == "public" | losAccess == "typed") , "Argument losAccess is invalid"); - return nil -end - ---================================================================================================== --- Lua to COB ---================================================================================================== - ----@param UnitID number ----@param funcName number | string ----@param retArgs number ----@param COBArg1? any # ----@param COBArg2? any # ----@param COBArgn? any # ----@return nil|number ----Consult wizard for additional return param info.
----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.CallCOBScript) -function Spring.CallCOBScript(UnitID, funcName, retArgs, COBArg1, COBArg2, COBArgn) - return numberMock -end - ----@param unitID number ----@param funcName string ----@return nil | number ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.GetCOBScriptID) -function Spring.GetCOBScriptID (unitID, funcName) - assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); - assert(type(funcName) == "string","Argument funcName is of invalid type - expected string"); - return numberMock -end - - ---================================================================================================== --- Unit Handling ---================================================================================================== - - - ----@alias facing ----| "south" ----| "0" # south ----| "east" ----| "e" ----| "1" # east ----| "north" ----| "n" ----| "2" # north ----| "west" ----| "w" ----| "3" # west - ----@param unitDefName 'string UnitDefName'|'number UnitDefID' ----@param x number ----@param y number ----@param z number ----@param facing facing ----@param teamID number ----@param build? boolean # the unit is created in "being built" state with buildProgress = 0 (default false) ----@param flattenGround? boolean # the unit flattens ground, if it normally does so (default true) ----@param unitID? number # Requests specific unitID ----@param builderID? number # ----@return nil | number # `unitID` meaning unit was created ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.CreateUnit) -function Spring.CreateUnit ( unitDefName, x, y , z, facing, teamID, build, flattenGround, unitID, builderID) - assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); - assert(type(teamID) == "number","Argument unitID is of invalid type - expected number"); - return numberMock -end - - - ----@param UnitID number ----@param selfd? boolean # if true, Makes the unit act like it self-destructed. ----@param reclaimed? boolean # Don't show any DeathSequences, don't leave a wreckage. This does not give back the resources to the team! ----@param attackerID? number ----@param cleanupImmediately? boolean # stronger version of reclaimed, removes the unit unconditionally and makes its ID available for immediate reuse (otherwise it takes a few frames) (default false) ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.DestroyUnit) -function Spring.DestroyUnit ( UnitID, selfd, reclaimed, attackerID, cleanupImmediately ) - return nil -end - ----@param UnitID number ----@param newTeamID number ----@param given? boolean # If given=false, the unit is captured. ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.TransferUnit) -function Spring.TransferUnit (UnitID, newTeamID, given) - return nil -end - ---================================================================================================== --- Unit Control ---================================================================================================== - - ----@alias SetCostKey ----| "buildTime=number" ----| "metalCost=number" ----| "energyCost=number" - ----@param unitID number ----@param where SetCostKey ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitCosts) -function Spring.SetUnitCosts (unitID, where) - return nil -end - ---================================================================================================== --- Unit Resourcing ---================================================================================================== - ----@param UnitID number ----@param res string | '[u|c][u|m][m|e]' # `[unconditional|conditional][use|make][metal|energy]` ex. `"uum"`, `"cme"` ----@param amount number ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitResourcing) -function Spring.SetUnitResourcing (UnitID, res, amount) - return nil -end - ----@param UnitID number ----@param res table ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitResourcing) -function Spring.SetUnitResourcing (UnitID, res) - return nil -end - ----@param unitID number ----@param tooltip string ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitTooltip) -function Spring.SetUnitTooltip (unitID, tooltip) - assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); - assert(type(tooltip) == "string","Argument tooltip is of invalid type - expected string"); - return nil -end - ----@param unitID number ----@param health number | string #number or {[string]=number,...} where keys can be one of health|capture|paralyze|build and values are amounts ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitHealth) -function Spring.SetUnitHealth (unitID, health) - return -end - ----@param unitID number ----@param maxHealth number ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitMaxHealth) -function Spring.SetUnitMaxHealth (unitID, maxHealth) - assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); - assert(type(maxHealth) == "number","Argument maxHealth is of invalid type - expected number"); - return nil -end - ----@param unitID number ----@param stockpile number ----@param buildPercent number ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitStockpile) -function Spring.SetUnitStockpile (unitID, stockpile, buildPercent) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(stockpile) == "number","Argument stockpile is of invalid type - expected number"); -assert(type(buildPercent) == "number","Argument buildPercent is of invalid type - expected number"); -return nil -end - ----@param unitID number ----@param forceUseWeapons? number # ----@param allowUseWeapons? number # ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitUseWeapons) -function Spring.SetUnitUseWeapons (unitID, forceUseWeapons, allowUseWeapons) - return nil -end - - ----@alias states table ----| 'reloadState':number ----| "reloadFrame=number" # synonym for reloadState! ----| "reloadTime=number" ----| "accuracy=number" ----| "sprayAngle=number" ----| "range=number" # if you change the range of a weapon with dynamic damage make sure you use `SetUnitWeaponDamages` to change dynDamageRange as well. ----| "projectileSpeed=number" ----| "burst=number" ----| "burstRate=number" ----| "projectiles=number" ----| "salvoLeft=number" ----| "nextSalvo=number" ----| "aimReady=number" # (<>0.0f := true) - ----@param unitID number ----@param weaponNum number ----@param states states ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitWeaponState) ----@diagnostic disable-next-line -function Spring.SetUnitWeaponState (unitID, weaponNum, states) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(weaponNum) == "number","Argument weaponNum is of invalid type - expected number"); -assert(type(states) == "table","Argument states is of invalid type - expected table"); -return nil -end - ----@param unitID number ----@param weaponNum number ----@param key states ----@param value number ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitWeaponState) ----@diagnostic disable-next-line -function Spring.SetUnitWeaponState (unitID, weaponNum, key, value) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(weaponNum) == "number","Argument weaponNum is of invalid type - expected number"); -assert(type(states) == "table","Argument states is of invalid type - expected table"); -return nil -end - ----@alias damages table ----| "paralyzeDamageTime=number" ----| "impulseFactor=number" ----| "impulseBoost=number" ----| "craterMult=number" ----| "craterBoost=number" ----| "dynDamageExp=number" ----| "dynDamageMin=number" ----| "dynDamageRange=number" ----| "dynDamageInverted=number" (<>0.0f := true) ----| "craterAreaOfEffect=number" ----| "damageAreaOfEffect=number" ----| "edgeEffectiveness=number" ----| "explosionSpeed=number" - ----@param unitID number ----@param weaponNum number | string # Number or string ["selfDestruct" | "explode"] ----@param damages damages ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitWeaponDamages) ----@diagnostic disable-next-line -function Spring.SetUnitWeaponDamages (unitID, weaponNum, damages) - assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); - assert(type(weaponNum) == "number","Argument weaponNum is of invalid type - expected number"); - return nil -end - ----@param unitID number ----@param weaponNum number | string # Number or string ["selfDestruct" | "explode"] ----@param key string ----@param value number ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitWeaponDamages) ----@diagnostic disable-next-line -function Spring.SetUnitWeaponDamages (unitID, weaponNum, key, value) - assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); - assert(type(weaponNum) == "number","Argument weaponNum is of invalid type - expected number"); - return nil -end - ----@param unitID number ----@param maxRange number ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitMaxRange) -function Spring.SetUnitMaxRange (unitID, maxRange) - assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); - assert(type(maxRange) == "number","Argument maxRange is of invalid type - expected number"); - return nil -end - ----@param unitID number ----@param experience number ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitExperience) ----@see Spring.AddUnitExperience -function Spring.SetUnitExperience (unitID, experience) - assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); - assert(type(experience) == "number","Argument experience is of invalid type - expected number"); - return numberMock -end - ----@param unitID number ----@param deltaExperience number # Can be negative to subtract, but the unit will never have negative total afterwards ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.AddUnitExperience) ----@see Spring.SetUnitExperience -function Spring.AddUnitExperience (unitID, deltaExperience) - return nil -end - ----@param unitID number ----@param armored? boolean ----@param armorMultiple? number # Cannot be less than zero, clamped to .0001 ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitArmored) -function Spring.SetUnitArmored (unitID, armored, armorMultiple) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(armored) == "boolean","Argument armored is of invalid type - expected boolean"); -assert(type(armorMultiple) == "number","Argument armorMultiple is of invalid type - expected number"); -return nil -end - ---================================================================================================== --- Unit LOS ---================================================================================================== - - ----The 3rd argument is either the bit-and combination of the following numbers: LOS_INLOS = 1 LOS_INRADAR = 2 LOS_PREVLOS = 4 LOS_CONTRADAR = 8 or a table of the following form: losTypes = { [los = boolean,] [radar = boolean,] [prevLos = boolean,] [contRadar = boolean] } ----@param unitID number ----@param allyTeam number ----@param losTypes number | table ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitLosMask) -function Spring.SetUnitLosMask (unitID, allyTeam, losTypes) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(allyTeam) == "number","Argument allyTeam is of invalid type - expected number"); ---assert(type(los) == "number","Argument los is of invalid type - expected number"); -return nil -end - ----The 3rd argument is either the bit-and combination of the following numbers: LOS_INLOS = 1 LOS_INRADAR = 2 LOS_PREVLOS = 4 LOS_CONTRADAR = 8 or a table of the following form: losTypes = { [los = boolean,] [radar = boolean,] [prevLos = boolean,] [contRadar = boolean] } ----@param unitID number ----@param allyTeam number ----@param los number | table ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitLosState) -function Spring.SetUnitLosState(unitID, allyTeam, los) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(allyTeam) == "number","Argument allyTeam is of invalid type - expected number"); -assert(type(los) == "number","Argument los is of invalid type - expected number"); -return nil -end - ----If the 2nd argument is a number, the value works like this: 1:=normal cloak 2:=for free cloak (cost no E) 3:=for free + no decloaking (except the unit is stunned) 4:=ultimative cloak (no ecost, no decloaking, no stunned decloak) The decloak distance is only changed: - if the 3th argument is a number or a boolean. - if the boolean is false it takes the default decloak distance for that unitdef, - if the boolean is true it takes the absolute value of it. ----@param unitID number ----@param cloak boolean | number ----@param cloakArg boolean | number ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitCloak) -function Spring.SetUnitCloak (unitID, cloak, cloakArg) -return nil -end - ----@param unitID number ----@param stealth boolean ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitStealth) -function Spring.SetUnitStealth (unitID, stealth) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(stealth) == "boolean","Argument stealth is of invalid type - expected boolean"); -return nil -end - ----@param unitID number ----@param sonarStealth boolean ----@return nil -function Spring.SetUnitSonarStealth (unitID, sonarStealth) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(sonarStealth) == "boolean","Argument sonarStealth is of invalid type - expected boolean"); -return nil -end - ----@param unitID number ----@param seismicSignature number ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitSeismicSignature) -function Spring.SetUnitSeismicSignature (unitID, seismicSignature) - return nil -end - ----@param unitID number ----@param alwaysVisible boolean ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitAlwaysVisible) -function Spring.SetUnitAlwaysVisible(unitID, alwaysVisible) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(alwaysVisible) == "boolean","Argument alwaysVisible is of invalid type - expected boolean"); -return nil -end - ----@param unitID number ----@param useAirLos boolean ----@return nil ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitUseAirLos) -function Spring.SetUnitUseAirLos(unitID, useAirLos) - return nil -end - ----@param unitID number ----@param depth number # corresponds to metal extraction rawState ----@param range? number similar to "extractsMetal" in unitDefs ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitMetalExtraction) -function Spring.SetUnitMetalExtraction(unitID, depth, range) end - ----@param unitID number ----@param metal number ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitHarvestStorage) -function Spring.SetUnitHarvestStorage (unitID, metal) - assert(type(unitid) == "number","Argument unitid is of invalid type - expected number"); - assert(type(metal) == "number","Argument metal is of invalid type - expected number"); -end - ----@param unitID number ----@param paramName string # one of `buildRange|buildDistance|buildRange3D` ----@param value number | boolean # boolean when `paramName` is `buildRange3D`, number otherwise ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitBuildParams) -function Spring.SetUnitBuildParams(unitID, paramName, value) end - ----@param builderID number ----@param buildSpeed number ----@param repairSpeed? number # ----@param reclaimSpeed? number # ----@param captureSpeed? number # ----@param terraformSpeed? number # ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitBuildSpeed) -function Spring.SetUnitBuildSpeed (builderID, buildSpeed, repairSpeed, reclaimSpeed, captureSpeed, terraformSpeed) end - ----This saves a lot of engine calls, by replacing: `function script.QueryNanoPiece() return currentpiece end` **Use it!** ----@param builderID number ----@param pieces table ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitNanoPieces) -function Spring.SetUnitNanoPieces (builderID, pieces) - assert(type(builderID) == "number","Argument builderID is of invalid type - expected number"); - assert(type(pieces) == "table","Argument pieces is of invalid type - expected table"); -end - ----@param unitID number ----@param isBlocking boolean ----@param isSolidObjectCollidable boolean ----@param isProjectileCollidable boolean ----@param isRaySegmentCollidable boolean ----@param crushable boolean ----@param blockEnemyPushing boolean ----@param blockHeightChanges boolean ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitBlocking) -function Spring.SetUnitBlocking (unitID, isBlocking, isSolidObjectCollidable, isProjectileCollidable, isRaySegmentCollidable, crushable, blockEnemyPushing, blockHeightChanges) - assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); - assert(type(isBlocking) == "boolean","Argument isBlocking is of invalid type - expected boolean"); - assert(type(isSolidObjectCollidable) == "boolean","Argument isSolidObjectCollidable is of invalid type - expected boolean"); - assert(type(isProjectileCollidable) == "boolean","Argument isProjectileCollidable is of invalid type - expected boolean"); - assert(type(isRaySegmentCollidable) == "boolean","Argument isRaySegmentCollidable is of invalid type - expected boolean"); - assert(type(crushable) == "boolean","Argument crushable is of invalid type - expected boolean"); - assert(type(blockEnemyPushing) == "boolean","Argument blockEnemyPushing is of invalid type - expected boolean"); - assert(type(blockHeightChanges) == "boolean","Argument blockHeightChanges is of invalid type - expected boolean"); -end - ---function Spring.SetUnitBlocking (unitID, blocking, collide, crushable) ---assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); ---assert(type(blocking) == "boolean","Argument blocking is of invalid type - expected boolean"); ---assert(type(collide) == "boolean","Argument collide is of invalid type - expected boolean"); ---assert(type(crushable) == "boolean","Argument crushable is of invalid type - expected boolean"); ---return numberMock --- end - ---function Spring.SetUnitBlocking (unitID, depth, range) ---assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); ---assert(type(depth) == "number","Argument depth is of invalid type - expected number"); ---assert(type(range) == "number","Argument range is of invalid type - expected number"); ---return numberMock --- end - ----@param unitID number ----@param crashing boolean ----@return boolean success ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitCrashing) -function Spring.SetUnitCrashing (unitID, crashing) - assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); - assert(type(crashing) == "boolean","Argument crashing is of invalid type - expected boolean"); - return booleanMock -end - ----@param unitID number ----@param weaponID number (default -1) ----@param enabled boolean? ----@param power number? ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitShieldState) -function Spring.SetUnitShieldState (unitID, weaponID, enabled, power) - assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); - assert(type(weaponID) == "number","Argument weaponID is of invalid type - expected number"); -end - ----@param unitID number ----@param type string ----|"dir" ----|"minDamage" ----|"maxDamage" ----|"moveFactor" ----|"mode" # if type = mode, 0 = no flanking bonus, 1 = global coords, mobile, 2 = unit coords, mobile, 3 = unit coords, locked ----@param arg1 number ----| 'x' ----| 'minDamage' ----| 'maxDamage' ----| 'moveFactor' ----| 'mode' ----@param y number? # only when type is "dir" ----@param z number? # only when type is "dir" ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitFlanking) -function Spring.SetUnitFlanking (unitID, type, arg1, y, z) - assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); - assert(type(mode) == "string","Argument mode is of invalid type - expected string"); -end - ----@param unitID number ----@param neutral boolean ----@return nil | boolean ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitNeutral) -function Spring.SetUnitNeutral (unitID, neutral) - assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); - assert(type(neutral) == "boolean","Argument neutral is of invalid type - expected boolean"); - return nil -end - ----@param unitID number ----@param x? number # when nil or not passed it will drop target and ignore other parameters ----@param y? number # ----@param z? number # ----@param dgun boolean? # default false ----@param userTarget boolean? # default false ----@param weaponNum number? # default -1 ----@return boolean success ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitTarget) -function Spring.SetUnitTarget (unitID, x, y, z, dgun, userTarget, weaponNum) - return booleanMock -end - ----@param unitID number ----@param enemyUnitID? number # when nil, drops the units current target ----@param dgun boolean? # default false ----@param userTarget boolean? # default false ----@param weaponNum number? # default -1 ----@return boolean success ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitTarget) -function Spring.SetUnitTarget (unitID, enemyUnitID, dgun, userTarget, weaponNum) - return booleanMock -end - ----@param unitID number ----@param mpX number new middle positionX of unit ----@param mpY number new middle positionY of unit ----@param mpZ number new middle positionZ of unit ----@param apX number new positionX that enemies aim at on this unit ----@param apY number new positionY that enemies aim at on this unit ----@param apZ number new positionZ that enemies aim at on this unit ----@param relative? boolean are the new coordinates relative to the world (false) or unit (true) coordinates? Also, not that apY is inverted. (default false) ----@return boolean success ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitMidAndAimPos) -function Spring.SetUnitMidAndAimPos(unitID, mpX, mpY, mpZ, apX, apY, apZ, relative) - return booleanMock -end - ----@param unitID number ----@param radius number ----@param height number ----@return boolean success ---- ----[Open in Browser](https://beyond-all-reason.github.io/spring/ldoc/modules/SyncedCtrl.html#Spring.SetUnitRadiusAndHeight) -function Spring.SetUnitRadiusAndHeight (unitID, radius, height) - assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); - assert(type(radius) == "number","Argument radius is of invalid type - expected number"); - assert(type(height) == "number","Argument height is of invalid type - expected number"); - return booleanMock -end - ----@param transporterID number ----@param passengerID number ----@param pieceNum number ----@return nil -function Spring.UnitAttach (transporterID, passengerID, pieceNum) -assert(type(transporterID) == "number","Argument transporterID is of invalid type - expected number"); -assert(type(passengerID) == "number","Argument passengerID is of invalid type - expected number"); -assert(type(pieceNum) == "number","Argument pieceNum is of invalid type - expected number"); -return nil -end - ---================================= ---TODO Continue from here 6-6-23 ---================================= - ----@param passengerID number ----@return nil -function Spring.UnitDetach (passengerID) -assert(type(passengerID) == "number","Argument passengerID is of invalid type - expected number"); -return nil -end - ----@param passengerID number ----@return nil -function Spring.UnitDetachFromAir ( passengerID) -assert(type(passengerID) == "number","Argument passengerID is of invalid type - expected number"); -return nil -end - ----@param passengerID number ----@param transportID number ----@return nil -function Spring.SetUnitLoadingTransport ( passengerID, transportID) -assert(type(passengerID) == "number","Argument passengerID is of invalid type - expected number"); -assert(type(transportID) == "number","Argument transportID is of invalid type - expected number"); -return nil -end - ----Changes the pieces hierarchy of a unit by attaching a piece to a new parent. ----@param unitID number ----@param AlteredPiece number ----@param ParentPiece number ----@return nil -function Spring.SetUnitPieceParent (unitID, AlteredPiece, ParentPiece) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(AlteredPiece) == "number","Argument AlteredPiece is of invalid type - expected number"); -assert(type(ParentPiece) == "number","Argument ParentPiece is of invalid type - expected number"); -return nil -end - ----@alias COLVOL_TYPES table ----| "COLVOL_TYPE_DISABLED=-1" ----| "COLVOL_TYPE_ELLIPSOID=0" ----| "COLVOL_TYPE_CYLINDER=0" ----| "COLVOL_TYPE_BOX=0" ----| "COLVOL_TYPE_SPHERE=0" ----| "COLVOL_NUM_TYPES=0" ---number of non-disabled collision volumn types - ----@alias COLVOL_TESTS table ----| "COLVOL_TEST_DISC=0" ----| "COLVOL_TEST_CONT=1" ----| "COLVOL_NUM_TESTS=2" // number of tests - ----@alias COLVOL_AXES table ----| "COLVOL_AXIS_X=0" ----| "COLVOL_AXIS_Y=1" ----| "COLVOL_AXIS_Z=2" ----| "COLVOL_NUM_AXES=3" // number of collision volume axes - ----@param UnitID number ----@param scaleX number ----@param scaleY number ----@param scaleZ number ----@param offsetX number ----@param offsetY number ----@param offsetZ number ----@param vType COLVOL_TYPES ----@param tType COLVOL_TESTS ----@param Axis COLVOL_AXES ----@diagnostic disable-next-line -function Spring.SetUnitCollisionVolumeData (UnitID, scaleX, scaleY, scaleZ, offsetX, offsetY, offsetZ, vType, tType, Axis) -return nil -end ---- piece volumes not allowed to use discrete hit-testing ----@param unitID number ----@param pieceIndex number ----@param enable boolean ----@param scaleX number ----@param scaleY number ----@param scaleZ number ----@param offsetX number ----@param offsetY number ----@param offsetZ number ----@param volumeType? number ----@param primaryAxis? number -function Spring.SetUnitPieceCollisionVolumeData (unitID, pieceIndex, enable, scaleX, scaleY, scaleZ, offsetX, offsetY, offsetZ, volumeType, primaryAxis) -return nil -end - ----Deprecated and marked for deletion in CPP API fields ----@param unitID number ----@param travel number ----@param travelPeriod number ----@return nil ----@deprecated -function Spring.SetUnitTravel (unitID, travel, travelPeriod) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(travel) == "number","Argument travel is of invalid type - expected number"); -assert(type(travelPeriod) == "number","Argument travelPeriod is of invalid type - expected number"); -return nil -end - ----Used by default commands to get in build-, attackrange etc. ----@param unitID number ----@param goalx number ----@param goaly number ----@param goalz number ----@param goalRadius? number ----@param moveSpeed? number ----@param moveRaw? boolean ----@return nil -function Spring.SetUnitMoveGoal (unitID, goalx, goaly, goalz, goalRadius, moveSpeed, moveRaw) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(goalx) == "number","Argument goalx is of invalid type - expected number"); -assert(type(goaly) == "number","Argument goaly is of invalid type - expected number"); -assert(type(goalz) == "number","Argument goalz is of invalid type - expected number"); -assert(type(goalRadius) == "number","Argument goalRadius is of invalid type - expected number"); -assert(type(moveSpeed) == "number","Argument moveSpeed is of invalid type - expected number"); -return nil -end - ----Used in conjuction with Spring.UnitAttach et al. ----to re-implement old airbase & fuel system in lua ----@param unitID number ----@param goalX number ----@param goalY number ----@param goalZ number ----@param goalRadius? number ----@return nil ----@see Spring.UnitAttach ----@see Spring.ClearUnitGoal -function Spring.SetLandUnitGoal(unitID, goalX, goalY, goalZ, goalRadius) - return nil -end - -unitdefs = Spring.CreateUnit('number UnitDefID') - ----@param unitID number ----@return nil ----@see Spring.SetLandUnitGoal ----@see Spring.SetUnitMoveGoal -function Spring.ClearUnitGoal(unitID) - return nil -end - ----@param unitID number ----@param posX number ----@param posY number ----@param posZ number ----@param velX number ----@param velY number ----@param velZ number ----@param rotX number ----@param rotY number ----@param rotZ number ----@param dragX number ----@param dragY number ----@param dragZ number ----@return nil -function Spring.SetUnitPhysics(unitID, posX, posY, posZ, velX, velY, velZ, rotX, rotY, rotZ, dragX, dragY, dragZ) - return nil -end - ----@param unitID number ----@param mass number ----@return nil -function Spring.SetUnitMass(unitID, mass) -return nil -end - ----@param unitID number ----@param x number ----@param z number ----@param alwaysAboveSea? boolean ----@return nil -function Spring.SetUnitPosition (unitID, x, z, alwaysAboveSea) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(x) == "number","Argument x is of invalid type - expected number"); -assert(type(z) == "number","Argument z is of invalid type - expected number"); -assert(type(alwaysAboveSea) == "boolean","Argument alwaysAboveSea is of invalid type - expected boolean"); -return nil -end - ----@param unitID number ----@param velx number ----@param vely number ----@param velz number ----@return nil -function Spring.SetUnitVelocity (unitID, velx, vely, velz) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(velx) == "number","Argument velx is of invalid type - expected number"); -assert(type(vely) == "number","Argument vely is of invalid type - expected number"); -assert(type(velz) == "number","Argument velz is of invalid type - expected number"); -return nil -end - ----@param unitID number ----@param rotx number ----@param roty number ----@param rotz number ----@return nil -function Spring.SetUnitRotation (unitID, rotx, roty, rotz) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(rotx) == "number","Argument rotx is of invalid type - expected number"); -assert(type(roty) == "number","Argument roty is of invalid type - expected number"); -assert(type(rotz) == "number","Argument rotz is of invalid type - expected number"); -return nil -end - ----@param unitID number ----@param yaw number ----@param pitch number ----@param roll number ----@return nil -function Spring.SetUnitDirection (unitID, yaw, pitch, roll) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(x) == "number","Argument x is of invalid type - expected number"); -assert(type(y) == "number","Argument y is of invalid type - expected number"); -assert(type(z) == "number","Argument z is of invalid type - expected number"); -return nil -end - ----@param unitID number ----@param x number ----@param y number ----@param z number ----@param decayRate? number ----@return nil -function Spring.AddUnitImpulse (unitID, x, y, z, decayRate) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(x) == "number","Argument x is of invalid type - expected number"); -assert(type(y) == "number","Argument y is of invalid type - expected number"); -assert(type(z) == "number","Argument z is of invalid type - expected number"); -return nil -end - ----@param unitID number ----@param pingSize number ----@return nil -function Spring.AddUnitSeismicPing (unitID, pingSize) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(pingSize) == "number","Argument pingSize is of invalid type - expected number"); -return nil -end - ----Deprecated - no references to this function in current recoil engine 2023-06-04 ----@param unitID number ----@deprecated ----@return nil -function Spring.RemoveBuildingDecal (unitID) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -return nil -end - ----@param unitID number ----@param weaponID number ----@return nil -function Spring.UnitWeaponFire (unitID, weaponID) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(weaponID) == "number","Argument weaponID is of invalid type - expected number"); -return nil -end - ---TODO is this function deprecated, debug only, or intended to be maintained? ----Marked not permanent, missing doc in Recoil API autodoc ----@param unitID number ----@param weaponID number ----@return nil -function Spring.UnitWeaponHoldFire (unitID, weaponID) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(weaponID) == "number","Argument weaponID is of invalid type - expected number"); -return nil -end - ----Sets a unit sensor radius based on sensor type ----@param unitID number ----@param type string "los" | "airLos" | "radar" | "sonar" | "seismic" | "radarJammer" | "sonarJammer" ----@return nil | number newRadius -function Spring.SetUnitSensorRadius(unitID, type) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(type) == "string","Argument type is of invalid type - expected string"); ---assert(type(radius) == "number","Argument radius is of invalid type - expected number"); radius is defined by type -return numberMock -end - -function Spring.SetRadarErrorParams ( ) -return numberMock -end - -function Spring.SetUnitPosErrorParams ( ) -return numberMock -end - -function Spring.AddUnitResource (unitID, m) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(m) == "string","Argument m is of invalid type - expected string"); -return numberMock -end - -function Spring.UseUnitResource (unitID, m) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(m) == "string","Argument m is of invalid type - expected string"); -return booleanMock -end - -function Spring.DestroyFeature ( featureID) -assert(type(featureID) == "number","Argument featureID is of invalid type - expected number"); -return numberMock -end - -function Spring.TransferFeature ( featureID, teamID) -assert(type(featureID) == "number","Argument featureID is of invalid type - expected number"); -assert(type(teamID) == "number","Argument teamID is of invalid type - expected number"); -return numberMock -end - -function Spring.SetFeatureHealth ( featureID, health) -assert(type(featureID) == "number","Argument featureID is of invalid type - expected number"); -assert(type(health) == "number","Argument health is of invalid type - expected number"); -return numberMock -end - -function Spring.SetFeatureReclaim ( featureID, reclaimLeft) -assert(type(featureID) == "number","Argument featureID is of invalid type - expected number"); -assert(type(reclaimLeft) == "number","Argument reclaimLeft is of invalid type - expected number"); -return numberMock -end - -function Spring.SetFeatureResurrect ( featureID, UnitDefName, facing) -assert(type(featureID) == "number","Argument featureID is of invalid type - expected number"); -assert(type(UnitDefName) == "string","Argument UnitDefName? is of invalid type - expected string"); -assert(type(facing) == "number","Argument facing is of invalid type - expected number"); -return numberMock -end - -function Spring.SetFeaturePosition ( featureID, x, y, z, snapToGround) -assert(type(featureID) == "number","Argument featureID is of invalid type - expected number"); -assert(type(x) == "number","Argument x is of invalid type - expected number"); -assert(type(y) == "number","Argument y is of invalid type - expected number"); -assert(type(z) == "number","Argument z is of invalid type - expected number"); -assert(type(snapToGround) == "boolean","Argument snapToGround is of invalid type - expected boolean"); -return numberMock -end - -function Spring.SetFeatureDirection ( featureID, x, y, z) -assert(type(featureID) == "number","Argument featureID is of invalid type - expected number"); -assert(type(x) == "number","Argument x is of invalid type - expected number"); -assert(type(y) == "number","Argument y is of invalid type - expected number"); -assert(type(z) == "number","Argument z is of invalid type - expected number"); -return numberMock -end - -function Spring.SetFeatureVelocity ( featureID, noSelect) - -assert(type(featureID) == "number","Argument featureID is of invalid type - expected number"); -assert(type(noSelect) == "boolean","Argument noSelect is of invalid type - expected boolean"); -return numberMock -end - -function Spring.SetFeatureAlwaysVisible ( featureID, enable) -assert(type(featureID) == "number","Argument featureID is of invalid type - expected number"); -assert(type(enable) == "boolean","Argument enable is of invalid type - expected boolean"); -return numberMock -end - -function Spring.SetFeatureCollisionVolumeData ( ) -return -end - -function Spring.SetUnitCollisionVolumeData ( ) -return booleanMock -end - ----@param featureID number ----@param mpX number new middle positionX of unit ----@param mpY number new middle positionY of unit ----@param mpZ number new middle positionZ of unit ----@param apX number new positionX that enemies aim at on this unit ----@param apY number new positionY that enemies aim at on this unit ----@param apZ number new positionZ that enemies aim at on this unit ----@param relative? boolean are the new coordinates relative to the world (false) or unit (true) coordinates? Also, not that apY is inverted. (default false) ----@return boolean -function Spring.SetFeatureMidAndAimPos ( featureID, mpX, mpY, mpZ, apX, apY, apZ, relative) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(radius) == "number","Argument radius is of invalid type - expected number"); -assert(type(height) == "number","Argument height is of invalid type - expected number"); -return numberMock -end - -function Spring.SetFeatureBlocking ( featureID, blocking, collidable) -assert(type(featureID) == "number","Argument featureID is of invalid type - expected number"); -assert(type(blocking) == "boolean","Argument blocking is of invalid type - expected boolean"); -assert(type(collidable) == "boolean","Argument collidable is of invalid type - expected boolean"); -return numberMock -end - -function Spring.SetFeatureBlocking (unitID, funcID) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(funcID) == "number","Argument funcID is of invalid type - expected number"); -return numberMock -end - -function Spring.CallCOBScriptCB (unitID, funcID) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(funcID) == "number","Argument funcID is of invalid type - expected number"); -return numberMock -end - - -function Spring.SetUnitCOBValue (unitID, COBValue, param1) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(COBValue) == "number","Argument COBValue is of invalid type - expected number"); -assert(type(param1) == "number","Argument param1 is of invalid type - expected number"); -return numberMock -end - -function Spring.GiveOrderToUnit ( ) -return -end - -function Spring.GiveOrderToUnitMap ( ) -return -end - -function Spring.GiveOrderToUnitArray ( ) -return -end - -function Spring.GiveOrderArrayToUnitMap ( ) -return -end - -function Spring.GiveOrderArrayToUnitArray ( ) -return -end - -function Spring.AddGrass ( x, z) -assert(type(x) == "number","Argument x is of invalid type - expected number"); -assert(type(z) == "number","Argument z is of invalid type - expected number"); -return numberMock -end - -function Spring.RemoveGrass ( x, z) -assert(type(x) == "number","Argument x is of invalid type - expected number"); -assert(type(z) == "number","Argument z is of invalid type - expected number"); -return numberMock -end - -function Spring.LevelHeightMap ( x,z) -assert(type(x) == "number","Argument x is of invalid type - expected number"); -assert(type(z) == "number","Argument z is of invalid type - expected number"); -return numberMock -end - -function Spring.AdjustHeightMap ( x,z) -assert(type(x) == "number","Argument x is of invalid type - expected number"); -assert(type(z) == "number","Argument z is of invalid type - expected number"); -return numberMock -end - -function Spring.RevertHeightMap ( x,z) -assert(type(x) == "number","Argument x is of invalid type - expected number"); -assert(type(z) == "number","Argument z is of invalid type - expected number"); -return numberMock -end - -function Spring.SetHeightMapFunc ( ) -return numberMock -end - - - -function Spring.SetHeightMap ( x, z, height, terraform) - -assert(type(x) == "number","Argument x is of invalid type - expected number"); -assert(type(z) == "number","Argument z is of invalid type - expected number"); -assert(type(height) == "number","Argument height is of invalid type - expected number"); -assert(type(terraform) == "number","Argument terraform is of invalid type - expected number"); -return numberMock -end - -function Spring.LevelSmoothMesh ( x,z) -assert(type(x) == "number","Argument x is of invalid type - expected number"); -assert(type(z) == "number","Argument z is of invalid type - expected number"); -return numberMock -end - - -function Spring.AdjustSmoothMesh ( x,z) -assert(type(x) == "number","Argument x is of invalid type - expected number"); -assert(type(z) == "number","Argument z is of invalid type - expected number"); -return numberMock -end - - -function Spring.RevertSmoothMesh ( x,z) -assert(type(x) == "number","Argument x is of invalid type - expected number"); -assert(type(z) == "number","Argument z is of invalid type - expected number"); -return numberMock -end - - -function Spring.SetSmoothMeshFunc ( ) -return numberMock -end - -function Spring.AddSmoothMesh ( x, z, height) - -assert(type(x) == "number","Argument x is of invalid type - expected number"); -assert(type(z) == "number","Argument z is of invalid type - expected number"); -assert(type(height) == "number","Argument height is of invalid type - expected number"); -return numberMock -end - -function Spring.SetSmoothMesh ( -x, z, height, terraform) -assert(type(x) == "number","Argument x is of invalid type - expected number"); -assert(type(z) == "number","Argument z is of invalid type - expected number"); -assert(type(height) == "number","Argument height is of invalid type - expected number"); -assert(type(terraform) == "number","Argument terraform is of invalid type - expected number"); -return numberMock -end - -function Spring.SetMapSquareTerrainType ( x, z) -assert(type(x) == "number","Argument x is of invalid type - expected number"); -assert(type(z) == "number","Argument z is of invalid type - expected number"); -return -end - -function Spring.SetTerrainTypeData ( ) -return booleanMock -end - -function Spring.SetMetalAmount ( x, z, metalAmount) -assert(type(x) == "number","Argument x is of invalid type - expected number"); -assert(type(z) == "number","Argument z is of invalid type - expected number"); -assert(type(metalAmount) == "number","Argument metalAmount is of invalid type - expected number"); -end - - -function Spring.EditUnitCmdDesc (unitID, cmdDescID, cmdArray ) - -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(cmdDescID) == "number","Argument cmdDescID is of invalid type - expected number"); -assert(type(cmdArray) == "table","Argument cmdArray is of invalid type - expected table"); -return numberMock -end - -function Spring.InsertUnitCmdDesc (unitID, cmdDescID, cmdArray) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(cmdDescID) == "number","Argument cmdDescID is of invalid type - expected number"); -assert(type(cmdArray) == "table","Argument cmdArray is of invalid type - expected table"); -return numberMock -end - -function Spring.RemoveUnitCmdDesc (unitID, cmdDescID) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(cmdDescID) == "number","Argument cmdDescID is of invalid type - expected number"); -return numberMock -end - -function Spring.SetNoPause ( noPause) -assert(type(noPause) == "boolean","Argument noPause is of invalid type - expected boolean"); -return booleanMock -end - -function Spring.SetUnitToFeature ( tofeature) -assert(type(tofeature) == "boolean","Argument tofeature is of invalid type - expected boolean"); -return booleanMock -end - -function Spring.SetExperienceGrade ( ) -return numberMock -end - -function Spring.SpawnCEG ( ) -return booleanMock -end - -function Spring.SpawnProjectile ( weaponDefID, projectileParams) -assert(type(weaponDefID) == "number","Argument weaponDefID is of invalid type - expected number"); -assert(type(projectileParams) == "table","Argument projectileParams is of invalid type - expected table"); -return numberMock -end - -function Spring.SetProjectileTarget ( ) -return booleanMock -end - -function Spring.SetProjectileIsIntercepted ( projID) -assert(type(projID) == "number","Argument projID is of invalid type - expected number"); -return numberMock -end - -function Spring.SetProjectileMoveControl ( -projID, enable) -assert(type(projID) == "number","Argument projID is of invalid type - expected number"); -assert(type(enable) == "boolean","Argument enable is of invalid type - expected boolean"); -return numberMock -end - -function Spring.SetProjectilePosition ( projID, x, y, z) -assert(type(projID) == "number","Argument projID is of invalid type - expected number"); -assert(type(x) == "number","Argument x is of invalid type - expected number"); -assert(type(y) == "number","Argument y is of invalid type - expected number"); -assert(type(z) == "number","Argument z is of invalid type - expected number"); -return numberMock -end - -function Spring.SetProjectileVelocity ( projID, x, y, z) -assert(type(projID) == "number","Argument projID is of invalid type - expected number"); -assert(type(x) == "number","Argument x is of invalid type - expected number"); -assert(type(y) == "number","Argument y is of invalid type - expected number"); -assert(type(z) == "number","Argument z is of invalid type - expected number"); -return numberMock -end - -function Spring.SetProjectileCollision ( projID) -assert(type(projID) == "number","Argument projID is of invalid type - expected number"); -return numberMock -end - -function Spring.SetProjectileGravity ( projID, grav) -assert(type(projID) == "number","Argument projID is of invalid type - expected number"); -assert(type(grav) == "number","Argument grav is of invalid type - expected number"); -return numberMock -end - -function Spring.SetProjectileSpinAngle ( projID, spinAngle) -assert(type(projID) == "number","Argument projID is of invalid type - expected number"); -assert(type(spinAngle) == "number","Argument spinAngle is of invalid type - expected number"); -return numberMock -end - -function Spring.SetProjectileSpinSpeed ( projID, speed) -assert(type(projID) == "number","Argument projID is of invalid type - expected number"); -assert(type(speed) == "number","Argument speed is of invalid type - expected number"); -return numberMock -end - -function Spring.SetProjectileSpinVec ( projID, x, y, z) -assert(type(projID) == "number","Argument projID is of invalid type - expected number"); -assert(type(x) == "number","Argument x is of invalid type - expected number"); -assert(type(y) == "number","Argument y is of invalid type - expected number"); -assert(type(z) == "number","Argument z is of invalid type - expected number"); -return numberMock -end - -function Spring.SetProjectileCEG ( projID, ceg_) -assert(type(projID) == "number","Argument projID is of invalid type - expected number"); -assert(type(ceg_) == "string","Argument ceg_ is of invalid type - expected string"); -return numberMock -end - -function Spring.SetPieceProjectileParams ( ) -return numberMock -end - -function Spring.SetProjectileAlwaysVisible ( projectileID, alwaysVisible) -assert(type(projectileID) == "number","Argument projectileID is of invalid type - expected number"); -assert(type(alwaysVisible) == "boolean","Argument alwaysVisible is of invalid type - expected boolean"); -return numberMock -end - -function Spring.SetProjectileDamages (unitID, weaponNum, damages) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(weaponNum) == "number","Argument weaponNum is of invalid type - expected number"); -assert(type(damages) == "table","Argument damages is of invalid type - expected table"); -return numberMock -end - ---================================================================================================== --- End of LuaSyncedCtrl, start of ? ---================================================================================================== - - -function Spring.IsDevLuaEnabled ( ) -return booleanMock - end - -function Spring.IsEditDefsEnabled ( ) -return booleanMock - end - -function Spring.AreHelperAIsEnabled ( ) -return booleanMock - end - -function Spring.FixedAllies ( ) -return booleanMock - end - -function Spring.IsGameOver ( ) -return booleanMock - end - -function Spring.GetRulesInfoMap ( ) -return stringMock - end - -function Spring.GetGameRulesParam ( ruleIndex) - assert(type(ruleIndex) == "number","Argument ruleIndex is of invalid type - expected number"); - return numberMock -end - -function Spring.GetGameRulesParams ( ) - return numberMock -end - -function Spring.GetTeamRulesParam (index, teamID) - assert(type(index) == "number","Argument index is of invalid type - expected number"); - assert(type(teamID) == "number","Argument teamID, is of invalid type - expected number"); - return numberMock -end - -function Spring.GetTeamRulesParams (teamID) - assert(type(teamID) == "number","Argument teamID is of invalid type - expected number"); - return numberMock -end - -function Spring.GetUnitRulesParam (unitID, ruleName) - assert(type(unitID) == "number","Argument index is of invalid type - expected number"); - assert(type(ruleName) == "string","Argument param is of invalid type - expected string"); - return numberMock -end - -function Spring.GetUnitRulesParam (unitID, index) - assert(type(unitID) == "number","Argument index is of invalid type - expected number"); - assert(type(index) == "number","Argument index is of invalid type - expected number"); - return numberMock -end - -function Spring.GetUnitRulesParams (unitID) - assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); - return numberMock -end - -function Spring.GetModOptions ( ) -return stringMock - end - -function Spring.GetMapOptions ( ) -return stringMock - end - -function Spring.GetModOptions.exampleOption () -return numberMock - end - -function Spring.GetGameFrame ( ) -return numberMock - end - -function Spring.GetGameSeconds ( ) -return numberMock - end - -function Spring.GetWind ( ) -return numberMock - end - -function Spring.GetHeadingFromVector ( x, z) -assert(type(x) == "number","Argument x is of invalid type - expected number"); -assert(type(z) == "number","Argument z is of invalid type - expected number"); -return numberMock - end - -function Spring.GetVectorFromHeading ( heading) -assert(type(heading) == "number","Argument heading is of invalid type - expected number"); -return numberMock - end - -function Spring.GetSideData ( sideName) -assert(type(sideName) == "string","Argument sideName is of invalid type - expected string"); -return stringMock - end - -function Spring.GetAllyTeamStartBox ( allyID) -assert(type(allyID) == "number","Argument allyID is of invalid type - expected number"); -return numberMock - end - -function Spring.GetTeamStartPosition ( teamID) -assert(type(teamID) == "number","Argument teamID is of invalid type - expected number"); -return numberMock - end - -function Spring.GetPlayerList ( teamID) -assert(type(teamID) == "number","Argument teamID is of invalid type - expected number"); -return numberMock - end - -function Spring.GetTeamList ( allyTeamID) -assert(type(allyTeamID) == "number","Argument allyTeamID is of invalid type - expected number"); -return numberMock - end - -function Spring.GetAllyTeamList ( ) -return numberMock - end - -function Spring.GetPlayerInfo ( playerID) -assert(type(playerID) == "number","Argument playerID is of invalid type - expected number"); -return numberMock - end - -function Spring.GetPlayerControlledUnit ( playerID) -assert(type(playerID) == "number","Argument playerID is of invalid type - expected number"); -return numberMock - end - -function Spring.GetAIInfo ( teamID) -assert(type(teamID) == "number","Argument teamID is of invalid type - expected number"); -return numberMock - end - -function Spring.GetAllyTeamInfo ( allyteamID) -assert(type(allyteamID) == "number","Argument allyteamID is of invalid type - expected number"); -return tableMock - end - -function Spring.GetTeamInfo ( teamID) -assert(type(teamID) == "number","Argument teamID is of invalid type - expected number"); -return numberMock - end - -function Spring.GetTeamResources ( metal, teamID) -assert(type(metal) == "string","Argument metal is of invalid type - expected string"); -assert(type(teamID) == "number","Argument teamID, is of invalid type - expected number"); -return - end - -function Spring.GetTeamUnitStats ( teamID) -assert(type(teamID) == "number","Argument teamID is of invalid type - expected number"); -return numberMock - end - -function Spring.GetTeamResourceStats ( metal, teamID) -assert(type(metal) == "string","Argument metal is of invalid type - expected string"); -assert(type(teamID) == "number","Argument teamID, is of invalid type - expected number"); -return - end - -function Spring.GetTeamStatsHistory ( teamID, endIndex, startIndex) -assert(type(teamID) == "number","Argument teamID is of invalid type - expected number"); -assert(type(endIndex) == "number","Argument endIndex is of invalid type - expected number"); -assert(type(startIndex) == "number","Argument startIndex is of invalid type - expected number"); -return numberMock - end - -function Spring.GetTeamLuaAI ( teamID) -assert(type(teamID) == "number","Argument teamID is of invalid type - expected number"); -return numberMock - end - -function Spring.AreTeamsAllied ( teamID1) -assert(type(teamID1) == "number","Argument teamID1 is of invalid type - expected number"); -return booleanMock - end - -function Spring.ArePlayersAllied ( playerID1) -assert(type(playerID1) == "number","Argument playerID1 is of invalid type - expected number"); -return booleanMock - end - -function Spring.GetAllUnits ( ) -return numberMock - end - -function Spring.GetTeamUnits ( teamID) -assert(type(teamID) == "number","Argument teamID is of invalid type - expected number"); -return numberMock - end - -function Spring.GetTeamUnitsSorted ( teamID) -assert(type(teamID) == "number","Argument teamID is of invalid type - expected number"); -return - end - -function Spring.GetTeamUnitsCounts ( teamID) -assert(type(teamID) == "number","Argument teamID is of invalid type - expected number"); -return numberMock - end - -function Spring.GetTeamUnitsByDefs ( teamID, unitDefID) -assert(type(teamID) == "number","Argument teamID, is of invalid type - expected number"); -assert(type(unitDefID) == "number","Argument unitDefID is of invalid type - expected number"); -return numberMock - end - -function Spring.GetTeamUnitDefCount ( teamID, unitDefID) -assert(type(teamID) == "number","Argument teamID, is of invalid type - expected number"); -assert(type(unitDefID) == "number","Argument unitDefID is of invalid type - expected number"); -return numberMock - end - -function Spring.GetTeamUnitCount ( teamID) -assert(type(teamID) == "number","Argument teamID is of invalid type - expected number"); -return numberMock - end - -function Spring.GetUnitsInRectangle ( xmin, zmin, xmax, zmax, teamID) -assert(type(xmin) == "number","Argument xmin, is of invalid type - expected number"); -assert(type(teamID) == "number","Argument teamID is of invalid type - expected number"); -assert(type(zmin) == "number","Argument zmin, is of invalid type - expected number"); -assert(type(zmax) == "number","Argument zmax is of invalid type - expected number"); -assert(type(xmax) == "number","Argument xmax, is of invalid type - expected number"); -return tableMock - end - -function Spring.GetUnitsInBox ( xmin, ymin, zmin, xmax, ymax, zmax, teamID) -assert(type(xmin) == "number","Argument xmin, is of invalid type - expected number"); -assert(type(ymin) == "number","Argument ymin, is of invalid type - expected number"); -assert(type(zmin) == "number","Argument zmin, is of invalid type - expected number"); -assert(type(xmax) == "number","Argument xmax, is of invalid type - expected number"); -assert(type(ymax) == "number","Argument ymax, is of invalid type - expected number"); -assert(type(zmax) == "number","Argument zmax, is of invalid type - expected number"); -assert(type(teamID) == "number","Argument teamID is of invalid type - expected number"); -return tableMock - end - -function Spring.GetUnitsInSphere ( radius, y, z, teamID, x) -assert(type(radius) == "number","Argument radius is of invalid type - expected number"); -assert(type(y) == "number","Argument y, is of invalid type - expected number"); -assert(type(z) == "number","Argument z, is of invalid type - expected number"); -assert(type(teamID) == "number","Argument teamID is of invalid type - expected number"); -assert(type(x) == "number","Argument x, is of invalid type - expected number"); -return tableMock - end - -function Spring.GetUnitsInCylinder (x, z, radius, teamID) - assert(type(x) == "number","Argument x, is of invalid type - expected number"); - assert(type(z) == "number","Argument z, is of invalid type - expected number"); - assert(type(radius) == "number","Argument radius is of invalid type - expected number"); - assert(type(teamID) == "number","Argument teamID is of invalid type - expected number"); -return tableMock -end - -function Spring.GetUnitsInPlanes ( ) -return tableMock - end - -function Spring.GetUnitNearestAlly ( range, unitID) -assert(type(range) == "number","Argument range is of invalid type - expected number"); -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -return numberMock - end - -function Spring.GetUnitNearestEnemy ( range, unitID) -assert(type(range) == "number","Argument range is of invalid type - expected number"); -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -return numberMock - end - -function Spring.ValidUnitID (unitID) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -return numberMock - end - -function Spring.GetUnitIsDead (unitID) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -return booleanMock - end - -function Spring.GetUnitIsActive (unitID) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -return booleanMock - end - -function Spring.SetLastMessagePosition ( x, y, z) -assert(type(x) == "number","Argument x is of invalid type - expected number"); -assert(type(y) == "number","Argument y is of invalid type - expected number"); -assert(type(z) == "number","Argument z is of invalid type - expected number"); -return numberMock - end - ---Spring.Echo ( arg1 [, arg2 [, ... ]] ) --- return: nil ----@param msg string -function Spring.Echo ( msg, ... ) - assert(type(msg) == "string","Argument command1 is of invalid type - expected string"); -return - end - -function Spring.Log ( command1, logLevel ) - assert(type(command1) == "string","Argument command1 is of invalid type - expected string"); - assert(type(logLevel) == "string" or type(logLevel) == "number","Argument command1 is of invalid type - expected string or number"); -return - end - -function Spring.SendCommands ( command1) -assert(type(command1) == "string","Argument command1 is of invalid type - expected string"); -return stringMock - end - -function Spring.SetActiveCommand ( action, actionExtra) -assert(type(action) == "string","Argument action is of invalid type - expected string"); -assert(type(actionExtra) == "string","Argument actionExtra is of invalid type - expected string"); -return booleanMock - end - -function Spring.LoadCmdColorsConfig ( config) -assert(type(config) == "string","Argument config is of invalid type - expected string"); -return stringMock - end - -function Spring.LoadCtrlPanelConfig ( config) -assert(type(config) == "string","Argument config is of invalid type - expected string"); -return stringMock - end - -function Spring.ForceLayoutUpdate ( ) -return - end - -function Spring.SetDrawSelectionInfo ( enable) -assert(type(enable) == "boolean","Argument enable is of invalid type - expected boolean"); -return booleanMock - end - -function Spring.SetMouseCursor ( cursorName, scale) -assert(type(cursorName) == "string","Argument cursorName is of invalid type - expected string"); -assert(type(scale) == "number","Argument scale is of invalid type - expected number"); -return stringMock - end - -function Spring.WarpMouse ( x, y) -assert(type(x) == "number","Argument x is of invalid type - expected number"); -assert(type(y) == "number","Argument y is of invalid type - expected number"); -return numberMock - end - -function Spring.SetLosViewColors ( always, LOS, radar, jam, radar2) -assert(type(always) == "table","Argument always is of invalid type - expected table"); -assert(type(LOS) == "table","Argument LOS is of invalid type - expected table"); -assert(type(radar) == "table","Argument radar is of invalid type - expected table"); -assert(type(jam) == "table","Argument jam is of invalid type - expected table"); -assert(type(radar2) == "table","Argument radar2 is of invalid type - expected table"); -return tableMock - end - -function Spring.SendMessage ( message) -assert(type(message) == "string","Argument message is of invalid type - expected string"); -return stringMock - end - -function Spring.SendMessageToPlayer ( playerID, message) -assert(type(playerID) == "number","Argument playerID is of invalid type - expected number"); -assert(type(message) == "string","Argument message is of invalid type - expected string"); -return numberMock - end - -function Spring.SendMessageToTeam ( teamID, message) -assert(type(teamID) == "number","Argument teamID is of invalid type - expected number"); -assert(type(message) == "string","Argument message is of invalid type - expected string"); -return numberMock - end - -function Spring.SendMessageToAllyTeam ( allyID, message) -assert(type(allyID) == "number","Argument allyID is of invalid type - expected number"); -assert(type(message) == "string","Argument message is of invalid type - expected string"); -return numberMock - end - -function Spring.SendMessageToSpectators ( message) -assert(type(message) == "string","Argument message is of invalid type - expected string"); -return stringMock - end - -function Spring.MarkerAddPoint ( x, y, z, text) -assert(type(x) == "number","Argument x is of invalid type - expected number"); -assert(type(y) == "number","Argument y is of invalid type - expected number"); -assert(type(z) == "number","Argument z is of invalid type - expected number"); -assert(type(text) == "string","Argument text is of invalid type - expected string"); -return numberMock - end - -function Spring.MarkerAddLine ( x1) -assert(type(x1) == "number","Argument x1 is of invalid type - expected number"); -return numberMock - end - -function Spring.MarkerErasePosition ( x, y, z) -assert(type(x) == "number","Argument x is of invalid type - expected number"); -assert(type(y) == "number","Argument y is of invalid type - expected number"); -assert(type(z) == "number","Argument z is of invalid type - expected number"); -return numberMock - end - -function Spring.LoadSoundDef ( soundfile) -assert(type(soundfile) == "string","Argument soundfile is of invalid type - expected string"); -return booleanMock - end - -function Spring.PlaySoundFile ( soundfile, volume) -assert(type(soundfile) == "string","Argument soundfile is of invalid type - expected string"); -assert(type(volume) == "number","Argument volume is of invalid type - expected number"); -return booleanMock - end - -function Spring.PlaySoundStream ( oggfile, volume) -assert(type(oggfile) == "string","Argument oggfile is of invalid type - expected string"); -assert(type(volume) == "number","Argument volume is of invalid type - expected number"); -return booleanMock - end - -function Spring.StopSoundStream ( ) -return - end - -function Spring.PauseSoundStream ( ) -return - end - -function Spring.SetSoundStreamVolume ( volume) -assert(type(volume) == "number","Argument volume is of invalid type - expected number"); -return numberMock - end - -function Spring.SendLuaUIMsg ( message, mode) -assert(type(message) == "string","Argument message is of invalid type - expected string"); -assert(type(mode) == "string","Argument mode is of invalid type - expected string"); -return stringMock - end - -function Spring.SendLuaGaiaMsg ( message) -assert(type(message) == "string","Argument message is of invalid type - expected string"); -return stringMock - end - -function Spring.SendLuaRulesMsg ( message) -assert(type(message) == "string","Argument message is of invalid type - expected string"); -return stringMock - end - -function Spring.SendSkirmishAIMessage ( aiTeam, message) -assert(type(aiTeam) == "number","Argument aiTeam is of invalid type - expected number"); -assert(type(message) == "string","Argument message is of invalid type - expected string"); -return booleanMock - end - -function Spring.SetUnitLeaveTracks (unitID, leavetracks) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(leavetracks) == "boolean","Argument leavetracks is of invalid type - expected boolean"); -return numberMock - end - -function Spring.SelectUnitMap ( keyUnitIDvalueAnything, append) -assert(type(keyUnitIDvalueAnything) == "table","Argument keyUnitIDvalueAnything is of invalid type - expected table"); -assert(type(append) == "boolean","Argument append is of invalid type - expected boolean"); -return tableMock - end - -function Spring.SelectUnitArray (unitIDs, append) -assert(type(unitIDs) == "table","Argument unitIDs is of invalid type - expected table"); -assert(type(append) == "boolean","Argument append is of invalid type - expected boolean"); -return tableMock - end - -function Spring.SetDrawSelectionInfo ( drawSelectionInfo) -assert(type(drawSelectionInfo) == "boolean","Argument drawSelectionInfo is of invalid type - expected boolean"); -return booleanMock - end - -function Spring.SetUnitGroup (unitID, groupID) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(groupID) == "number","Argument groupID is of invalid type - expected number"); -return numberMock - end - -function Spring.GiveOrder ( ) -return booleanMock - end - -function Spring.GiveOrderToUnit ( ) -return booleanMock - end - -function Spring.GiveOrderToUnitMap ( ) -return booleanMock - end - -function Spring.GiveOrderToUnitArray ( ) -return booleanMock - end - -function Spring.GiveOrderArrayToUnitMap ( ) -return booleanMock - end - -function Spring.GiveOrderArrayToUnitArray ( ) -return booleanMock - end - -function Spring.SetBuildFacing ( Facing) -assert(type(Facing) == "number","Argument Facing is of invalid type - expected number"); -return numberMock - end - -function Spring.SetBuildSpacing ( Spacing) -assert(type(Spacing) == "number","Argument Spacing is of invalid type - expected number"); -return numberMock - end - -function Spring.SetUnitNoDraw (unitID, noDraw) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(noDraw) == "boolean","Argument noDraw is of invalid type - expected boolean"); -return numberMock - end - -function Spring.SetUnitNoSelect (unitID, noSelect) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(noSelect) == "boolean","Argument noSelect is of invalid type - expected boolean"); -return numberMock - end - -function Spring.SetUnitNoMinimap (unitID, noMinimap) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(noMinimap) == "boolean","Argument noMinimap is of invalid type - expected boolean"); -return numberMock - end - -function Spring.SetDrawSky ( drawSky) -assert(type(drawSky) == "boolean","Argument drawSky is of invalid type - expected boolean"); -return booleanMock - end - -function Spring.SetDrawWater ( drawWater) -assert(type(drawWater) == "boolean","Argument drawWater is of invalid type - expected boolean"); -return booleanMock - end - -function Spring.SetDrawGround ( drawGround) -assert(type(drawGround) == "boolean","Argument drawGround is of invalid type - expected boolean"); -return booleanMock - end - -function Spring.SetWaterParams ( params) -assert(type(params) == "table","Argument params is of invalid type - expected table"); -return tableMock - end - -function Spring.SetLogSectionFilterLevel ( sectionName, logLevel) -assert(type(sectionName) == "string","Argument sectionName is of invalid type - expected string"); -assert(type(logLevel) == "number","Argument logLevel is of invalid type - expected number"); -return booleanMock - end - - -function Spring.SetDrawGroundDeferred ( Activate) -assert(type(Activate) == "boolean","Argument Activate is of invalid type - expected boolean"); -return booleanMock - end - -function Spring.SetDrawModelsDeferred ( Activate) -assert(type(Activate) == "boolean","Argument Activate is of invalid type - expected boolean"); -return booleanMock - end - -function Spring.DrawUnitCommands (unitID) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -return numberMock - end - -function Spring.SetTeamColor ( teamID, r, g, b) -assert(type(teamID) == "number","Argument teamID is of invalid type - expected number"); -assert(type(r) == "number","Argument r is of invalid type - expected number"); -assert(type(g) == "number","Argument g is of invalid type - expected number"); -assert(type(b) == "number","Argument b is of invalid type - expected number"); -return numberMock - end - -function Spring.AssignMouseCursor ( ) -return booleanMock - end - -function Spring.ReplaceMouseCursor ( oldFileName, newFileName, hotSpotTopLeft) -assert(type(oldFileName) == "string","Argument oldFileName is of invalid type - expected string"); -assert(type(newFileName) == "string","Argument newFileName is of invalid type - expected string"); -assert(type(hotSpotTopLeft) == "boolean","Argument hotSpotTopLeft is of invalid type - expected boolean"); -return booleanMock - end - -function Spring.SetCustomCommandDrawData ( ) -return tableMock - end - -function Spring.SetShareLevel ( metal) -assert(type(metal) == "string","Argument metal is of invalid type - expected string"); -return stringMock - end - -function Spring.ShareResources ( teamID, units) -assert(type(teamID) == "number","Argument teamID is of invalid type - expected number"); -assert(type(units) == "string","Argument units is of invalid type - expected string"); -return numberMock - end - ----@param unitID number ----@param damage number ----@param paralyze number # equal to the paralyzetime in WeaponDef ----@param attackerID number ----@param weaponID number ----@param impulse_x number ----@param impulse_y number ----@param impulse_z number ----@see paralyzeDamage ----@see Spring.AddUnitImpulse ----@return nil -function Spring.AddUnitDamage ( unitID, damage, paralyze, attackerID, weaponID, impulse_x, impulse_y, impulse_z ) - return nil -end - -function Spring.AddUnitIcon ( iconName, texFile, size, dist, radAdjust) -assert(type(iconName) == "string","Argument iconName is of invalid type - expected string"); -assert(type(texFile) == "string","Argument texFile is of invalid type - expected string"); -assert(type(size) == "number","Argument size is of invalid type - expected number"); -assert(type(dist) == "number","Argument dist is of invalid type - expected number"); -assert(type(radAdjust) == "boolean","Argument radAdjust is of invalid type - expected boolean"); -return booleanMock - end - -function Spring.FreeUnitIcon ( iconName) -assert(type(iconName) == "string","Argument iconName is of invalid type - expected string"); -return booleanMock - end - -function Spring.SetUnitDefIcon ( unitDefID, iconName) -assert(type(unitDefID) == "number","Argument unitDefID is of invalid type - expected number"); -assert(type(iconName) == "string","Argument iconName is of invalid type - expected string"); -return numberMock - end - -function Spring.SetUnitDefImage ( unitDefID) -assert(type(unitDefID) == "number","Argument unitDefID is of invalid type - expected number"); -return numberMock - end - -function Spring.SetCameraState ( camState, camTime) -assert(type(camState) == "table","Argument camState is of invalid type - expected table"); -assert(type(camTime) == "number","Argument camTime is of invalid type - expected number"); -return booleanMock - end - -function Spring.SetCameraTarget ( x, y, z, transTime) -assert(type(x) == "number","Argument x is of invalid type - expected number"); -assert(type(y) == "number","Argument y is of invalid type - expected number"); -assert(type(z) == "number","Argument z is of invalid type - expected number"); -assert(type(transTime) == "number","Argument transTime is of invalid type - expected number"); -return numberMock - end - -function Spring.SetCameraOffset ( ) -return numberMock - end - -function Spring.ExtractModArchiveFile ( modfile) -assert(type(modfile) == "string","Argument modfile is of invalid type - expected string"); -return stringMock - end - -function Spring.CreateDir ( path) -assert(type(path) == "number","Argument path is of invalid type - expected number"); -return booleanMock - end - -function Spring.GetConfigInt ( name, default, setInOverlay) -assert(type(name) == "string","Argument name is of invalid type - expected string"); -assert(type(default) == "number","Argument default is of invalid type - expected number"); -assert(type(setInOverlay) == "boolean","Argument setInOverlay is of invalid type - expected boolean"); -return numberMock - end - -function Spring.SetConfigInt ( name, value, useOverlay) -assert(type(name) == "string","Argument name is of invalid type - expected string"); -assert(type(value) == "number","Argument value is of invalid type - expected number"); -assert(type(useOverlay) == "boolean","Argument useOverlay is of invalid type - expected boolean"); -return stringMock - end - -function Spring.GetConfigString ( name, default, setInOverlay) -assert(type(name) == "string","Argument name is of invalid type - expected string"); -assert(type(default) == "string","Argument default is of invalid type - expected string"); -assert(type(setInOverlay) == "boolean","Argument setInOverlay is of invalid type - expected boolean"); -return stringMock - end - -function Spring.SetConfigString ( name, value, useOverlay) -assert(type(name) == "string","Argument name is of invalid type - expected string"); -assert(type(value) == "string","Argument value is of invalid type - expected string"); -assert(type(useOverlay) == "boolean","Argument useOverlay is of invalid type - expected boolean"); -return stringMock - end - -function Spring.AddWorldIcon ( cmdID, x, y, z) -assert(type(cmdID) == "number","Argument cmdID is of invalid type - expected number"); -assert(type(x) == "number","Argument x is of invalid type - expected number"); -assert(type(y) == "number","Argument y is of invalid type - expected number"); -assert(type(z) == "number","Argument z is of invalid type - expected number"); -return numberMock - end - -function Spring.AddWorldText ( text, x, y, z) -assert(type(text) == "string","Argument text is of invalid type - expected string"); -assert(type(x) == "number","Argument x is of invalid type - expected number"); -assert(type(y) == "number","Argument y is of invalid type - expected number"); -assert(type(z) == "number","Argument z is of invalid type - expected number"); -return stringMock - end - -function Spring.AddWorldUnit ( ) -return numberMock - end - -function Spring.SetSunManualControl ( setManualControl) -assert(type(setManualControl) == "boolean","Argument setManualControl is of invalid type - expected boolean"); -return booleanMock -end - -function Spring.SetSunParameters ( dirX, dirY, dirZ, dist, startTime, orbitTime) -assert(type(dirX) == "number","Argument dirX is of invalid type - expected number"); -assert(type(dirY) == "number","Argument dirY is of invalid type - expected number"); -assert(type(dirZ) == "number","Argument dirZ is of invalid type - expected number"); -assert(type(dist) == "number","Argument dist is of invalid type - expected number"); -assert(type(startTime) == "number","Argument startTime is of invalid type - expected number"); -assert(type(orbitTime) == "number","Argument orbitTime is of invalid type - expected number"); -return numberMock - end - -function Spring.SetSunDirection ( dirX, dirY, dirZ) -assert(type(dirX) == "number","Argument dirX is of invalid type - expected number"); -assert(type(dirY) == "number","Argument dirY is of invalid type - expected number"); -assert(type(dirZ) == "number","Argument dirZ is of invalid type - expected number"); -return numberMock - end - -function Spring.SetSunLighting ( params) -assert(type(params) == "table","Argument params is of invalid type - expected table"); -return tableMock - end - -function Spring.SetAtmosphere ( params) -assert(type(params) == "table","Argument params is of invalid type - expected table"); -return tableMock - end - -function Spring.Reload ( startscript) -assert(type(startscript) == "string","Argument startscript is of invalid type - expected string"); -return booleanMock -end - - -function Spring.Restart ( commandline_) -assert(type(commandline_) == "string","Argument commandline_ is of invalid type - expected string"); -return booleanMock - end - -function Spring.SetWMIcon ( iconFileName) -assert(type(iconFileName) == "string","Argument iconFileName is of invalid type - expected string"); -return stringMock - end - -function Spring.SetWMCaption ( title, titleShort) -assert(type(title) == "string","Argument title is of invalid type - expected string"); -assert(type(titleShort) == "string","Argument titleShort is of invalid type - expected string"); -return stringMock - end - -function Spring.ClearWatchdogTimer ( threadName) -assert(type(threadName) == "string","Argument threadName is of invalid type - expected string"); -return stringMock - end - -function Spring.SetClipboard ( text) -assert(type(text) == "string","Argument text is of invalid type - expected string"); -return stringMock - end - -function Spring.AddMapLight ( lightParams) -assert(type(lightParams) == "table","Argument lightParams is of invalid type - expected table"); -return tableMock - end - -function Spring.AddModelLight ( lightParams) -assert(type(lightParams) == "table","Argument lightParams is of invalid type - expected table"); -return tableMock - end - -function Spring.UpdateMapLight ( lightHandle, lightParams) -assert(type(lightHandle) == "number","Argument lightHandle is of invalid type - expected number"); -assert(type(lightParams) == "table","Argument lightParams is of invalid type - expected table"); -return numberMock - end - -function Spring.UpdateModelLight ( lightHandle, lightParams) -assert(type(lightHandle) == "number","Argument lightHandle is of invalid type - expected number"); -assert(type(lightParams) == "table","Argument lightParams is of invalid type - expected table"); -return numberMock - end - -function Spring.SetMapLightTrackingState ( ) -return booleanMock - end - -function Spring.SetModelLightTrackingState ( ) -return booleanMock - end - -function Spring.SetMapShadingTexture ( texType, texName) -assert(type(texType) == "string","Argument texType is of invalid type - expected string"); -assert(type(texName) == "string","Argument texName is of invalid type - expected string"); -return stringMock - end - -function Spring.SetMapSquareTexture ( texSqrX, texSqrY, luaTexName) -assert(type(texSqrX) == "number","Argument texSqrX is of invalid type - expected number"); -assert(type(texSqrY) == "number","Argument texSqrY is of invalid type - expected number"); -assert(type(luaTexName) == "string","Argument luaTexName is of invalid type - expected string"); -return numberMock - end - -function Spring.SetMapShader ( standardShaderID, deferredShaderID) -assert(type(standardShaderID) == "number","Argument standardShaderID is of invalid type - expected number"); -assert(type(deferredShaderID) == "number","Argument deferredShaderID is of invalid type - expected number"); -return numberMock - end - - -function Spring.IsReplay ( ) -return booleanMock - end - -function Spring.GetReplayLength ( ) -return numberMock - end - -function Spring.GetSpectatingState ( ) -return booleanMock - end - -function Spring.GetModUICtrl ( ) -return booleanMock - end - -function Spring.GetMyAllyTeamID ( ) -return numberMock - end - -function Spring.GetMyTeamID ( ) -return numberMock - end - -function Spring.GetMyPlayerID ( ) -return numberMock - end - -function Spring.GetLocalPlayerID ( ) -return numberMock - end - -function Spring.GetLocalTeamID ( ) -return numberMock - end - -function Spring.GetLocalAllyTeamID ( ) -return numberMock - end - -function Spring.GetPlayerRoster ( sortType) -assert(type(sortType) == "number","Argument sortType is of invalid type - expected number"); -return numberMock - end - -function Spring.GetTeamColor ( teamID) -assert(type(teamID) == "number","Argument teamID is of invalid type - expected number"); -return numberMock - end - -function Spring.GetTeamOrigColor ( teamID) -assert(type(teamID) == "number","Argument teamID is of invalid type - expected number"); -return numberMock - end - -function Spring.GetPlayerTraffic ( playerID, packetID) -assert(type(playerID) == "number","Argument playerID is of invalid type - expected number"); -assert(type(packetID) == "number","Argument packetID is of invalid type - expected number"); -return numberMock - end - -function Spring.GetSoundStreamTime ( ) -return numberMock - end - -function Spring.GetCameraNames ( ) -return tableMock - end - -function Spring.GetCameraState ( ) -return tableMock - end - -function Spring.GetCameraPosition ( ) -return numberMock - end - -function Spring.GetCameraDirection ( ) -return numberMock - end - -function Spring.GetCameraFOV ( ) -return numberMock - end - -function Spring.GetCameraVectors ( ) -return tableMock - end - -function Spring.GetVisibleUnits ( teamID) -assert(type(teamID) == "number","Argument teamID is of invalid type - expected number"); -return tableMock - end - -function Spring.GetVisibleFeatures ( allyTeamID) -assert(type(allyTeamID) == "number","Argument allyTeamID is of invalid type - expected number"); -return tableMock - end - -function Spring.IsAABBInView ( ) -return booleanMock - end - -function Spring.IsSphereInView ( x, y, z, radius) -assert(type(x) == "number","Argument x is of invalid type - expected number"); -assert(type(y) == "number","Argument y is of invalid type - expected number"); -assert(type(z) == "number","Argument z is of invalid type - expected number"); -assert(type(radius) == "number","Argument radius is of invalid type - expected number"); -return booleanMock - end - -function Spring.IsUnitIcon (unitID) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -return booleanMock - end - -function Spring.IsUnitInView (unitID) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -return booleanMock - end - -function Spring.IsUnitVisible (unitID, radius, checkIcons) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(radius) == "number","Argument radius is of invalid type - expected number"); -assert(type(checkIcons) == "boolean","Argument checkIcons is of invalid type - expected boolean"); -return booleanMock - end - -function Spring.WorldToScreenCoords ( x, y, z) -assert(type(x) == "number","Argument x is of invalid type - expected number"); -assert(type(y) == "number","Argument y is of invalid type - expected number"); -assert(type(z) == "number","Argument z is of invalid type - expected number"); -return numberMock - end - -function Spring.TraceScreenRay ( ) -return - end - -function Spring.GetPixelDir ( x, y) -assert(type(x) == "number","Argument x is of invalid type - expected number"); -assert(type(y) == "number","Argument y is of invalid type - expected number"); -return numberMock - end - -function Spring.GetViewGeometry ( ) -return numberMock - end - -function Spring.GetWindowGeometry ( ) -return numberMock - end - -function Spring.GetScreenGeometry () -return numberMock - end - -function Spring.IsUnitAllied (unitID) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -return booleanMock - end - -function Spring.GetUnitViewPosition (unitID, midPos) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(midPos) == "boolean","Argument midPos is of invalid type - expected boolean"); -return numberMock - end - -function Spring.GetUnitTransformMatrix (unitID, invert) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(invert) == "boolean","Argument invert is of invalid type - expected boolean"); -return numberMock - end - -function Spring.GetSelectedUnits ( ) -return tableMock - end - -function Spring.GetSelectedUnitsSorted ( ) -return tableMock - end - -function Spring.GetSelectedUnitsCounts ( ) -return tableMock - end - -function Spring.GetSelectedUnitsCount ( ) -return numberMock - end - -function Spring.IsUnitSelected (unitID) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -return booleanMock - end - -function Spring.GetUnitGroup (unitID) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -return numberMock - end - -function Spring.GetGroupList ( ) -return tableMock - end - -function Spring.GetSelectedGroup ( ) -return numberMock - end - -function Spring.GetGroupAIName ( groupID) -assert(type(groupID) == "number","Argument groupID is of invalid type - expected number"); -return numberMock - end - -function Spring.GetGroupAIList ( ) -return tableMock - end - -function Spring.GetGroupUnits ( groupID) -assert(type(groupID) == "number","Argument groupID is of invalid type - expected number"); -return tableMock - end - -function Spring.GetGroupUnitsSorted ( groupID) -assert(type(groupID) == "number","Argument groupID is of invalid type - expected number"); -return - end - -function Spring.GetGroupUnitsCounts ( groupID) -assert(type(groupID) == "number","Argument groupID is of invalid type - expected number"); -return tableMock - end - -function Spring.GetGroupUnitsCount ( groupID) -assert(type(groupID) == "number","Argument groupID is of invalid type - expected number"); -return numberMock - end - -function Spring.GetVisibleProjectiles ( ) -return tableMock - end - -function Spring.IsGUIHidden ( ) -return booleanMock - end - -function Spring.HaveShadows ( ) -return booleanMock - end - -function Spring.HaveAdvShading ( ) -return booleanMock - end - -function Spring.GetWaterMode ( ) -return numberMock - end - -function Spring.GetMapDrawMode ( ) -return - end - -function Spring.GetDrawSelectionInfo ( ) -return booleanMock - end - -function Spring.GetUnitLuaDraw (unitID) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -return booleanMock - end - -function Spring.GetUnitNoDraw (unitID) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -return booleanMock - end - -function Spring.GetUnitNoMinimap (unitID) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -return booleanMock - end - -function Spring.GetUnitNoSelect (unitID) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -return booleanMock - end - -function Spring.GetMiniMapGeometry ( ) -return numberMock - end - -function Spring.GetMiniMapDualScreen ( ) -return stringMock - end - -function Spring.IsAboveMiniMap ( x, y) -assert(type(x) == "number","Argument x is of invalid type - expected number"); -assert(type(y) == "number","Argument y is of invalid type - expected number"); -return booleanMock - end - -function Spring.GetActiveCommand ( ) -return numberMock - end - -function Spring.GetDefaultCommand ( ) -return numberMock - end - -function Spring.GetActiveCmdDescs ( ) -return tableMock - end - -function Spring.GetActiveCmdDesc ( index) -assert(type(index) == "number","Argument index is of invalid type - expected number"); -return tableMock - end - -function Spring.GetCmdDescIndex ( cmdID) -assert(type(cmdID) == "number","Argument cmdID is of invalid type - expected number"); -return numberMock - end - -function Spring.GetActivePage ( ) -return numberMock - end - -function Spring.GetBuildFacing ( ) -return numberMock - end - -function Spring.GetBuildSpacing ( ) -return numberMock - end - -function Spring.GetGatherMode ( ) -return numberMock - end - -function Spring.GetInvertQueueKey ( ) -return booleanMock - end - -function Spring.GetMouseState ( ) -return numberMock - end - -function Spring.GetMouseCursor ( ) -return stringMock - end - -function Spring.GetMouseStartPosition ( mouseButton) -assert(type(mouseButton) == "number","Argument mouseButton is of invalid type - expected number"); -return numberMock - end - -function Spring.GetKeyState ( key) -assert(type(key) == "number","Argument key is of invalid type - expected number"); -return booleanMock - end - -function Spring.GetModKeyState ( ) -return booleanMock - end - -function Spring.GetPressedKeys ( ) -return tableMock - end - -function Spring.GetKeyCode ( keysym) -assert(type(keysym) == "string","Argument keysym is of invalid type - expected string"); -return stringMock - end - -function Spring.GetKeySymbol ( key) -assert(type(key) == "number","Argument key is of invalid type - expected number"); -return numberMock - end - -function Spring.GetKeyBindings ( keyset) -assert(type(keyset) == "string","Argument keyset is of invalid type - expected string"); -return tableMock - end - -function Spring.GetActionHotKeys ( action) -assert(type(action) == "string","Argument action is of invalid type - expected string"); -return tableMock - end - -function Spring.GetLastMessagePositions ( ) -return tableMock - end - -function Spring.GetConsoleBuffer ( maxLines) -assert(type(maxLines) == "number","Argument maxLines is of invalid type - expected number"); -return tableMock - end - -function Spring.GetCurrentTooltip ( ) -return stringMock - end - -function Spring.GetLosViewColors ( ) -return tableMock - end - -function Spring.GetConfigParams ( ) -return tableMock - end - -function Spring.GetFPS ( ) -return numberMock - end - -function Spring.GetDrawFrame ( ) -return numberMock - end - -function Spring.GetGameSpeed ( ) -return numberMock - end - -function Spring.GetFrameTimeOffset ( ) -return numberMock - end - -function Spring.GetLastUpdateSeconds ( ) -return numberMock - end - -function Spring.GetHasLag ( ) -return booleanMock - end - -function Spring.GetTimer ( ) -return numberMock - end - -function Spring.DiffTimers ( timercur, timerago, inMilliseconds) -assert(type(timercur) == "number","Argument timercur is of invalid type - expected number"); -assert(type(timerago) == "number","Argument timerago is of invalid type - expected number"); -assert(type(inMilliseconds) == "boolean","Argument inMilliseconds is of invalid type - expected boolean"); -return numberMock - end - -function Spring.GetMapSquareTexture ( texSqrX, texSqrY, texMipLvl, luaTexName) -assert(type(texSqrX) == "number","Argument texSqrX is of invalid type - expected number"); -assert(type(texSqrY) == "number","Argument texSqrY is of invalid type - expected number"); -assert(type(texMipLvl) == "number","Argument texMipLvl is of invalid type - expected number"); -assert(type(luaTexName) == "string","Argument luaTexName is of invalid type - expected string"); -return numberMock - end - -function Spring.GetLogSections ( ) -return tableMock - end - -function Spring.GetClipboard ( ) -return stringMock - end - -function gl.Flush() - return nil -end - -function gl.Finish() - return nil -end - -function gl.GetSun() - return numberMock, numberMock, numberMock -end - -function gl.GetAtmosphere(name) - assert(type(name) == "string","Argument name is of invalid type - expected string"); - - return numberMock, numberMock, numberMock -end - -function gl.GetWaterRendering(name) - assert(type(name) == "string","Argument name is of invalid type - expected string"); - - return numberMock, numberMock, numberMock -end - -function gl.GetMapRendering(name) - assert(type(name) == "string","Argument name is of invalid type - expected string"); - - return numberMock, numberMock, numberMock -end - -function gl.ConfigScreen(screenWidth, screenDistance) - assert(type(screenWidth) == "number","Argument screenWidth is of invalid type - expected number"); - assert(type(screenDistance) == "number","Argument screenDistance is of invalid type - expected number"); - - return nil -end - -function gl.DrawMiniMap(transform) - assert(type(transform) == "boolean","Argument transform is of invalid type - expected boolean"); - - return nil -end - -function gl.SlaveMiniMap(mode) - assert(type(mode) == "boolean","Argument mode is of invalid type - expected boolean"); - - return nil -end - -function gl.ConfigMiniMap(intPX, intPY, intSX, intSY) - assert(type(intPX) == "number","Argument intPX is of invalid type - expected number"); - assert(type(intPY) == "number","Argument intPY is of invalid type - expected number"); - assert(type(intSX) == "number","Argument intSX is of invalid type - expected number"); - assert(type(intSY) == "number","Argument intSY is of invalid type - expected number"); - - return nil -end - -function gl.GetViewSizes() - return numberMock, numberMock -end - ---==================================================================================================== --- Deprecated functions ---==================================================================================================== - ----@param unitID number ----@param fuel number ----@deprecated -function Spring.SetUnitFuel (unitID, fuel) - assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); - assert(type(fuel) == "number","Argument fuel is of invalid type - expected number"); - return numberMock -end - ----@deprecated ----@param unitID number ----@param teamID number ----@param isRoot boolean ----@return integer ----@deprecated -function Spring.SetUnitLineage (unitID, teamID, isRoot) -assert(type(unitID) == "number","Argument unitID is of invalid type - expected number"); -assert(type(teamID) == "number","Argument teamID is of invalid type - expected number"); -assert(type(isRoot) == "boolean","Argument isRoot is of invalid type - expected boolean"); -return numberMock -end - ---gl.Viewport ( number x, number y, number w, number h ) ---return: nil ---gl.PushMatrix ( ) ---return: nil ---gl.PopMatrix ( ) ---return: nil ---gl.Translate ( number x, number y, number z ) ---return: nil ---gl.Scale ( number x, number y, number z ) ---return: nil ---gl.Scale ( number angle, number x, number y, number z ) ---return: nil ---gl.Billboard ( ) ---return: nil ---gl.MatrixMode ( number mode ) ---return: nil ---gl.LoadIdentity ( ) ---return: nil ---gl.LoadMatrix ( 16 numbers or a matrix name ) ---return: nil ---gl.MultMatrix ( ??? ) ---return: ??? ---gl.Ortho ( number left, number right, number bottom, number top, number near, number far ) ---return: nil ---gl.Frustum ( number left, number right, number bottom, number top, number near, number far ) ---return: nil ---gl.PushPopMatrix ( ??? ) ---return: ??? ---gl.ClipPlane ( number intPlane, bool enable | number A, number B, number C, number D ) ---return: nil ---gl.Clear ( GL.DEPTH_BUFFER_BIT [, number cleardepth ] ) ---return: nil ---gl.SwapBuffers ( ) ---return: nil ---gl.ResetState ( ) ---return: nil ---gl.ResetMatrices ( ) ---return: nil ---gl.BeginEnd ( number GLType, function [, arg1, ... ] ) ---return: nil ---gl.Color ( number r, number g, number b [, number a ] | table colors = { number r, number g, number b [, number a ] } ) ---return: nil ---gl.Vertex ( table vertex = { number x, number y, [, number z [, number w ]] } ) ---return: nil ---gl.Vertex ( number x, number y ) ---return: nil ---gl.Vertex ( number x, number y, number z ) ---return: nil ---gl.Vertex ( number x, number y, number z, number w ) ---return: nil ---gl.Normal ( table normal = { number x, number y, number z } | number x, number y, number z ) ---return: nil ---gl.EdgeFlag ( bool enable ) ---return: nil ---gl.Rect ( number x1, number y1, number x2, number y2 ) ---return: nil ---gl.TexRect ( number x1, number y1, number x2, number y2 [, bool flip_s, bool flip_t | number s1, number t1, number s2, number t2 ] ) ---return: nil ---gl.Shape ( number GLtype, table elements ) ---return: nil ---gl.SecondaryColor ( table color = { number r, number g, number b } | number r, number g, number b ) ---return: nil ---gl.FogCoord ( number value ) ---return: nil ---gl.CreateList ( function [, arg1 [, arg2 ... ]] ) ---return: number listID ---gl.CallList ( number listID ) ---return: nil ---gl.DeleteList ( number listID ) ---return: nil ---gl.CreateVertexArray ( number numElements, number numIndices [, bool persistentBuffer = false ] ) ---return: number bufferID ---gl.UpdateVertexArray ( number bufferID, number elementPos, number indexPos, table tbl | function func ) ---return: bool success ---gl.RenderVertexArray ( number bufferID, number primType [, number firstIndex = 0, number count = numElements ] ) ---return: bool success ---gl.DeleteVertexArray ( number bufferID ) ---return: bool success ---gl.Text ( string "text", number x, number y, number size [, string "options" ] ) ---return: nil ---gl.GetTextWidth ( string "text" ) ---return: number width ---gl.GetTextHeight ( string "text" ) ---return: nil | number height, number descender, number numlines ---gl.BeginText ( ) ---return: nil ---gl.EndText ( ) ---return: nil ---gl.Unit ( number unitID [, bool rawdraw, number intLOD ] ) ---return: nil ---gl.UnitRaw ( number unitID [, bool rawdraw, number intLOD ] ) ---return: nil ---gl.UnitShape ( number unitDefID, number teamID, bool rawState, bool toScreen, bool opaque ) ---return: nil ---gl.UnitMultMatrix ( number unitID ) ---return: nil ---gl.UnitPieceMultMatrix ( number unitID, number intPiece ) ---return: nil ---gl.UnitPiece ( number unitID, number intPiece ) ---return: nil ---gl.UnitPieceMatrix ( number unitID, number intPiece ) ---return: nil ---gl.Feature ( number featureID ) ---return: nil ---gl.FeatureRaw ( number featureID [, bool rawdraw, number intLOD ] ) ---return: nil ---gl.FeatureShape ( number featureDefID, number teamID, bool custom, bool drawScreen, bool opaque ) ---return: nil ---gl.FeatureMultMatrix ( number featureID ) ---return: nil ---gl.FeaturePieceMultMatrix ( number featureID, number intPiece ) ---return: nil ---gl.FeaturePiece ( number featureID, number intPiece ) ---return: nil ---gl.FeaturePieceMatrix ( number featureID, number intPiece ) ---return: nil ---gl.DrawListAtUnit ( number unitID, number listID [, bool midPos, number scaleX, number scaleY, number scaleZ, number degrees, number rotX, number rotY, number rotZ ] ) ---return: nil ---gl.DrawFuncAtUnit ( number unitID, bool midPos, function [, arg1, ... ] ) ---return: nil ---gl.Blending ( bool enable | number srcmode, number dstmode ) ---return: nil ---gl.Blending ( string mode ) ---return: nil ---gl.BlendEquation ( number mode ) ---return: nil ---gl.BlendFunc ( number srcmode, number dstmode ) ---return: nil ---gl.BlendEquationSeparate ( number modeRGB, number modeAlpha ) ---return: nil ---gl.BlendFuncSeparate ( number srcRGB, number [Lua_ConstGL#BlendingFactorDest, number srcAlpha, number dstAlpha ) ---return: nil ---gl.AlphaTest ( bool enable | number func, number threshold ) ---return: nil ---gl.DepthTest ( bool enable | number func ) ---return: nil ---gl.Culling ( bool enable | number face ) ---return: nil ---gl.DepthClamp ( bool enable ) ---return: nil ---gl.DepthMask ( bool enable ) ---return: nil ---gl.ColorMask ( bool masked ) ---return: nil ---gl.ColorMask ( bool r, bool g, bool b, bool a ) ---return: nil ---gl.LogicOp ( bool enable | number func ) ---return: nil ---gl.Fog ( bool enable ) ---return: nil ---gl.Smoothing ( bool enable | number point, bool enable | number line, bool enable | number polygon ) ---return: nil ---gl.EdgeFlag ( bool enable ) ---return: nil ---gl.Scissor ( bool enable ) ---return: nil ---gl.Scissor ( number intX, number intY, number intW, number intH ) ---return: nil ---gl.LineStipple ( string any ) ---return: nil ---gl.LineStipple ( bool enable ) ---return: nil ---gl.LineStipple ( number intFactor, number pattern ) ---return: nil ---gl.PolygonMode ( number face, number mode ) ---return: nil ---gl.PolygonOffset ( bool enable | number factor, number units ) ---return: nil ---gl.PushAttrib ( [ number attrib ] ) ---return: nil ---gl.PopAttrib ( ) ---return: nil ---gl.StencilTest ( bool enable ) ---return: nil ---gl.StencilMask ( number mask ) ---return: nil ---gl.StencilFunc ( number func, number ref, number mask ) ---return: nil ---gl.StencilOp ( number fail, number zfail, number zpass ) ---return: nil ---gl.StencilMaskSeparate ( number face, number mask ) ---return: nil ---gl.StencilFuncSeparate ( number face, number func, number ref, number mask ) ---return: nil ---gl.StencilOpSeparate ( number face, number fail, number zfail, number zpass ) ---return: nil ---gl.LineWidth ( number width ) ---return: nil ---gl.PointSize ( number size ) ---return: nil ---gl.PointSprite ( bool enable [, bool coord_replace, bool coord_origin_upper ] ) ---return: nil ---gl.PointParameter ( number v1, number v2, number v3 [, number sizeMin, number sizeMax, number sizeFade ] ) ---return: nil ---gl.Texture ( [ number texNum, ] bool enable | string name ) ---return: nil | bool loaded ---gl.CreateTexture ( number intXSize, number intYSize [, table texProps ] ) ---return: string texture ---gl.DeleteTexture ( string texture ) ---return: bool deleted ---gl.DeleteTextureFBO ( string texture ) ---return: bool deleted ---gl.TextureInfo ( string texture ) ---return: nil | table texInfo ---gl.MultiTexCoord ( number x [, number y [, number z [, number w ]]] | table texCoords = { number x [, number y [, number z [, number w ]]] } ) ---return: nil ---gl.TexEnv ( number target, number pname, number var1, number var2, number var3 ) ---return: nil ---gl.MultiTexEnv ( number texNum, number target, number pname, number var1, number var2, number var3 ) ---return: nil ---gl.TexGen ( number target, bool pname, number var1, number var2, number var3 ) ---return: nil ---gl.MultiTexGen ( number intTexNum, number target, number pname, number var1, number var2, number var3 ) ---return: nil ---gl.CopyToTexture ( string texture, number intXOff, number intYOff, number intX, number intY, number intW, number intH [, number target, number level ] ) ---return: nil ---gl.RenderToTexture ( string fbotexture, function lua_func ) ---return: nil ---gl.GenerateMipmap ( string texture ) ---return: bool created ---gl.UnitTextures ( number unitID, bool enable ) ---return: bool enabled ---gl.UnitShapeTextures ( number unitDefID, bool enable ) ---return: bool enabled ---gl.FeatureTextures ( number featureID, bool enable ) ---return: bool enabled ---gl.FeatureShapeTextures ( number featureDefID, bool enable ) ---return: bool enabled ---gl.SaveImage ( number x, number y, number w, number h, string filename [, table imgProps = { alpha=bool, yflip=bool, grayscale16bit=bool, readbuffer=number } ] ) ---return: nil | bool success ---gl.ReadPixels ( number x, number y, number w, number h [, number format = GL.RGBA ] ) ---return: nil | number r [, g [, b [, a {rbracket ---gl.Lighting ( bool enable ) ---return: nil ---gl.ShadeModel ( number mode ) ---return: nil ---gl.Light ( number intLight, bool enable ) ---return: nil ---gl.Material ( table material ) ---return: nil ---gl.HasExtension ( string extname ) ---return: bool hasExtension ---gl.GetNumber ( number ext, number intCount ) ---return: number number1 [, number number2, number number3, ... #count ] ---gl.GetString ( number ext ) ---return: string extString ---gl.DrawGroundCircle ( number x, number y, number z, number radius, number divs [, number slope ] ) ---return: nil ---gl.DrawGroundQuad ( number x1, number z1, number x2, number z2 [, bool useNorm [, number tu1, number tv1, number tu2, number tv2 ] | [ bool useTextureCoord ] ] ) ---return: nil ---gl.CreateQuery ( ) ---return: nil | userdata query ---gl.DeleteQuery ( userdata query ) ---return: nil ---gl.RunQuery ( userdata query, function func, arg1, arg2, ... ) ---return: nil ---gl.GetQuery ( userdata query ) ---return: nil | number renderedFragments ---gl.ActiveTexture ( number intTexNum, function func [, arg1, ... ] ) ---return: nil ---gl.GetGlobalTexNames ( ) ---return: table texNames = { [1] = string texture, etc ... } ---gl.GetGlobalTexCoords ( string 3doTextureName ) ---return: number xstart, number ystart, number xend, number yend ---gl.UnsafeState ( number state [, bool disable_state ], bool func, arg1, arg2, ... ) ---return: nil ---gl.GetShadowMapParams ( ) ---return: number xmid, number ymid, number p17, number p18 ---gl.GetMatrixData ( string "billboard" ) ---return: nil | number number1, etc... diff --git a/luamocks/Widgets.lua b/luamocks/Widgets.lua deleted file mode 100644 index 6449f389e23..00000000000 --- a/luamocks/Widgets.lua +++ /dev/null @@ -1,8 +0,0 @@ -local numberMock =42 -local stringMock ="TestString" -local tableMock ={exampletable= true} -local booleanMock =true -local functionMock = function (bar) return bar; end - -widget = {} -WG = {} diff --git a/luamocks/autogenerated/BitOps.lua b/luamocks/autogenerated/BitOps.lua deleted file mode 100644 index a84f47f0793..00000000000 --- a/luamocks/autogenerated/BitOps.lua +++ /dev/null @@ -1,40 +0,0 @@ ----BitOps - ---- ----Parameters ----@param a1 number ----@param a2 number ----@param a3 number (optional) ----@param an number (optional) ----@return number i -function math.bit_or(a1, a2[, a3[, an]]) end - ----Parameters ----@param a1 number ----@param a2 number ----@param a3 number (optional) ----@param an number (optional) ----@return number i -function math.bit_and(a1, a2[, a3[, an]]) end - ----Parameters ----@param a1 number ----@param a2 number ----@param a3 number (optional) ----@param an number (optional) ----@return number i -function math.bit_xor(a1, a2[, a3[, an]]) end - ----Parameters ----@param a1 number ----@return number i -function math.bit_inv(a1) end - ----Parameters ----@param a1 number ----@param a2 number ----@param a3 number (optional) ----@param an number (optional) ----@return number i -function math.bit_bits(a1, a2[, a3[, an]]) end - diff --git a/luamocks/autogenerated/LuaHandle.lua b/luamocks/autogenerated/LuaHandle.lua deleted file mode 100644 index 92d92c317ca..00000000000 --- a/luamocks/autogenerated/LuaHandle.lua +++ /dev/null @@ -1,435 +0,0 @@ ----LuaHandle - ---- ----@return nil -function Shutdown() end - ----Parameters ----@param msg string ----@param playerID number ----Parameters ----@param zipReader table - ---- ----Parameters ----@param winningAllyTeams {number,...} ----Parameters ----@param playerID number ----@param paused boolean ----Parameters ----@param frame number ----Parameters ----@param gameID string - ---- ----Parameters ----@param teamID number ----Parameters ----@param teamID number ----Parameters ----@param playerID number ----Parameters ----@param playerID number ----Parameters ----@param playerID number ----@param reason string - ---- ----Parameters ----@param unitID number ----@param unitDefID number ----@param unitTeam number ----@param builderID number (optional) ----Parameters ----@param unitID number ----@param unitDefID number ----@param unitTeam number ----Parameters ----@param unitID number ----@param unitDefID number ----@param unitTeam number ----@param factID number ----@param factDefID number ----@param userOrders boolean ----Parameters ----@param unitID number ----@param unitDefID number ----@param unitTeam number ----Parameters ----@param unitID number ----@param unitDefID number ----@param unitTeam number ----@param attackerID number ----@param attackerDefID number ----@param attackerTeam number ----Parameters ----@param unitID number ----@param unitDefID number ----@param oldTeam number ----@param newTeam number ----Parameters ----@param unitID number ----@param unitDefID number ----@param oldTeam number ----@param newTeam number ----Parameters ----@param unitID number ----@param unitDefID number ----@param unitTeam number ----Parameters ----@param unitID number ----@param unitDefID number ----@param unitTeam number ----@param cmdID number ----@param cmdParams table ----@param cmdOpts cmdOpts ----@param cmdTag number ----Parameters ----@param unitID number ----@param unitDefID number ----@param unitTeam number ----@param cmdID number ----@param cmdParams table ----@param cmdOpts cmdOpts ----@param cmdTag number ----Parameters ----@param unitID number ----@param unitDefID number ----@param unitTeam number ----@param damage number ----@param paralyzer number ----@param weaponDefID number ----@param projectileID number ----@param attackerID number ----@param attackerDefID number ----@param attackerTeam number ----Parameters ----@param unitID number ----@param unitDefID number ----@param unitTeam number ----@param stunned boolean ----Parameters ----@param unitID number ----@param unitDefID number ----@param unitTeam number ----@param experience number ----@param oldExperience number ----Parameters ----@param unitID number ----@param unitDefID number ----@param unitTeam number ----Parameters ----@param x number ----@param y number ----@param z number ----@param strength number ----@param allyTeam number ----@param unitID number ----@param unitDefID number ----Parameters ----@param unitID number ----@param unitTeam number ----@param allyTeam number ----@param unitDefID number ----Parameters ----@param unitID number ----@param unitTeam number ----@param allyTeam number ----@param unitDefID number ----Parameters ----@param unitID number ----@param unitTeam number ----@param allyTeam number ----@param unitDefID number ----Parameters ----@param unitID number ----@param unitTeam number ----@param allyTeam number ----@param unitDefID number - ---- ----Parameters ----@param unitID number ----@param unitDefID number ----@param unitTeam number ----@param transportID number ----@param transportTeam number ----Parameters ----@param unitID number ----@param unitDefID number ----@param unitTeam number ----@param transportID number ----@param transportTeam number - ---- ----Parameters ----@param unitID number ----@param unitDefID number ----@param unitTeam number ----Parameters ----@param unitID number ----@param unitDefID number ----@param unitTeam number ----Parameters ----@param unitID number ----@param unitDefID number ----@param unitTeam number ----Parameters ----@param unitID number ----@param unitDefID number ----@param unitTeam number ----Parameters ----@param unitID number ----@param unitDefID number ----@param unitTeam number ----Parameters ----@param unitID number ----@param unitDefID number ----@param unitTeam number ----Parameters ----@param unitID number ----@param unitDefID number ----@param unitTeam number ----Parameters ----@param unitID number ----@param unitDefID number ----@param unitTeam number ----Parameters ----@param colliderID number ----@param collideeID number ----Parameters ----@param colliderID number ----@param collideeID number ----Parameters ----@param unitID number ----@param unitDefID number ----@param unitTeam number ----Parameters ----@param unitID number ----@param unitDefID number ----@param unitTeam number - ---- ----Parameters ----@param featureID number ----@param allyTeamID number ----Parameters ----@param featureID number ----@param allyTeamID number ----Parameters ----@param featureID number ----@param featureDefID number ----@param featureTeam number ----@param damage number ----@param weaponDefID number ----@param projectileID number ----@param attackerID number ----@param attackerDefID number ----@param attackerTeam number - ---- ----Parameters ----@param proID number ----@param proOwnerID number ----@param weaponDefID number ----Parameters ----@param proID number ----@param ownerID number ----@param proWeaponDefID number ----Parameters ----@param weaponDefID number ----@param px number ----@param py number ----@param pz number ----@param attackerID number ----@param projectileID number ----@return bool noGfx if then no graphical effects are drawn by the engine for this explosion. -function Explosion(weaponDefID, px, py, pz, attackerID, projectileID) end - ----Parameters ----@param unitID number ----@param unitDefID number ----@param unitTeam number ----@param weaponNum number ----@param oldCount number ----@param newCount number ----Parameters ----@param msg string ----@param playerID number ----Parameters ----@param zip table ----@return x1 -function UnsyncedHeightMapUpdate() end - ----@return z1 -function UnsyncedHeightMapUpdate() end - ----@return x2 -function UnsyncedHeightMapUpdate() end - ----@return z2 -function UnsyncedHeightMapUpdate() end - ----Parameters ----@param dt number ----Parameters ----@param viewSizeX number ----@param viewSizeY number ----Parameters ----@param type string ----@param id integer - ---- ----Parameters ----@param viewSizeX number ----@param viewSizeY number ----Parameters ----@param viewSizeX number ----@param viewSizeY number ----Parameters ----@param viewSizeX number ----@param viewSizeY number ----Parameters ----@param sx number ----@param sy number ----Parameters ----@param sx number ----@param sy number ----Parameters ----@param serverFrameNum integer - ---- ----Fields ----@param right bool ----@param alt bool ----@param ctrl bool ----@param shift bool ----Parameters ----@param keyCode number ----@param mods mods ----@param isRepeat boolean ----@param label boolean ----@param utf32char number ----@param scanCode number ----@param actionList table ----@return boolean halt whether to halt the chain for consumers of the keypress -function KeyPress(keyCode, mods, isRepeat, label, utf32char, scanCode, actionList) end - ----Parameters ----@param keyCode number ----@param mods mods ----@param label boolean ----@param utf32char number ----@param scanCode number ----@param actionList table ----@return bool -function KeyRelease(keyCode, mods, label, utf32char, scanCode, actionList) end - ----Parameters ----@param utf8char string ----Parameters ----@param utf8 string ----@param start number ----@param length number ----Parameters ----@param x number ----@param y number ----@param button number ----@return boolean becomeMouseOwner -function MousePress(x, y, button) end - ----Parameters ----@param x number ----@param y number ----@param button number ----@return boolean becomeMouseOwner -function MouseRelease(x, y, button) end - ----Parameters ----@param x number ----@param y number ----@param dx number ----@param dy number ----@param button number ----Parameters ----@param up boolean ----@param value number ----Parameters ----@param x number ----@param y number ----@return boolean isAbove -function IsAbove(x, y) end - ----Parameters ----@param x number ----@param y number ----@return string tooltip -function GetTooltip(x, y) end - ----Fields ----@param coded integer ----@param alt boolean ----@param ctrl boolean ----@param shift boolean ----@param right boolean ----@param meta boolean ----@param internal boolean ----Parameters ----@param cmdID integer ----@param cmdParams table ----@param cmdOpts cmdOpts ----@return boolean Returning true deletes the command and does not send it through the network. -function CommandNotify(cmdID, cmdParams, cmdOpts) end - ----Parameters ----@param msg string ----@param priority integer ----Parameters ----@param groupID number ----Parameters ----@param ttType string ----@param data1 number ----@param data2 number (optional) ----@param data3 number (optional) ----@return string newTooltip -function WorldTooltip(ttType, data1[, data2[, data3]]) end - ----Parameters ----@param playerID number ----@param type string ----@param posX number ----@param posY number ----@param posZ number ----@param data4 string|number ----@param pos2Y number (optional) ----@param pos2Z number (optional) ----Parameters ----@param state string ----@param ready boolean ----@param playerStates table ----@return bool success -function GameSetup(state, ready, playerStates) end - ----@return bool newReady -function GameSetup(state, ready, playerStates) end - ----Parameters ----@param aiTeam integer ----@param dataStr string - ---- ----Parameters ----@param id number ----@param name string ----@param type string ----Parameters ----@param id number ----Parameters ----@param id number ----Parameters ----@param id number ----@param errorID number ----Parameters ----@param id number ----@param downloaded number ----@param total number diff --git a/luamocks/autogenerated/LuaHandleSynced.lua b/luamocks/autogenerated/LuaHandleSynced.lua deleted file mode 100644 index 14756f3f460..00000000000 --- a/luamocks/autogenerated/LuaHandleSynced.lua +++ /dev/null @@ -1,312 +0,0 @@ ----LuaHandleSynced - ---- ----Parameters ----@param arg1 any ----@param arg2 any ----@param argn any - ---- ----Parameters ----@param unitID number ----@param drawMode number ----@return bool suppressEngineDraw -function DrawUnit(unitID, drawMode) end - ----Parameters ----@param featureID number ----@param drawMode number ----@return bool suppressEngineDraw -function DrawFeature(featureID, drawMode) end - ----Parameters ----@param featureID number ----@param weaponID number ----@param drawMode number ----@return bool suppressEngineDraw -function DrawShield(featureID, weaponID, drawMode) end - ----Parameters ----@param projectileID number ----@param drawMode number ----@return bool suppressEngineDraw -function DrawProjectile(projectileID, drawMode) end - ----Parameters ----@param uuid number ----@param drawMode number ----@return bool suppressEngineDraw -function DrawMaterial(uuid, drawMode) end - ----Parameters ----@param unitID number ----@param unitDefID number ----@param unitTeam number ----@param cmdID number ----@param cmdParams {number,...} ----@param cmdOptions cmdOptions ----@param cmdTag number ----@return boolean whether to remove the command from the queue -function CommandFallback(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag) end - ----Parameters ----@param unitID number ----@param unitDefID number ----@param unitTeam number ----@param cmdID number ----@param cmdParams {number,...} ----@param cmdOptions cmdOptions ----@param cmdTag number ----@param synced boolean ----@param fromLua boolean ----@return bool whether it should be let into the queue. -function AllowCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag, synced, fromLua) end - ----Parameters ----@param unitDefID number ----@param builderID number ----@param builderTeam number ----@param x number ----@param y number ----@param z number ----@param facing number ----@return bool whether or not the creation is permitted. -function AllowUnitCreation(unitDefID, builderID, builderTeam, x, y, z, facing) end - ----Parameters ----@param unitID number ----@param unitDefID number ----@param oldTeam number ----@param newTeam number ----@param capture boolean ----@return bool whether or not the transfer is permitted. -function AllowUnitTransfer(unitID, unitDefID, oldTeam, newTeam, capture) end - ----Parameters ----@param builderID number ----@param builderTeam number ----@param unitID number ----@param unitDefID number ----@param part number ----@return bool whether or not the build makes progress. -function AllowUnitBuildStep(builderID, builderTeam, unitID, unitDefID, part) end - ----Parameters ----@param builderID number ----@param builderTeam number ----@param unitID number ----@param unitDefID number ----@param part number ----@return bool whether or not the capture makes progress. -function AllowUnitCaptureStep(builderID, builderTeam, unitID, unitDefID, part) end - ----Parameters ----@param transporterID number ----@param transporterUnitDefID number ----@param transporterTeam number ----@param transporteeID number ----@param transporteeUnitDefID number ----@param transporteeTeam number ----@return bool whether or not the transport is allowed -function AllowUnitTransport(transporterID, transporterUnitDefID, transporterTeam, transporteeID, transporteeUnitDefID, transporteeTeam) end - ----Parameters ----@param transporterID number ----@param transporterUnitDefID number ----@param transporterTeam number ----@param transporteeID number ----@param transporteeUnitDefID number ----@param transporteeTeam number ----@param x number ----@param y number ----@param z number ----@return bool whether or not the transport load is allowed -function AllowUnitTransportLoad(transporterID, transporterUnitDefID, transporterTeam, transporteeID, transporteeUnitDefID, transporteeTeam, x, y, z) end - ----Parameters ----@param transporterID number ----@param transporterUnitDefID number ----@param transporterTeam number ----@param transporteeID number ----@param transporteeUnitDefID number ----@param transporteeTeam number ----@param x number ----@param y number ----@param z number ----@return bool whether or not the transport unload is allowed -function AllowUnitTransportUnload(transporterID, transporterUnitDefID, transporterTeam, transporteeID, transporteeUnitDefID, transporteeTeam, x, y, z) end - ----Parameters ----@param unitID number ----@param enemyID number (optional) ----@return bool whether unit is allowed to cloak -function AllowUnitCloak(unitID[, enemyID]) end - ----Parameters ----@param unitID number ----@param objectID number (optional) ----@param weaponNum number (optional) ----@return bool whether unit is allowed to decloak -function AllowUnitCloak(unitID[, objectID[, weaponNum]]) end - ----Parameters ----@param unitID number ----@param targetID number ----@return bool whether unit is allowed to selfd -function AllowUnitKamikaze(unitID, targetID) end - ----Parameters ----@param featureDefID number ----@param teamID number ----@param x number ----@param y number ----@param z number ----@return bool whether or not the creation is permitted -function AllowFeatureCreation(featureDefID, teamID, x, y, z) end - ----Parameters ----@param builderID number ----@param builderTeam number ----@param featureID number ----@param featureDefID number ----@param part number ----@return bool whether or not the change is permitted -function AllowFeatureBuildStep(builderID, builderTeam, featureID, featureDefID, part) end - ----Parameters ----@param teamID number ----@param res string ----@param level number ----@return bool whether or not the sharing level is permitted -function AllowResourceLevel(teamID, res, level) end - ----Parameters ----@param oldTeamID number ----@param newTeamID number ----@param res string ----@param amount number ----@return bool whether or not the transfer is permitted. -function AllowResourceTransfer(oldTeamID, newTeamID, res, amount) end - ----Parameters ----@param unitID number ----@param unitDefID number ----@param unitTeam number ----@param playerID number ----@return bool allow -function AllowDirectUnitControl(unitID, unitDefID, unitTeam, playerID) end - ----Parameters ----@param unitID number ----@param unitDefID number ----@param action number ----@return bool actionAllowed -function AllowBuilderHoldFire(unitID, unitDefID, action) end - ----Parameters ----@param playerID number ----@param teamID number ----@param readyState number ----@param clampedX number ----@param clampedY number ----@param clampedZ number ----@param rawX number ----@param rawY number ----@param rawZ number ----@return bool allow -function AllowStartPosition(playerID, teamID, readyState, clampedX, clampedY, clampedZ, rawX, rawY, rawZ) end - ----Parameters ----@param unitID number ----@param unitDefID number ----@param unitTeam number ----@param data number ----@return bool whether or not the unit should remain script-controlled (false) or return to engine controlled movement (true). -function MoveCtrlNotify(unitID, unitDefID, unitTeam, data) end - ----Parameters ----@param unitID number ----@param unitDefID number ----@param unitTeam number ----@param buildUnitID number ----@param buildUnitDefID number ----@param buildUnitTeam number ----@return bool if true the current build order is terminated -function TerraformComplete(unitID, unitDefID, unitTeam, buildUnitID, buildUnitDefID, buildUnitTeam) end - ----Parameters ----@param unitID number ----@param unitDefID number ----@param unitTeam number ----@param damage number ----@param paralyzer boolean ----@param weaponDefID number (optional) ----@param projectileID number (optional) ----@param attackerID number (optional) ----@param attackerDefID number (optional) ----@param attackerTeam number (optional) ----@return number newDamage, number impulseMult -function UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer[, weaponDefID[, projectileID[, attackerID[, attackerDefID[, attackerTeam]]]]]) end - ----Parameters ----@param featureID number ----@param featureDefID number ----@param featureTeam number ----@param damage number ----@param weaponDefID number ----@param projectileID number ----@param attackerID number ----@param attackerDefID number ----@param attackerTeam number ----@return number newDamage -function FeaturePreDamaged(featureID, featureDefID, featureTeam, damage, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam) end - ----@return number impulseMult -function FeaturePreDamaged(featureID, featureDefID, featureTeam, damage, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam) end - ----Parameters ----@param projectileID number ----@param projectileOwnerID number ----@param shieldWeaponNum number ----@param shieldCarrierID number ----@param bounceProjectile boolean ----@param beamEmitterWeaponNum number ----@param beamEmitterUnitID number ----@param startX number ----@param startY number ----@param startZ number ----@param hitX number ----@param hitY number ----@param hitZ number ----@return bool if true the gadget handles the collision event and the engine does not remove the projectile -function ShieldPreDamaged(projectileID, projectileOwnerID, shieldWeaponNum, shieldCarrierID, bounceProjectile, beamEmitterWeaponNum, beamEmitterUnitID, startX, startY, startZ, hitX, hitY, hitZ) end - ----Parameters ----@param attackerID number ----@param attackerWeaponNum number ----@param attackerWeaponDefID number ----@return bool allowCheck -function AllowWeaponTargetCheck(attackerID, attackerWeaponNum, attackerWeaponDefID) end - ----@return bool ignoreCheck -function AllowWeaponTargetCheck(attackerID, attackerWeaponNum, attackerWeaponDefID) end - ----Parameters ----@param attackerID number ----@param targetID number ----@param attackerWeaponNum number ----@param attackerWeaponDefID number ----@param defPriority number ----@return bool allowed -function AllowWeaponTarget(attackerID, targetID, attackerWeaponNum, attackerWeaponDefID, defPriority) end - ----@return number the new priority for this target (if you don't want to change it, return defPriority). Lower priority targets are targeted first. -function AllowWeaponTarget(attackerID, targetID, attackerWeaponNum, attackerWeaponDefID, defPriority) end - ----Parameters ----@param interceptorUnitID number ----@param interceptorWeaponID number ----@param targetProjectileID number ----@return bool allowed -function AllowWeaponInterceptTarget(interceptorUnitID, interceptorWeaponID, targetProjectileID) end - diff --git a/luamocks/autogenerated/MathExtra.lua b/luamocks/autogenerated/MathExtra.lua deleted file mode 100644 index 61c14726371..00000000000 --- a/luamocks/autogenerated/MathExtra.lua +++ /dev/null @@ -1,50 +0,0 @@ ----MathExtra - ---- ----Parameters ----@param x number ----@param y number ----@return number sqrt(x*x+y*y) -function math.hypot(x, y) end - ----Parameters ----@param x1 number ----@param x2 number (optional) ----@param x3 number (optional) ----@param xn number (optional) ----@return number diagonal -function math.diag(x1[, x2[, x3[, xn]]]) end - ----@return number clamped -function math.clamp() end - ----Parameters ----@param x number ----@return number sign -function math.sgn(x) end - ----Parameters ----@param x number ----@param y number ----@param a number ----@return number (x+(y-x)*a) -function math.mix(x, y, a) end - ----Parameters ----@param x number ----@param decimals number ----@return number rounded -function math.round(x, decimals) end - ----Parameters ----@param x number ----@return number erf -function math.erf(x) end - ----Parameters ----@param edge0 number ----@param edge1 number ----@param v number ----@return number smoothstep -function math.smoothstep(edge0, edge1, v) end - diff --git a/luamocks/autogenerated/OpenGL.lua b/luamocks/autogenerated/OpenGL.lua deleted file mode 100644 index a951b94cc87..00000000000 --- a/luamocks/autogenerated/OpenGL.lua +++ /dev/null @@ -1,22 +0,0 @@ ----OpenGL - ---- ----Parameters ----@param text string ----@param x number ----@param y number ----@param size number ----@param options string (optional) ----@return nil -function gl.Text(text, x, y, size[, options]) end - - ---- ----Parameters ----@param r number|{number,number,number,number} ----@param g number (optional) ----@param b number (optional) ----@param a number (optional) ----@return nil -function gl.Color(r[, g[, b[, a]]]) end - diff --git a/luamocks/autogenerated/SyncedCtrl.lua b/luamocks/autogenerated/SyncedCtrl.lua deleted file mode 100644 index c30dd825ec5..00000000000 --- a/luamocks/autogenerated/SyncedCtrl.lua +++ /dev/null @@ -1,1497 +0,0 @@ ----SyncedCtrl - ---- ----Parameters ----@param firstAllyTeamID number ----@param secondAllyTeamID number ----@param ally boolean ----@return nil -function Spring.SetAlly(firstAllyTeamID, secondAllyTeamID, ally) end - ----Changes the start box position of an allyTeam. ----@param allyTeamID integer ----@param xMin integer left start box boundary (elmos) ----@param zMin integer top start box boundary (elmos) ----@param xMax integer right start box boundary (elmos) ----@param zMax integer bottom start box boundary (elmos) ----@return nil -function Spring.SetAllyTeamStartBox(allyTeamID, xMin, zMin, xMax, zMax) end - ----Parameters ----@param playerID number ----@param teamID number ----@return nil -function Spring.AssignPlayerToTeam(playerID, teamID) end - ----Parameters ----@param allyTeamID number ----@param globallos boolean ----@return nil -function Spring.SetGlobalLos(allyTeamID, globallos) end - - ---- ----Parameters ----@param teamID number ----@return nil -function Spring.KillTeam(teamID) end - ----Parameters ----@param allyTeamID1 number (optional) ----@param allyTeamID2 number (optional) ----@param allyTeamIDn number (optional) ----@return nil -function Spring.GameOver([allyTeamID1[, allyTeamID2[, allyTeamIDn]]]) end - - ---- ----Parameters ----@param strength number ----@return nil -function Spring.SetTidal(strength) end - ----Parameters ----@param minStrength number ----@param maxStrength number ----@return nil -function Spring.SetWind(minStrength, maxStrength) end - ----Parameters ----@param teamID number ----@param type string ----@param amount number ----@return nil -function Spring.AddTeamResource(teamID, type, amount) end - ----Parameters ----@param teamID number ----@param type string ----@param amount ?number|table ----@return ?nil|bool hadEnough -function Spring.UseTeamResource(teamID, type, amount) end - ----Parameters ----@param teamID number ----@param res string ----@param amount number ----@return nil -function Spring.SetTeamResource(teamID, res, amount) end - ----Parameters ----@param teamID number ----@param type string ----@param amount number ----@return nil -function Spring.SetTeamShareLevel(teamID, type, amount) end - ----Parameters ----@param teamID_src number ----@param teamID_recv number ----@param type string ----@param amount number ----@return nil -function Spring.ShareTeamResource(teamID_src, teamID_recv, type, amount) end - - ---- ----Fields ----@param private boolean (optional) ----@param allied boolean (optional) ----@param inlos boolean (optional) ----@param inradar boolean (optional) ----@param public boolean (optional) ----Parameters ----@param paramName string ----@param paramValue ?number|string ----@param losAccess losAccess (optional) ----@return nil -function Spring.SetGameRulesParam(paramName, paramValue[, losAccess]) end - ----Parameters ----@param teamID number ----@param paramName string ----@param paramValue ?number|string ----@param losAccess losAccess (optional) ----@return nil -function Spring.SetTeamRulesParam(teamID, paramName, paramValue[, losAccess]) end - ----Parameters ----@param playerID number ----@param paramName string ----@param paramValue ?number|string ----@param losAccess losAccess (optional) ----@return nil -function Spring.SetPlayerRulesParam(playerID, paramName, paramValue[, losAccess]) end - ----Parameters ----@param unitID number ----@param paramName string ----@param paramValue ?number|string ----@param losAccess losAccess (optional) ----@return nil -function Spring.SetUnitRulesParam(unitID, paramName, paramValue[, losAccess]) end - ----Parameters ----@param featureID number ----@param paramName string ----@param paramValue ?number|string ----@param losAccess losAccess (optional) ----@return nil -function Spring.SetFeatureRulesParam(featureID, paramName, paramValue[, losAccess]) end - - ---- ----Parameters ----@param unitID number ----@param funcName ?number|string ----@param retArgs number ----@param COBArg1 (optional) ----@param COBArg2 (optional) ----@param COBArgn (optional) ----@return ?nil|number returnValue -function Spring.CallCOBScript(unitID, funcName, retArgs[, COBArg1[, COBArg2[, COBArgn]]]) end - ----@return ?nil|number returnArg1 -function Spring.CallCOBScript(unitID, funcName, retArgs[, COBArg1[, COBArg2[, COBArgn]]]) end - ----@return ?nil|number returnArg2 -function Spring.CallCOBScript(unitID, funcName, retArgs[, COBArg1[, COBArg2[, COBArgn]]]) end - ----@return ?nil|number returnArgn -function Spring.CallCOBScript(unitID, funcName, retArgs[, COBArg1[, COBArg2[, COBArgn]]]) end - ----Parameters ----@param unitID number ----@param funcName string ----@return ?nil|number funcID -function Spring.GetCOBScriptID(unitID, funcName) end - - ---- ----Parameters ----@param unitDefName string|number ----@param x number ----@param y number ----@param z number ----@param facing string|number ----@param teamID number ----@param build boolean (default): `false` ----@param flattenGround boolean (default): `true` ----@param unitID number (optional) ----@param builderID number (optional) ----@return number|nil unitID meaning unit was created -function Spring.CreateUnit(unitDefName, x, y, z, facing, teamID[, build=false[, flattenGround=true[, unitID[, builderID]]]]) end - -local newthing = Spring.CreateUnit() - ----Parameters ----@param unitID number ----@param selfd boolean (default): `false` ----@param reclaimed boolean (default): `false` ----@param attackerID number (optional) ----@param cleanupImmediately boolean (default): `false` ----@return nil -function Spring.DestroyUnit(unitID[, selfd=false[, reclaimed=false[, attackerID[, cleanupImmediately=false]]]]) end - ----Parameters ----@param unitID number ----@param newTeamID number ----@param given boolean (default): `true` ----@return nil -function Spring.TransferUnit(unitID, newTeamID[, given=true]) end - - ---- ----Parameters ----@param unitID number ----@param where {[number]=number,...} ----@return nil -function Spring.SetUnitCosts(unitID, where) end - - ---- ----Parameters ----@param unitID number ----@param res string ----@param amount number ----@return nil -function Spring.SetUnitResourcing(unitID, res, amount) end - ----Parameters ----@param unitID number ----@param res {[string]=number,...} ----@return nil -function Spring.SetUnitResourcing(unitID, res) end - ----Parameters ----@param unitID number ----@param tooltip string ----@return nil -function Spring.SetUnitTooltip(unitID, tooltip) end - ----Parameters ----@param unitID number ----@param health number|{[string]=number,...} ----@return nil -function Spring.SetUnitHealth(unitID, health) end - ----Parameters ----@param unitID number ----@param maxHealth number ----@return nil -function Spring.SetUnitMaxHealth(unitID, maxHealth) end - ----Parameters ----@param unitID number ----@param stockpile number (optional) ----@param buildPercent number (optional) ----@return nil -function Spring.SetUnitStockpile(unitID[, stockpile[, buildPercent]]) end - ----Parameters ----@param unitID number ----@param forceUseWeapons number (optional) ----@param allowUseWeapons number (optional) ----@return nil -function Spring.SetUnitUseWeapons(unitID[, forceUseWeapons[, allowUseWeapons]]) end - ----Fields ----@param reloadState number ----@param reloadFrame number ----@param reloadTime number ----@param accuracy number ----@param sprayAngle number ----@param range number ----@param projectileSpeed number ----@param burst number ----@param burstRate number ----@param projectiles number ----@param salvoLeft number ----@param nextSalvo number ----@param aimReady number ----Parameters ----@param unitID number ----@param weaponNum number ----@param states states ----@return nil -function Spring.SetUnitWeaponState(unitID, weaponNum, states) end - ----Parameters ----@param unitID number ----@param weaponNum number ----@param key string ----@param value number ----@return nil -function Spring.SetUnitWeaponState(unitID, weaponNum, key, value) end - ----Fields ----@param paralyzeDamageTime number ----@param impulseFactor number ----@param impulseBoost number ----@param craterMult number ----@param craterBoost number ----@param dynDamageExp number ----@param dynDamageMin number ----@param dynDamageRange number ----@param dynDamageInverted number ----@param craterAreaOfEffect number ----@param damageAreaOfEffect number ----@param edgeEffectiveness number ----@param explosionSpeed number ----@param armorType number ----Parameters ----@param unitID number ----@param weaponNum ?number|string ----@param damages damages ----@return nil -function Spring.SetUnitWeaponDamages(unitID, weaponNum, damages) end - ----Parameters ----@param unitID number ----@param weaponNum ?number|string ----@param key string ----@param value number ----@return nil -function Spring.SetUnitWeaponDamages(unitID, weaponNum, key, value) end - ----Parameters ----@param unitID number ----@param maxRange number ----@return nil -function Spring.SetUnitMaxRange(unitID, maxRange) end - ----Parameters ----@param unitID number ----@param experience number ----@return nil -function Spring.SetUnitExperience(unitID, experience) end - ----Parameters ----@param unitID number ----@param deltaExperience number ----@return nil -function Spring.AddUnitExperience(unitID, deltaExperience) end - ----Parameters ----@param unitID number ----@param armored boolean (optional) ----@param armorMultiple number (optional) ----@return nil -function Spring.SetUnitArmored(unitID[, armored[, armorMultiple]]) end - - ---- ----Parameters ----@param unitID number ----@param allyTeam number ----@param losTypes number|table ----@return nil -function Spring.SetUnitLosMask(unitID, allyTeam, losTypes) end - ----Parameters ----@param unitID number ----@param allyTeam number ----@param los number|table ----@return nil -function Spring.SetUnitLosState(unitID, allyTeam, los) end - ----Parameters ----@param unitID number ----@param cloak bool|number ----@param cloakArg bool|number ----@return nil -function Spring.SetUnitCloak(unitID, cloak, cloakArg) end - ----Parameters ----@param unitID number ----@param stealth boolean ----@return nil -function Spring.SetUnitStealth(unitID, stealth) end - ----Parameters ----@param unitID number ----@param sonarStealth boolean ----@return nil -function Spring.SetUnitSonarStealth(unitID, sonarStealth) end - ----Parameters ----@param unitID number ----@param seismicSignature number ----@return nil -function Spring.SetUnitSeismicSignature(unitID, seismicSignature) end - ----Parameters ----@param unitID number ----@param alwaysVisible boolean ----@return nil -function Spring.SetUnitAlwaysVisible(unitID, alwaysVisible) end - ----Parameters ----@param unitID number ----@param useAirLos boolean ----@return nil -function Spring.SetUnitUseAirLos(unitID, useAirLos) end - ----Parameters ----@param unitID number ----@param depth number ----@param range number (optional) ----@return nil -function Spring.SetUnitMetalExtraction(unitID, depth[, range]) end - ----Parameters ----@param unitID number ----@param metal number ----@return nil -function Spring.SetUnitHarvestStorage(unitID, metal) end - ----Parameters ----@param unitID number ----@param paramName string ----@param bool number ----@return nil -function Spring.SetUnitBuildParams(unitID, paramName, bool) end - ----Parameters ----@param builderID number ----@param buildSpeed number ----@param repairSpeed number (optional) ----@param reclaimSpeed number (optional) ----@param captureSpeed number (optional) ----@param terraformSpeed number (optional) ----@return nil -function Spring.SetUnitBuildSpeed(builderID, buildSpeed[, repairSpeed[, reclaimSpeed[, captureSpeed[, terraformSpeed]]]]) end - ----Parameters ----@param builderID number ----@param pieces table ----@return nil -function Spring.SetUnitNanoPieces(builderID, pieces) end - ----Parameters ----@param unitID number ----@param isblocking boolean ----@param isSolidObjectCollidable boolean ----@param isProjectileCollidable boolean ----@param isRaySegmentCollidable boolean ----@param crushable boolean ----@param blockEnemyPushing boolean ----@param blockHeightChanges boolean ----@return nil -function Spring.SetUnitBlocking(unitID, isblocking, isSolidObjectCollidable, isProjectileCollidable, isRaySegmentCollidable, crushable, blockEnemyPushing, blockHeightChanges) end - ----Parameters ----@param unitID number ----@param crashing boolean ----@return bool success -function Spring.SetUnitCrashing(unitID, crashing) end - ----Parameters ----@param unitID number ----@param weaponID number (default): `-1` ----@param enabled boolean (optional) ----@param power number (optional) ----@return nil -function Spring.SetUnitShieldState(unitID[, weaponID=-1[, enabled[, power]]]) end - ----Parameters ----@param unitID number ----@param weaponID number (optional) ----@param rechargeTime number (optional) ----@return nil -function Spring.SetUnitShieldRechargeDelay(unitID[, weaponID[, rechargeTime]]) end - ----Parameters ----@param unitID number ----@param type string ----@param arg1 number ----@param y number (optional) ----@param z number (optional) ----@return nil -function Spring.SetUnitFlanking(unitID, type, arg1[, y[, z]]) end - ----Parameters ----@param unitID number ----@param neutral boolean ----@return nil|bool setNeutral -function Spring.SetUnitNeutral(unitID, neutral) end - ----Parameters ----@param unitID number ----@param enemyUnitID number (optional) ----@param dgun boolean (default): `false` ----@param userTarget boolean (default): `false` ----@param weaponNum number (default): `-1` ----@return bool success -function Spring.SetUnitTarget(unitID[, enemyUnitID[, dgun=false[, userTarget=false[, weaponNum=-1]]]]) end - ----Parameters ----@param unitID number ----@param x number (optional) ----@param y number (optional) ----@param z number (optional) ----@param dgun boolean (default): `false` ----@param userTarget boolean (default): `false` ----@param weaponNum number (default): `-1` ----@return bool success -function Spring.SetUnitTarget(unitID[, x[, y[, z[, dgun=false[, userTarget=false[, weaponNum=-1]]]]]]) end - ----Parameters ----@param unitID number ----@param mpX number ----@param mpY number ----@param mpZ number ----@param apX number ----@param apY number ----@param apZ number ----@param relative boolean (default): `false` ----@return bool success -function Spring.SetUnitMidAndAimPos(unitID, mpX, mpY, mpZ, apX, apY, apZ[, relative=false]) end - ----Parameters ----@param unitID number ----@param radius number ----@param height number ----@return bool success -function Spring.SetUnitRadiusAndHeight(unitID, radius, height) end - ----Parameters ----@param unitID number ----@param AlteredPiece number ----@param ParentPiece number ----@return nil -function Spring.SetUnitPieceParent(unitID, AlteredPiece, ParentPiece) end - ----Parameters ----@param unitID number ----@param pieceNum number ----@param matrix {number,...} ----@return nil -function Spring.SetUnitPieceMatrix(unitID, pieceNum, matrix) end - ----Parameters ----@param unitID number ----@param scaleX number ----@param scaleY number ----@param scaleZ number ----@param offsetX number ----@param offsetY number ----@param offsetZ number ----@param vType number ----@param tType number ----@param Axis number ----@return nil - - enum COLVOL_TYPES { - COLVOL_TYPE_DISABLED = -1, - COLVOL_TYPE_ELLIPSOID = 0, - COLVOL_TYPE_CYLINDER, - COLVOL_TYPE_BOX, - COLVOL_TYPE_SPHERE, - COLVOL_NUM_TYPES // number of non-disabled collision volume types - }; - enum COLVOL_TESTS { - COLVOL_TEST_DISC = 0, - COLVOL_TEST_CONT = 1, - COLVOL_NUM_TESTS = 2 // number of tests - }; - enum COLVOL_AXES { - COLVOL_AXIS_X = 0, - COLVOL_AXIS_Y = 1, - COLVOL_AXIS_Z = 2, - COLVOL_NUM_AXES = 3 // number of collision volume axes - }; -function Spring.SetUnitCollisionVolumeData(unitID, scaleX, scaleY, scaleZ, offsetX, offsetY, offsetZ, vType, tType, Axis) end - ----Parameters ----@param unitID number ----@param pieceIndex number ----@param enable boolean ----@param scaleX number ----@param scaleY number ----@param scaleZ number ----@param offsetX number ----@param offsetY number ----@param offsetZ number ----@param volumeType number (optional) ----@param primaryAxis number (optional) ----@return nil -function Spring.SetUnitPieceCollisionVolumeData(unitID, pieceIndex, enable, scaleX, scaleY, scaleZ, offsetX, offsetY, offsetZ[, volumeType[, primaryAxis]]) end - ----Parameters ----@param unitID number ----@param pieceIndex number ----@param visible boolean ----@return nil -function Spring.SetUnitPieceVisible(unitID, pieceIndex, visible) end - ----Parameters ----@param unitID number ----@param type string ----@return ?nil|number newRadius -function Spring.SetUnitSensorRadius(unitID, type) end - ----Parameters ----@param unitID number ----@param posErrorVectorX number ----@param posErrorVectorY number ----@param posErrorVectorZ number ----@param posErrorDeltaX number ----@param posErrorDeltaY number ----@param posErrorDeltaZ number ----@param nextPosErrorUpdate number (optional) ----@return nil -function Spring.SetUnitPosErrorParams(unitID, posErrorVectorX, posErrorVectorY, posErrorVectorZ, posErrorDeltaX, posErrorDeltaY, posErrorDeltaZ[, nextPosErrorUpdate]) end - ----Parameters ----@param unitID number ----@param goalX number ----@param goalY number ----@param goalZ number ----@param goalRadius number (optional) ----@param moveSpeed number (optional) ----@param moveRaw boolean (optional) ----@return nil -function Spring.SetUnitMoveGoal(unitID, goalX, goalY, goalZ[, goalRadius[, moveSpeed[, moveRaw]]]) end - ----Parameters ----@param unitID number ----@param goalX number ----@param goalY number ----@param goalZ number ----@param goalRadius number (optional) ----@return nil -function Spring.SetUnitLandGoal(unitID, goalX, goalY, goalZ[, goalRadius]) end - ----Parameters ----@param unitID number ----@return nil -function Spring.ClearUnitGoal(unitID) end - ----Parameters ----@param unitID number ----@param posX number ----@param posY number ----@param posZ number ----@param velX number ----@param velY number ----@param velZ number ----@param rotX number ----@param rotY number ----@param rotZ number ----@param dragX number ----@param dragY number ----@param dragZ number ----@return nil -function Spring.SetUnitPhysics(unitID, posX, posY, posZ, velX, velY, velZ, rotX, rotY, rotZ, dragX, dragY, dragZ) end - ----Parameters ----@param unitID number ----@param mass number ----@return nil -function Spring.SetUnitMass(unitID, mass) end - ----Parameters ----@param unitID number ----@param x number ----@param z number ----@param alwaysAboveSea boolean (optional) ----@return nil -function Spring.SetUnitPosition(unitID, x, z[, alwaysAboveSea]) end - ----Parameters ----@param unitID number ----@param yaw number ----@param pitch number ----@param roll number ----@return nil -function Spring.SetUnitRotation(unitID, yaw, pitch, roll) end - ----Parameters ----@param unitID number ----@param x number ----@param y number ----@param z number ----@return nil -function Spring.SetUnitDirection(unitID, x, y, z) end - ----Parameters ----@param unitID number ----@param heading number ----@param upx number ----@param upy number ----@param upz number ----@return nil -function Spring.SetUnitHeadingAndUpDir(unitID, heading, upx, upy, upz) end - ----Parameters ----@param unitID number ----@param velX number ----@param velY number ----@param velZ number ----@return nil -function Spring.SetUnitVelocity(unitID, velX, velY, velZ) end - ----Parameters ----@param unitID number ----@param buggerOff boolean (optional) ----@param offset number (optional) ----@param radius number (optional) ----@param relHeading number (optional) ----@param spherical boolean (optional) ----@param forced boolean (optional) ----@return nil|number buggerOff -function Spring.SetFactoryBuggerOff(unitID[, buggerOff[, offset[, radius[, relHeading[, spherical[, forced]]]]]]) end - ----Parameters ----@param x number ----@param y number ----@param z number (optional) ----@param radius number ----@param teamID number ----@param spherical boolean (default): `true` ----@param forced boolean (default): `true` ----@param excludeUnitID number (optional) ----@param excludeUnitDefIDs {[number],...} (optional) ----@return nil -function Spring.BuggerOff(x, y[, z], radius, teamID[, spherical=true[, forced=true[, excludeUnitID[, excludeUnitDefIDs]]]]) end - ----Parameters ----@param unitID number ----@param damage number ----@param paralyze number (default): `0` ----@param attackerID number (default): `-1` ----@param weaponID number (default): `-1` ----@param impulseX number (optional) ----@param impulseY number (optional) ----@param impulseZ number (optional) ----@return nil -function Spring.AddUnitDamage(unitID, damage[, paralyze=0[, attackerID=-1[, weaponID=-1[, impulseX[, impulseY[, impulseZ]]]]]]) end - ----Parameters ----@param unitID number ----@param x number ----@param y number ----@param z number ----@param decayRate number (optional) ----@return nil -function Spring.AddUnitImpulse(unitID, x, y, z[, decayRate]) end - ----Parameters ----@param unitID number ----@param pindSize number ----@return nil -function Spring.AddUnitSeismicPing(unitID, pindSize) end - ----Parameters ----@param unitID number ----@param resource string ----@param amount number ----@return nil -function Spring.AddUnitResource(unitID, resource, amount) end - ----Parameters ----@param unitID number ----@param resource string ----@param amount number ----@return ?nil|bool okay -function Spring.UseUnitResource(unitID, resource, amount) end - ----Parameters ----@param unitID number ----@param resources {[string]=number,...} ----@return ?nil|bool okay -function Spring.UseUnitResource(unitID, resources) end - - ---- ----Parameters ----@param unitID number ----@return nil -function Spring.AddObjectDecal(unitID) end - ----Parameters ----@param unitID number ----@return nil -function Spring.RemoveObjectDecal(unitID) end - - ---- ----Parameters ----@param x number ----@param z number ----@return nil -function Spring.AddGrass(x, z) end - ----Parameters ----@param x number ----@param z number ----@return nil -function Spring.RemoveGrass(x, z) end - - ---- ----Parameters ----@param featureDef string|number ----@param x number ----@param y number ----@param z number ----@param heading number (optional) ----@param AllyTeamID number (optional) ----@param featureID number (optional) ----@return number featureID -function Spring.CreateFeature(featureDef, x, y, z[, heading[, AllyTeamID[, featureID]]]) end - ----Parameters ----@param featureDefID number ----@return nil -function Spring.DestroyFeature(featureDefID) end - ----Parameters ----@param featureDefID number ----@param teamID number ----@return nil -function Spring.TransferFeature(featureDefID, teamID) end - ----Parameters ----@param featureID number ----@param enable boolean ----@return nil -function Spring.SetFeatureAlwaysVisible(featureID, enable) end - ----Parameters ----@param featureID number ----@param useAirLos boolean ----@return nil -function Spring.SetFeatureUseAirLos(featureID, useAirLos) end - ----Parameters ----@param featureID number ----@param health number ----@return nil -function Spring.SetFeatureHealth(featureID, health) end - ----Parameters ----@param featureID number ----@param maxHealth number ----@return nil -function Spring.SetFeatureMaxHealth(featureID, maxHealth) end - ----Parameters ----@param featureID number ----@param reclaimLeft number ----@return nil -function Spring.SetFeatureReclaim(featureID, reclaimLeft) end - ----Parameters ----@param featureID number ----@param metal number ----@param energy number ----@param reclaimTime number (optional) ----@param reclaimLeft number (optional) ----@param featureDefMetal number (optional) ----@param featureDefEnergy number (optional) ----@return nil -function Spring.SetFeatureResources(featureID, metal, energy[, reclaimTime[, reclaimLeft[, featureDefMetal[, featureDefEnergy]]]]) end - ----Parameters ----@param featureID number ----@param unitDef string|number ----@param facing string|number (optional) ----@param progress number (optional) ----@return nil -function Spring.SetFeatureResurrect(featureID, unitDef[, facing[, progress]]) end - ----Parameters ----@param featureID number ----@param enable boolean (optional) ----@param arg1 number (optional) ----@param arg2 number (optional) ----@param argn number (optional) ----@return nil -function Spring.SetFeatureMoveCtrl(featureID[, enable[, arg1[, arg2[, argn]]]]) end - ----Parameters ----@param featureID number ----@param posX number ----@param posY number ----@param posZ number ----@param velX number ----@param velY number ----@param velZ number ----@param rotX number ----@param rotY number ----@param rotZ number ----@param dragX number ----@param dragY number ----@param dragZ number ----@return nil -function Spring.SetFeaturePhysics(featureID, posX, posY, posZ, velX, velY, velZ, rotX, rotY, rotZ, dragX, dragY, dragZ) end - ----Parameters ----@param featureID number ----@param mass number ----@return nil -function Spring.SetFeatureMass(featureID, mass) end - ----Parameters ----@param featureID number ----@param x number ----@param y number ----@param z number ----@param snapToGround boolean (optional) ----@return nil -function Spring.SetFeaturePosition(featureID, x, y, z[, snapToGround]) end - ----Parameters ----@param featureID number ----@param rotX number ----@param rotY number ----@param rotZ number ----@return nil -function Spring.SetFeatureRotation(featureID, rotX, rotY, rotZ) end - ----Parameters ----@param featureID number ----@param dirX number ----@param dirY number ----@param dirZ number ----@return nil -function Spring.SetFeatureDirection(featureID, dirX, dirY, dirZ) end - ----Parameters ----@param featureID number ----@param heading number ----@param upx number ----@param upy number ----@param upz number ----@return nil -function Spring.SetFeatureHeadingAndUpDir(featureID, heading, upx, upy, upz) end - ----Parameters ----@param featureID number ----@param velX number ----@param velY number ----@param velZ number ----@return nil -function Spring.SetFeatureVelocity(featureID, velX, velY, velZ) end - ----Parameters ----@param featureID number ----@param isBlocking boolean ----@param isSolidObjectCollidable boolean ----@param isProjectileCollidable boolean ----@param isRaySegmentCollidable boolean ----@param crushable boolean ----@param blockEnemyPushing boolean ----@param blockHeightChanges boolean ----@return nil -function Spring.SetFeatureBlocking(featureID, isBlocking, isSolidObjectCollidable, isProjectileCollidable, isRaySegmentCollidable, crushable, blockEnemyPushing, blockHeightChanges) end - ----Parameters ----@param featureID number ----@param noSelect boolean ----@return nil -function Spring.SetFeatureNoSelect(featureID, noSelect) end - ----Parameters ----@param featureID number ----@param mpX number ----@param mpY number ----@param mpZ number ----@param apX number ----@param apY number ----@param apZ number ----@param relative boolean (optional) ----@return bool success -function Spring.SetFeatureMidAndAimPos(featureID, mpX, mpY, mpZ, apX, apY, apZ[, relative]) end - ----Parameters ----@param featureID number ----@param radius number ----@param height number ----@return bool success -function Spring.SetFeatureRadiusAndHeight(featureID, radius, height) end - ----Parameters ----@param featureID number ----@param scaleX number ----@param scaleY number ----@param scaleZ number ----@param offsetX number ----@param offsetY number ----@param offsetZ number ----@param vType number ----@param tType number ----@param Axis number ----@return nil -function Spring.SetFeatureCollisionVolumeData(featureID, scaleX, scaleY, scaleZ, offsetX, offsetY, offsetZ, vType, tType, Axis) end - ----Parameters ----@param featureID number ----@param pieceIndex number ----@param enable boolean ----@param scaleX number ----@param scaleY number ----@param scaleZ number ----@param offsetX number ----@param offsetY number ----@param offsetZ number ----@param Axis number ----@param volumeType number ----@param primaryAxis number (optional) ----@return nil -function Spring.SetFeaturePieceCollisionVolumeData(featureID, pieceIndex, enable, scaleX, scaleY, scaleZ, offsetX, offsetY, offsetZ, Axis, volumeType[, primaryAxis]) end - ----Parameters ----@param featureID number ----@param pieceIndex number ----@param visible boolean ----@return nil -function Spring.SetFeaturePieceVisible(featureID, pieceIndex, visible) end - - ---- ----Fields ----@param pos: x number ----@param pos: y number ----@param pos: z number ----@param end: x number ----@param end: y number ----@param end: z number ----@param speed: x number ----@param speed: y number ----@param speed: z number ----@param spread: x number ----@param spread: y number ----@param spread: z number ----@param error: x number ----@param error: y number ----@param error: z number ----@param owner number ----@param team number ----@param ttl number ----@param gravity number ----@param tracking number ----@param maxRange number ----@param startAlpha number ----@param endAlpha number ----@param model string ----@param cegTag string ----Parameters ----@param projectileID number ----@param alwaysVisible boolean ----@return nil -function Spring.SetProjectileAlwaysVisible(projectileID, alwaysVisible) end - ----Parameters ----@param projectileID number ----@param useAirLos boolean ----@return nil -function Spring.SetProjectileUseAirLos(projectileID, useAirLos) end - ----Parameters ----@param projectileID number ----@param enable boolean ----@return nil -function Spring.SetProjectileMoveControl(projectileID, enable) end - ----Parameters ----@param projectileID number ----@param posX number (default): `0` ----@param posY number (default): `0` ----@param posZ number (default): `0` ----@return nil -function Spring.SetProjectilePosition(projectileID[, posX=0[, posY=0[, posZ=0]]]) end - ----Parameters ----@param projectileID number ----@param velX number (default): `0` ----@param velY number (default): `0` ----@param velZ number (default): `0` ----@return nil -function Spring.SetProjectileVelocity(projectileID[, velX=0[, velY=0[, velZ=0]]]) end - ----Parameters ----@param projectileID number ----@return nil -function Spring.SetProjectileCollision(projectileID) end - ----Parameters ----@param projectileID number ----@param arg1 number (default): `0` ----@param arg2 number (default): `0` ----@param posZ number (default): `0` ----@return ?nil|bool validTarget -function Spring.SetProjectileTarget(projectileID[, arg1=0[, arg2=0[, posZ=0]]]) end - ----Parameters ----@param projectileID number ----@return nil -function Spring.SetProjectileIsIntercepted(projectileID) end - ----Parameters ----@param unitID number ----@param weaponNum number ----@param key string ----@param value number ----@return nil -function Spring.SetProjectileDamages(unitID, weaponNum, key, value) end - ----Parameters ----@param projectileID number ----@param ignore boolean ----@return nil -function Spring.SetProjectileIgnoreTrackingError(projectileID, ignore) end - ----Parameters ----@param projectileID number ----@param grav number (default): `0` ----@return nil -function Spring.SetProjectileGravity(projectileID[, grav=0]) end - ----Parameters ----@param projectileID number ----@param explosionFlags number (optional) ----@param spinAngle number (optional) ----@param spinSpeed number (optional) ----@param spinVectorX number (optional) ----@param spinVectorY number (optional) ----@param spinVectorZ number (optional) ----@return nil -function Spring.SetPieceProjectileParams(projectileID[, explosionFlags[, spinAngle[, spinSpeed[, spinVectorX[, spinVectorY[, spinVectorZ]]]]]]) end - - ---- ----Fields ----@param right bool ----@param alt bool ----@param ctrl bool ----@param shift bool ----Fields ----@param cmdID number ----@param params {number,...} ----@param options cmdOpts ----Parameters ----@param unitID number ----@return nil -function Spring.UnitFinishCommand(unitID) end - ----Parameters ----@param unitID number ----@param cmdID number ----@param params {number,...} ----@param cmdOpts cmdOpts ----@return bool unitOrdered -function Spring.GiveOrderToUnit(unitID, cmdID, params, cmdOpts) end - ----Parameters ----@param unitMap {[number]=table,...} ----@param cmdID number ----@param params {number,...} ----@param cmdOpts cmdOpts ----@return number unitsOrdered -function Spring.GiveOrderToUnitMap(unitMap, cmdID, params, cmdOpts) end - ----Parameters ----@param unitIDs {number,...} ----@param cmdID number ----@param params {number,...} ----@param cmdOpts cmdOpts ----@return number unitsOrdered -function Spring.GiveOrderToUnitArray(unitIDs, cmdID, params, cmdOpts) end - ----Parameters ----@param unitID number ----@param cmdArray {cmdSpec,...} ----@return bool ordersGiven -function Spring.GiveOrderArrayToUnit(unitID, cmdArray) end - ----Parameters ----@param unitMap {[number]=table} ----@param orderArray {cmdSpec,...} ----@return number unitsOrdered -function Spring.GiveOrderArrayToUnitMap(unitMap, orderArray) end - ----Parameters ----@param unitArray {number,...} ----@param orderArray {cmdSpec,...} ----@return nil -function Spring.GiveOrderArrayToUnitArray(unitArray, orderArray) end - - ---- ----Parameters ----@param x1 number ----@param z1 number ----@param x2_height number ----@param z2 number (optional) ----@param height number (optional) ----@return nil -function Spring.LevelHeightMap(x1, z1, x2_height[, z2[, height]]) end - ----Parameters ----@param x1 number ----@param y1 number ----@param x2_height number ----@param y2 number (optional) ----@param height number (optional) ----@return nil -function Spring.AdjustHeightMap(x1, y1, x2_height[, y2[, height]]) end - ----Parameters ----@param x1 number ----@param y1 number ----@param x2_factor number ----@param y2 number (optional) ----@param factor number (optional) ----@return nil -function Spring.RevertHeightMap(x1, y1, x2_factor[, y2[, factor]]) end - ----Parameters ----@param x number ----@param z number ----@param height number ----@return ?nil|number newHeight -function Spring.AddHeightMap(x, z, height) end - ----Parameters ----@param x number ----@param z number ----@param height number ----@param terraform number (default): `1` ----@return ?nil|number absHeightDiff =0 nothing will be changed (the terraform starts) and if =1 the terraform will be finished. -function Spring.SetHeightMap(x, z, height[, terraform=1]) end - ----Parameters ----@param lua_function function ----@param arg1 (optional) ----@param arg2 (optional) ----@param argn (optional) ----@return ?nil|number absTotalHeightMapAmountChanged -function Spring.SetHeightMapFunc(lua_function[, arg1[, arg2[, argn]]]) end - - ---- ----Parameters ----@param x1 number ----@param y1 number ----@param x2_height number ----@param y2 number (optional) ----@param height number (optional) ----@return nil -function Spring.LevelOriginalHeightMap(x1, y1, x2_height[, y2[, height]]) end - ----Parameters ----@param x1 number ----@param y1 number ----@param x2_height number ----@param y2 number (optional) ----@param height number (optional) ----@return nil -function Spring.AdjustOriginalHeightMap(x1, y1, x2_height[, y2[, height]]) end - ----Parameters ----@param x1 number ----@param y1 number ----@param x2_factor number ----@param y2 number (optional) ----@param factor number (optional) ----@return nil -function Spring.RevertOriginalHeightMap(x1, y1, x2_factor[, y2[, factor]]) end - ----Parameters ----@param x number ----@param y number ----@param height number ----@return nil -function Spring.AddOriginalHeightMap(x, y, height) end - ----Parameters ----@param x number ----@param y number ----@param height number ----@param factor number (optional) ----@return nil -function Spring.SetOriginalHeightMap(x, y, height[, factor]) end - ----Parameters ----@param heightMapFunc function ----@return nil -function Spring.SetOriginalHeightMapFunc(heightMapFunc) end - ----Parameters ----@param x1 number ----@param z1 number ----@param x2 number (optional) ----@param z2 number (optional) ----@param height number ----@return nil -function Spring.LevelSmoothMesh(x1, z1[, x2][, z2], height) end - ----Parameters ----@param x1 number ----@param z1 number ----@param x2 number (optional) ----@param z2 number (optional) ----@param height number ----@return nil -function Spring.AdjustSmoothMesh(x1, z1[, x2][, z2], height) end - ----Parameters ----@param x1 number ----@param z1 number ----@param x2 number (optional) ----@param z2 number (optional) ----@param origFactor number ----@return nil -function Spring.RevertSmoothMesh(x1, z1[, x2][, z2], origFactor) end - ----Parameters ----@param x number ----@param z number ----@param height number ----@return ?nil|number newHeight -function Spring.AddSmoothMesh(x, z, height) end - ----Parameters ----@param x number ----@param z number ----@param height number ----@param terraform number (default): `1` ----@return ?nil|number absHeightDiff -function Spring.SetSmoothMesh(x, z, height[, terraform=1]) end - ----Parameters ----@param lua_function function ----@param arg1 ----@param arg2 ----@param argn ----@return ?nil|number absTotalHeightMapAmountChanged -function Spring.SetSmoothMeshFunc(lua_function, arg1, arg2, argn) end - - ---- ----Parameters ----@param x number ----@param z number ----@param newType number ----@return ?nil|number oldType -function Spring.SetMapSquareTerrainType(x, z, newType) end - ----Parameters ----@param typeIndex number ----@param speedTanks number (default): `nil` ----@param speedKBOts number (default): `nil` ----@param speedHovers number (default): `nil` ----@param speedShips number (default): `nil` ----@return ?nil|bool true -function Spring.SetTerrainTypeData(typeIndex[, speedTanks=nil[, speedKBOts=nil[, speedHovers=nil[, speedShips=nil]]]]) end - ----Parameters ----@param x number ----@param z number ----@param mask number ----@return nil See also buildingMask unitdef tag. -function Spring.SetSquareBuildingMask(x, z, mask) end - ----Parameters ----@param unitID number ----@param weaponID number ----@return nil -function Spring.UnitWeaponFire(unitID, weaponID) end - ----Parameters ----@param transporterID number ----@param passengerID number ----@param pieceNum number ----@return nil -function Spring.UnitAttach(transporterID, passengerID, pieceNum) end - ----Parameters ----@param passengerID number ----@return nil -function Spring.UnitDetach(passengerID) end - ----Parameters ----@param passengerID number ----@return nil -function Spring.UnitDetachFromAir(passengerID) end - ----Parameters ----@param passengerID number ----@param transportID number ----@return nil -function Spring.SetUnitLoadingTransport(passengerID, transportID) end - ----Parameters ----@param weaponDefID number ----@param projectileParams projectileParams ----@return ?nil|number projectileID -function Spring.SpawnProjectile(weaponDefID, projectileParams) end - ----Parameters ----@param projectileID number ----@return nil -function Spring.DeleteProjectile(projectileID) end - ----Fields ----@param weaponDef number ----@param owner number ----@param hitUnit number ----@param hitFeature number ----@param craterAreaOfEffect number ----@param damageAreaOfEffect number ----@param edgeEffectiveness number ----@param explosionSpeed number ----@param gfxMod number ----@param impactOnly boolean ----@param ignoreOwner boolean ----@param damageGround boolean ----Parameters ----@param posX number (default): `0` ----@param posY number (default): `0` ----@param posZ number (default): `0` ----@param dirX number (default): `0` ----@param dirY number (default): `0` ----@param dirZ number (default): `0` ----@param explosionParams explosionParams ----@return nil -function Spring.SpawnExplosion([posX=0][, posY=0][, posZ=0][, dirX=0][, dirY=0][, dirZ=0], explosionParams) end - ----Parameters ----@param cegname string ----@param posX number (default): `0` ----@param posY number (default): `0` ----@param posZ number (default): `0` ----@param dirX number (default): `0` ----@param dirY number (default): `0` ----@param dirZ number (default): `0` ----@param radius number (default): `0` ----@param damage number (default): `0` ----@return ?nil|bool success -function Spring.SpawnCEG(cegname[, posX=0[, posY=0[, posZ=0[, dirX=0[, dirY=0[, dirZ=0[, radius=0[, damage=0]]]]]]]]) end - ----@return number cegID -function Spring.SpawnCEG(cegname[, posX=0[, posY=0[, posZ=0[, dirX=0[, dirY=0[, dirZ=0[, radius=0[, damage=0]]]]]]]]) end - ----Parameters ----@param unitID number (default): `0` ----@param sfxID number (default): `0` ----@param posX number (default): `0` ----@param posY number (default): `0` ----@param posZ number (default): `0` ----@param dirX number (default): `0` ----@param dirY number (default): `0` ----@param dirZ number (default): `0` ----@param radius number (default): `0` ----@param damage number (default): `0` ----@param absolute boolean (optional) ----@return ?nil|bool success -function Spring.SpawnSFX([unitID=0[, sfxID=0[, posX=0[, posY=0[, posZ=0[, dirX=0[, dirY=0[, dirZ=0[, radius=0[, damage=0[, absolute]]]]]]]]]]]) end - - ---- ----Parameters ----@param noPause boolean ----@return nil -function Spring.SetNoPause(noPause) end - ----Parameters ----@param expGrade number ----@param ExpPowerScale number (optional) ----@param ExpHealthScale number (optional) ----@param ExpReloadScale number (optional) ----@return nil -function Spring.SetExperienceGrade(expGrade[, ExpPowerScale[, ExpHealthScale[, ExpReloadScale]]]) end - ----Parameters ----@param allyTeamID number ----@param allyteamErrorSize number ----@param baseErrorSize number (optional) ----@param baseErrorMult number (optional) ----@return nil -function Spring.SetRadarErrorParams(allyTeamID, allyteamErrorSize[, baseErrorSize[, baseErrorMult]]) end - - ---- ----Parameters ----@param unitID number ----@param cmdDescID number ----@param cmdArray table ----@return nil -function Spring.EditUnitCmdDesc(unitID, cmdDescID, cmdArray) end - ----Parameters ----@param unitID number ----@param cmdDescID number (optional) ----@param cmdArray table ----@return nil -function Spring.InsertUnitCmdDesc(unitID[, cmdDescID], cmdArray) end - ----Parameters ----@param unitID number ----@param cmdDescID number (optional) ----@return nil -function Spring.RemoveUnitCmdDesc(unitID[, cmdDescID]) end - diff --git a/luamocks/autogenerated/UnsyncedCtrl.lua b/luamocks/autogenerated/UnsyncedCtrl.lua deleted file mode 100644 index 31c5c1a3b4c..00000000000 --- a/luamocks/autogenerated/UnsyncedCtrl.lua +++ /dev/null @@ -1,1042 +0,0 @@ ----UnsyncedCtrl - ---- ----Fields ----@param r number ----@param g number ----@param b number ----Fields ----@param r number ----@param g number ----@param b number ----@param a number - ---- ----Parameters ----@param pingTag number ----@return nil -function Spring.Ping(pingTag) end - ----Parameters ----@param arg1 ----@param arg2 (optional) ----@param argn (optional) ----@return nil -function Spring.Echo(arg1[, arg2[, argn]]) end - ----Parameters ----@param section string ----@param logLevel ?number|string ----@param logMessage1 string ----@param logMessage2 string (optional) ----@param logMessagen string (optional) ----@return nil -function Spring.Log(section, logLevel, logMessage1[, logMessage2[, logMessagen]]) end - ----Parameters ----@param command1 ?string|table ----@param command2 string ----@return nil -function Spring.SendCommands(command1, command2) end - ----Parameters ----@param standardShaderID number ----@param deferredShaderID number ----@return nil -function Spring.SetMapShader(standardShaderID, deferredShaderID) end - ----Parameters ----@param texSqrX number ----@param texSqrY number ----@param luaTexName string ----@return bool success -function Spring.SetMapSquareTexture(texSqrX, texSqrY, luaTexName) end - ----Parameters ----@param texType string ----@param texName string ----@return bool success -function Spring.SetMapShadingTexture(texType, texName) end - ----Spring.SetMapShadingTexture("$ssmf_specular", "name_of_my_shiny_texture") ----Parameters ----@param texName string ----@return nil -function Spring.SetSkyBoxTexture(texName) end - - ---- ----Parameters ----@param message string ----@return nil -function Spring.SendMessage(message) end - ----Parameters ----@param message string ----@return nil -function Spring.SendMessageToSpectators(message) end - ----Parameters ----@param playerID number ----@param message string ----@return nil -function Spring.SendMessageToPlayer(playerID, message) end - ----Parameters ----@param teamID number ----@param message string ----@return nil -function Spring.SendMessageToTeam(teamID, message) end - ----Parameters ----@param allyID number ----@param message string ----@return nil -function Spring.SendMessageToAllyTeam(allyID, message) end - - ---- ----Parameters ----@param soundfile string ----@return ?nil|bool success -function Spring.LoadSoundDef(soundfile) end - ----Parameters ----@param soundfile string ----@param volume number (default): `1.0` ----@param posx number (optional) ----@param posy number (optional) ----@param posz number (optional) ----@param speedx number (optional) ----@param speedy number (optional) ----@param speedz number (optional) ----@param channel ?number|string (optional) ----@return ?nil|bool playSound -function Spring.PlaySoundFile(soundfile[, volume=1.0[, posx[, posy[, posz[, speedx[, speedy[, speedz[, channel]]]]]]]]) end - ----Parameters ----@param oggfile string ----@param volume number (default): `1.0` ----@param enqueue boolean (optional) ----@return ?nil|bool success -function Spring.PlaySoundStream(oggfile[, volume=1.0[, enqueue]]) end - ----@return nil -function Spring.StopSoundStream() end - ----@return nil -function Spring.PauseSoundStream() end - ----Parameters ----@param volume number ----@return nil -function Spring.SetSoundStreamVolume(volume) end - ----Parameters ----@param cmdID number ----@param posX number ----@param posY number ----@param posZ number ----@return nil -function Spring.AddWorldIcon(cmdID, posX, posY, posZ) end - ----Parameters ----@param text string ----@param posX number ----@param posY number ----@param posZ number ----@return nil -function Spring.AddWorldText(text, posX, posY, posZ) end - ----Parameters ----@param unitDefID number ----@param posX number ----@param posY number ----@param posZ number ----@param teamID number ----@param facing number ----@return nil -function Spring.AddWorldUnit(unitDefID, posX, posY, posZ, teamID, facing) end - ----Parameters ----@param unitID number ----@return nil -function Spring.DrawUnitCommands(unitID) end - ----Parameters ----@param units table ----@param tableOrArray boolean ----@return nil -function Spring.DrawUnitCommands(units, tableOrArray) end - - ---- ----Fields ----@param name string ----@param mode number ----@param fov number ----@param px number ----@param py number ----@param pz number ----@param dx number ----@param dy number ----@param dz number ----@param rx number ----@param ry number ----@param rz number ----@param angle number ----@param flipped number ----@param dist number ----@param height number ----@param oldHeight number ----Parameters ----@param x number ----@param y number ----@param z number ----@param transTime number (optional) ----@return nil -function Spring.SetCameraTarget(x, y, z[, transTime]) end - ----Parameters ----@param px number ----@param py number ----@param pz number ----@param tx number ----@param ty number ----@param tz number ----@return nil -function Spring.SetCameraTarget(px, py, pz, tx, ty, tz) end - ----Parameters ----@param camState camState ----@param transitionTime number (default): `0` ----@param transitionTimeFactor number (optional) ----@param transitionTimeExponent number (optional) ----@return bool set -function Spring.SetCameraState(camState[, transitionTime=0[, transitionTimeFactor[, transitionTimeExponent]]]) end - - ---- ----Parameters ----@param unitID number ----@param append boolean (default): `false` ----@return nil -function Spring.SelectUnit(unitID[, append=false]) end - ----Parameters ----@param unitID number ----@return nil -function Spring.DeselectUnit(unitID) end - ----Parameters ----@param unitIDs {[number],...} ----@param append boolean (default): `false` ----@return nil -function Spring.SelectUnitArray(unitIDs[, append=false]) end - ----Parameters ----@param unitMap {[number]=any,...} ----@param append boolean (default): `false` ----@return nil -function Spring.SelectUnitMap(unitMap[, append=false]) end - - ---- ----Fields ----@param position: px number ----@param position: py number ----@param position: pz number ----@param direction: dx number ----@param direction: dy number ----@param direction: dz number ----@param ambientColor: red number ----@param ambientColor: green number ----@param ambientColor: blue number ----@param diffuseColor: red number ----@param diffuseColor: green number ----@param diffuseColor: blue number ----@param specularColor: red number ----@param specularColor: green number ----@param specularColor: blue number ----@param intensityWeight: ambientWeight number ----@param intensityWeight: diffuseWeight number ----@param intensityWeight: specularWeight number ----@param ambientDecayRate: per-frame decay of ambientColor (spread over TTL frames)ambientRedDecay number ----@param ambientDecayRate: per-frame decay of ambientColor (spread over TTL frames)ambientGreenDecay number ----@param ambientDecayRate: per-frame decay of ambientColor (spread over TTL frames)ambientBlueDecay number ----@param diffuseDecayRate: per-frame decay of diffuseColor (spread over TTL frames)diffuseRedDecay number ----@param diffuseDecayRate: per-frame decay of diffuseColor (spread over TTL frames)diffuseGreenDecay number ----@param diffuseDecayRate: per-frame decay of diffuseColor (spread over TTL frames)diffuseBlueDecay number ----@param specularDecayRate: per-frame decay of specularColor (spread over TTL frames)specularRedDecay number ----@param specularDecayRate: per-frame decay of specularColor (spread over TTL frames)specularGreenDecay number ----@param specularDecayRate: per-frame decay of specularColor (spread over TTL frames)specularBlueDecay number ----@param decayFunctionType: *DecayType = 0.0 -> interpret *DecayRate values as linear, else as exponentialambientDecayType number ----@param decayFunctionType: *DecayType = 0.0 -> interpret *DecayRate values as linear, else as exponentialdiffuseDecayType number ----@param decayFunctionType: *DecayType = 0.0 -> interpret *DecayRate values as linear, else as exponentialspecularDecayType number ----@param radius number ----@param fov number ----@param ttl number ----@param priority number ----@param ignoreLOS boolean ----Parameters ----@param lightParams lightParams ----@return number lightHandle -function Spring.AddMapLight(lightParams) end - ----Parameters ----@param lightParams lightParams ----@return number lightHandle -function Spring.AddModelLight(lightParams) end - ----Parameters ----@param lightHandle number ----@param lightParams lightParams ----@return bool success -function Spring.UpdateMapLight(lightHandle, lightParams) end - ----Parameters ----@param lightHandle number ----@param lightParams lightParams ----@return bool success -function Spring.UpdateModelLight(lightHandle, lightParams) end - ----Parameters ----@param lightHandle number ----@param unitOrProjectileID number ----@param enableTracking boolean ----@param unitOrProjectile boolean ----@return bool success -function Spring.SetMapLightTrackingState(lightHandle, unitOrProjectileID, enableTracking, unitOrProjectile) end - ----Parameters ----@param lightHandle number ----@param unitOrProjectileID number ----@param enableTracking boolean ----@param unitOrProjectile boolean ----@return bool success -function Spring.SetModelLightTrackingState(lightHandle, unitOrProjectileID, enableTracking, unitOrProjectile) end - - ---- ----Parameters ----@param unitID number ----@param noDraw boolean ----@return nil -function Spring.SetUnitNoDraw(unitID, noDraw) end - ----Parameters ----@param unitID number ----@param drawMask number ----@return nil -function Spring.SetUnitEngineDrawMask(unitID, drawMask) end - ----Parameters ----@param unitID number ----@param alwaysUpdateMatrix boolean ----@return nil -function Spring.SetUnitAlwaysUpdateMatrix(unitID, alwaysUpdateMatrix) end - ----Parameters ----@param unitID number ----@param unitNoMinimap boolean ----@return nil -function Spring.SetUnitNoMinimap(unitID, unitNoMinimap) end - ----Parameters ----@param unitID number ----@param unitNoSelect boolean ----@return nil -function Spring.SetUnitNoSelect(unitID, unitNoSelect) end - ----Parameters ----@param unitID number ----@param unitLeaveTracks boolean ----@return nil -function Spring.SetUnitLeaveTracks(unitID, unitLeaveTracks) end - ----Parameters ----@param unitID number ----@param featureID number ----@param scaleX number ----@param scaleY number ----@param scaleZ number ----@param offsetX number ----@param offsetY number ----@param offsetZ number ----@param vType number ----@param tType number ----@param Axis number ----@return nil -function Spring.SetUnitSelectionVolumeData(unitID, featureID, scaleX, scaleY, scaleZ, offsetX, offsetY, offsetZ, vType, tType, Axis) end - - ---- ----Parameters ----@param featureID number ----@param noDraw boolean ----@return nil -function Spring.SetFeatureNoDraw(featureID, noDraw) end - ----Parameters ----@param featureID number ----@param engineDrawMask number ----@return nil -function Spring.SetFeatureEngineDrawMask(featureID, engineDrawMask) end - ----Parameters ----@param featureID number ----@param alwaysUpdateMat number ----@return nil -function Spring.SetFeatureAlwaysUpdateMatrix(featureID, alwaysUpdateMat) end - ----Parameters ----@param featureID number ----@param allow boolean ----@return nil -function Spring.SetFeatureFade(featureID, allow) end - ----Parameters ----@param featureID number ----@param scaleX number ----@param scaleY number ----@param scaleZ number ----@param offsetX number ----@param offsetY number ----@param offsetZ number ----@param vType number ----@param tType number ----@param Axis number ----@return nil -function Spring.SetFeatureSelectionVolumeData(featureID, scaleX, scaleY, scaleZ, offsetX, offsetY, offsetZ, vType, tType, Axis) end - - ---- ----Parameters ----@param iconName string ----@param texFile string ----@param size number (optional) ----@param dist number (optional) ----@param radAdjust number (optional) ----@return ?nil|bool added -function Spring.AddUnitIcon(iconName, texFile[, size[, dist[, radAdjust]]]) end - ----Parameters ----@param iconName string ----@return ?nil|bool freed -function Spring.FreeUnitIcon(iconName) end - ----Parameters ----@param unitID number ----@param drawIcon boolean ----@return nil -function Spring.UnitIconSetDraw(unitID, drawIcon) end - ----Parameters ----@param unitDefID number ----@param iconName string ----@return nil -function Spring.SetUnitDefIcon(unitDefID, iconName) end - ----Parameters ----@param unitDefID number ----@param image string ----@return nil -function Spring.SetUnitDefImage(unitDefID, image) end - - ---- ----Parameters ----@param modfile string ----@return bool extracted -function Spring.ExtractModArchiveFile(modfile) end - ----Parameters ----@param path string ----@return ?nil|bool dirCreated -function Spring.CreateDir(path) end - - ---- ----Parameters ----@param action string ----@param actionExtra string (optional) ----@return ?nil|bool commandSet -function Spring.SetActiveCommand(action[, actionExtra]) end - ----Parameters ----@param cmdIndex number ----@param button number (default): `1` ----@param leftClick boolean (optional) ----@param rightClick ?bool ----@param alt ?bool ----@param ctrl ?bool ----@param meta ?bool ----@param shift ?bool ----@return ?nil|bool commandSet -function Spring.SetActiveCommand(cmdIndex[, button=1][, leftClick], rightClick, alt, ctrl, meta, shift) end - ----Parameters ----@param config string ----@return nil -function Spring.LoadCmdColorsConfig(config) end - ----Parameters ----@param config string ----@return nil -function Spring.LoadCtrlPanelConfig(config) end - ----@return nil -function Spring.ForceLayoutUpdate() end - ----Parameters ----@param enable boolean ----@return nil -function Spring.SetDrawSelectionInfo(enable) end - ----Parameters ----@param state boolean ----@return nil -function Spring.SetBoxSelectionByEngine(state) end - ----Parameters ----@param teamID number ----@param r number ----@param g number ----@param b number ----@return nil -function Spring.SetTeamColor(teamID, r, g, b) end - ----Parameters ----@param cmdName string ----@param iconFileName string ----@param overwrite boolean (default): `true` ----@param hotSpotTopLeft boolean (default): `false` ----@return ?nil|bool assigned -function Spring.AssignMouseCursor(cmdName, iconFileName[, overwrite=true[, hotSpotTopLeft=false]]) end - ----Parameters ----@param oldFileName string ----@param newFileName string ----@param hotSpotTopLeft boolean (default): `false` ----@return ?nil|bool assigned -function Spring.ReplaceMouseCursor(oldFileName, newFileName[, hotSpotTopLeft=false]) end - ----Parameters ----@param cmdID number ----@param cmdReference string|number (optional) ----@return ?nil|bool assigned -function Spring.SetCustomCommandDrawData(cmdID[, cmdReference]) end - - ---- ----Parameters ----@param x number ----@param y number ----@return nil -function Spring.WarpMouse(x, y) end - ----Parameters ----@param cursorName string ----@param cursorScale number (default): `1.0` ----@return nil -function Spring.SetMouseCursor(cursorName[, cursorScale=1.0]) end - - ---- ----Parameters ----@param always table ----@param LOS table ----@param radar table ----@param jam table ----@param radar2 table ----@return nil -function Spring.SetLosViewColors(always, LOS, radar, jam, radar2) end - ----Parameters ----@param rotVal number (default): `0` ----@param rotVel number (default): `0` ----@param rotAcc number (default): `0` ----@param rotValRng number (default): `0` ----@param rotVelRng number (default): `0` ----@param rotAccRng number (default): `0` ----@return nil -function Spring.SetNanoProjectileParams([rotVal=0[, rotVel=0[, rotAcc=0[, rotValRng=0[, rotVelRng=0[, rotAccRng=0]]]]]]) end - - ---- ----Parameters ----@param name string ----@param value number ----@param useOverlay boolean (default): `false` ----@return nil -function Spring.SetConfigInt(name, value[, useOverlay=false]) end - ----Parameters ----@param name string ----@param value number ----@param useOverla boolean (default): `false` ----@return nil -function Spring.SetConfigFloat(name, value[, useOverla=false]) end - ----Parameters ----@param name string ----@param value number ----@param useOverlay boolean (default): `false` ----@return nil -function Spring.SetConfigString(name, value[, useOverlay=false]) end - ----@return nil -function Spring.Quit() end - - ---- ----Parameters ----@param unitID number ----@param groupID number ----@return nil -function Spring.SetUnitGroup(unitID, groupID) end - - ---- ----Fields ----@param right bool ----@param alt bool ----@param ctrl bool ----@param shift bool ----@param meta bool ----Parameters ----@param cmdID number ----@param params table ----@param options cmdOpts ----@return nil|true -function Spring.GiveOrder(cmdID, params, options) end - ----Parameters ----@param unitID number ----@param cmdID number ----@param params table ----@param options cmdOpts ----@return nil|true -function Spring.GiveOrderToUnit(unitID, cmdID, params, options) end - ----Parameters ----@param unitMap table ----@param cmdID number ----@param params table ----@param options cmdOpts ----@return nil|true -function Spring.GiveOrderToUnitMap(unitMap, cmdID, params, options) end - ----Parameters ----@param unitArray {number,...} ----@param cmdID number ----@param params table ----@param options cmdOpts ----@return nil|true -function Spring.GiveOrderToUnitArray(unitArray, cmdID, params, options) end - ----Fields ----@param cmdID number ----@param params table ----@param options cmdOpts ----Parameters ----@param unitID number ----@param cmdArray {cmdSpec,...} ----@return bool ordersGiven -function Spring.GiveOrderArrayToUnit(unitID, cmdArray) end - ----Parameters ----@param unitMap table ----@param cmdArray {cmdSpec,...} ----@return bool ordersGiven -function Spring.GiveOrderArrayToUnitMap(unitMap, cmdArray) end - ----Parameters ----@param unitArray {number,...} ----@param cmdArray {cmdSpec,...} ----@param pairwise bool (default): `false` ----@return nil|bool -function Spring.GiveOrderArrayToUnitArray(unitArray, cmdArray[, pairwise=false]) end - ----Parameters ----@param spacing number ----@return nil -function Spring.SetBuildSpacing(spacing) end - ----Parameters ----@param facing number ----@return nil -function Spring.SetBuildFacing(facing) end - - ---- ----Parameters ----@param message string ----@param mode string ----@return nil -function Spring.SendLuaUIMsg(message, mode) end - ----Parameters ----@param message string ----@return nil -function Spring.SendLuaGaiaMsg(message) end - ----Parameters ----@param message string ----@return nil -function Spring.SendLuaRulesMsg(message) end - ----Parameters ----@param msg string ----Parameters ----@param x number ----@param y number ----@param z number ----@return nil -function Spring.SetLastMessagePosition(x, y, z) end - - ---- ----Parameters ----@param resource string ----@param shareLevel number ----@return nil -function Spring.SetShareLevel(resource, shareLevel) end - ----Parameters ----@param teamID number ----@param units string ----@return nil -function Spring.ShareResources(teamID, units) end - ----Parameters ----@param teamID number ----@param resource string ----@param amount number ----@return nil -function Spring.ShareResources(teamID, resource, amount) end - - ---- ----Parameters ----@param x number ----@param y number ----@param z number ----@param text string (default): `""` ----@param localOnly boolean (optional) ----@return nil -function Spring.MarkerAddPoint(x, y, z[, text=""[, localOnly]]) end - ----Parameters ----@param x1 number ----@param y1 number ----@param z1 number ----@param x2 number ----@param y2 number ----@param z2 number ----@param localOnly boolean (default): `false` ----@param playerId number (optional) ----@return nil -function Spring.MarkerAddLine(x1, y1, z1, x2, y2, z2[, localOnly=false[, playerId]]) end - ----Parameters ----@param x number ----@param y number ----@param z number ----@param noop ----@param localOnly boolean (default): `false` ----@param playerId number (optional) ----@param alwaysErase boolean (default): `false` ----@return nil -function Spring.MarkerErasePosition(x, y, z, noop[, localOnly=false[, playerId[, alwaysErase=false]]]) end - - ---- ----Parameters ----@param params: fogStart number ----@param params: fogEnd number ----@param params: sunColor rgb ----@param params: skyColor rgb ----@param params: cloudColor rgb ----@return nil -function Spring.SetAtmosphere(params) end - ----Spring.SetAtmosphere({ fogStart = 0, fogEnd = 0.5, fogColor = { 0.7, 0.2, 0.2, 1 }}) ----Parameters ----@param dirX number ----@param dirY number ----@param dirZ number ----@param intensity number (default): `true` ----@return nil -function Spring.SetSunDirection(dirX, dirY, dirZ[, intensity=true]) end - ----Parameters ----@param params: groundAmbientColor rgb ----@param params: groundDiffuseColor rgb ----@return nil -function Spring.SetSunLighting(params) end - ----Spring.SetSunLighting({groundAmbientColor = {1, 0.1, 1}, groundDiffuseColor = {1, 0.1, 1} }) ----Fields ----@param splatTexMults rgba ----@param splatTexScales rgba ----@param voidWater boolean ----@param voidGround boolean ----@param splatDetailNormalDiffuseAlpha boolean ----Parameters ----@param params mapRenderingParams ----@return nil -function Spring.SetMapRenderingParams(params) end - ----Parameters ----@param normal boolean (default): `true` ----@param shadow boolean (default): `false` ----@return bool updated -function Spring.ForceTesselationUpdate([normal=true[, shadow=false]]) end - - ---- ----Parameters ----@param aiTeam number ----@param message string ----@return ?nil|bool ai_processed -function Spring.SendSkirmishAIMessage(aiTeam, message) end - - ---- ----Parameters ----@param sectionName string ----@param logLevel ?string|number ----@return nil -function Spring.SetLogSectionFilterLevel(sectionName, logLevel) end - ----Parameters ----@param itersPerBatch integer (optional) ----@param numStepsPerIter integer (optional) ----@param minStepsPerIter integer (optional) ----@param maxStepsPerIter integer (optional) ----@param minLoopRunTime number (optional) ----@param maxLoopRunTime number (optional) ----@param baseRunTimeMult number (optional) ----@param baseMemLoadMult number (optional) ----@return nil -function Spring.GarbageCollectCtrl([itersPerBatch[, numStepsPerIter[, minStepsPerIter[, maxStepsPerIter[, minLoopRunTime[, maxLoopRunTime[, baseRunTimeMult[, baseMemLoadMult]]]]]]]]) end - ----Parameters ----@param drawSky boolean ----@return nil -function Spring.SetDrawSky(drawSky) end - ----Parameters ----@param drawWater boolean ----@return nil -function Spring.SetDrawWater(drawWater) end - ----Parameters ----@param drawGround boolean ----@return nil -function Spring.SetDrawGround(drawGround) end - ----Parameters ----@param drawGroundDeferred boolean ----@param drawGroundForward boolean (optional) ----Parameters ----@param drawUnitsDeferred boolean ----@param drawFeaturesDeferred boolean ----@param drawUnitsForward boolean (optional) ----@param drawFeaturesForward boolean (optional) ----@return nil -function Spring.SetDrawModelsDeferred(drawUnitsDeferred, drawFeaturesDeferred[, drawUnitsForward[, drawFeaturesForward]]) end - ----Parameters ----@param allowCaptureMode boolean ----@return nil -function Spring.SetVideoCapturingMode(allowCaptureMode) end - ----Parameters ----@param timeOffset boolean ----@return nil -function Spring.SetVideoCapturingTimeOffset(timeOffset) end - ----Fields ----@param absorb rgb ----@param baseColor rgb ----@param minColor rgb ----@param surfaceColor rgb ----@param diffuseColor rgb ----@param specularColor rgb ----@param planeColor rgb ----@param texture string ----@param foamTexture string ----@param normalTexture string ----@param damage number ----@param repeatX number ----@param repeatY number ----@param surfaceAlpha number ----@param ambientFactor number ----@param diffuseFactor number ----@param specularFactor number ----@param specularPower number ----@param fresnelMin number ----@param fresnelMax number ----@param fresnelPower number ----@param reflectionDistortion number ----@param blurBase number ----@param blurExponent number ----@param perlinStartFreq number ----@param perlinLacunarity number ----@param perlinAmplitude number ----@param numTiles number ----@param shoreWaves boolean ----@param forceRendering boolean ----@param hasWaterPlane boolean ----Parameters ----@param waterParams waterParams ----@return nil -function Spring.SetWaterParams(waterParams) end - - ---- ----Parameters ----@param unitDefID number ----@return nil -function Spring.PreloadUnitDefModel(unitDefID) end - ----Parameters ----@param featureDefID number ----@return nil -function Spring.PreloadFeatureDefModel(featureDefID) end - ----Parameters ----@param name string ----@return nil -function Spring.PreloadSoundItem(name) end - ----Parameters ----@param modelName string ----@return ?nil|bool success -function Spring.LoadModelTextures(modelName) end - - ---- ----@return nil|number decalIndex -function Spring.CreateDecal() end - ----Parameters ----@param decalIndex number ----@return nil -function Spring.DestroyDecal(decalIndex) end - ----Parameters ----@param decalIndex number ----@param posX number ----@param posY number ----@param posZ number ----@return bool decalSet -function Spring.SetDecalPos(decalIndex, posX, posY, posZ) end - ----Parameters ----@param decalIndex number ----@param sizeX number ----@param sizeY number ----@return bool decalSet -function Spring.SetDecalSize(decalIndex, sizeX, sizeY) end - ----Parameters ----@param decalIndex number ----@param rot number ----@return nil|bool decalSet -function Spring.SetDecalRotation(decalIndex, rot) end - ----Parameters ----@param decalIndex number ----@param textureName string ----@return nil|bool decalSet -function Spring.SetDecalTexture(decalIndex, textureName) end - ----Parameters ----@param decalIndex number ----@param alpha number ----@return nil|bool decalSet -function Spring.SetDecalAlpha(decalIndex, alpha) end - - ---- ----Parameters ----@param x number ----@param y number ----@param width number ----@param height number ----@return nil -function Spring.SDLSetTextInputRect(x, y, width, height) end - ----@return nil -function Spring.SDLStartTextInput() end - ----@return nil -function Spring.SDLStopTextInput() end - - ---- ----Parameters ----@param displayIndex number ----@param winPosX number ----@param winPosY number ----@param winSizeX number ----@param winSizeY number ----@param fullScreen boolean ----@param borderless boolean ----@return nil -function Spring.SetWindowGeometry(displayIndex, winPosX, winPosY, winSizeX, winSizeY, fullScreen, borderless) end - ----@return bool minimized -function Spring.SetWindowMinimized() end - ----@return bool maximized -function Spring.SetWindowMaximized() end - - ---- ----Parameters ----@param startScript string ----@return nil -function Spring.Reload(startScript) end - ----Parameters ----@param commandline_args string ----@param startScript string ----@return nil -function Spring.Restart(commandline_args, startScript) end - ----Parameters ----@param commandline_args string ----@param startScript string ----@return nil -function Spring.Start(commandline_args, startScript) end - ----Parameters ----@param iconFileName string ----@return nil -function Spring.SetWMIcon(iconFileName) end - ----Parameters ----@param title string ----@param titleShort string (default): `title` ----@return nil -function SetWMCaption(title[, titleShort=title]) end - ----Parameters ----@param threadName string (default): `main` ----@return nil -function Spring.ClearWatchDogTimer([threadName=main]) end - ----Parameters ----@param text string ----@return nil -function Spring.SetClipboard(text) end - ----Parameters ----@param sleep number ----@return bool when true caller should continue calling `Spring.Yield` during the widgets/gadgets load, when false it shouldn't call it any longer. -function Spring.Yield(sleep) end - diff --git a/luamocks/autogenerated/UnsyncedRead.lua b/luamocks/autogenerated/UnsyncedRead.lua deleted file mode 100644 index e2e6c8335f0..00000000000 --- a/luamocks/autogenerated/UnsyncedRead.lua +++ /dev/null @@ -1,1262 +0,0 @@ ----UnsyncedRead - ---- ----@return ?nil|bool isReplay -function Spring.IsReplay() end - ----@return ?nil|number timeInSeconds -function Spring.GetReplayLength() end - - ---- ----@return string name -function Spring.GetGameName() end - ----@return string name name .. version from Modinfo.lua. E.g. "Spring: 1944 test-5640-ac2d15b". -function Spring.GetMenuName() end - - ---- ----Parameters ----@param profilerName string ----@param frameData boolean (default): `false` ----@return number total in ms -function Spring.GetProfilerTimeRecord(profilerName[, frameData=false]) end - ----@return number current in ms -function Spring.GetProfilerTimeRecord(profilerName[, frameData=false]) end - ----@return number max_dt -function Spring.GetProfilerTimeRecord(profilerName[, frameData=false]) end - ----@return number time_pct -function Spring.GetProfilerTimeRecord(profilerName[, frameData=false]) end - ----@return number peak_pct -function Spring.GetProfilerTimeRecord(profilerName[, frameData=false]) end - ----@return ?nil|{[number]=number,...} frameData where key is the frame index and value is duration -function Spring.GetProfilerTimeRecord(profilerName[, frameData=false]) end - ----@return {string,...} profilerNames -function Spring.GetProfilerRecordNames() end - ----@return number luaHandleAllocedMem in kilobytes -function Spring.GetLuaMemUsage() end - ----@return number luaHandleNumAllocs divided by 1000 -function Spring.GetLuaMemUsage() end - ----@return number luaGlobalAllocedMem in kilobytes -function Spring.GetLuaMemUsage() end - ----@return number luaGlobalNumAllocs divided by 1000 -function Spring.GetLuaMemUsage() end - ----@return number luaUnsyncedGlobalAllocedMem in kilobytes -function Spring.GetLuaMemUsage() end - ----@return number luaUnsyncedGlobalNumAllocs divided by 1000 -function Spring.GetLuaMemUsage() end - ----@return number luaSyncedGlobalAllocedMem in kilobytes -function Spring.GetLuaMemUsage() end - ----@return number luaSyncedGlobalNumAllocs divided by 1000 -function Spring.GetLuaMemUsage() end - ----@return number usedMem in MB -function Spring.GetVidMemUsage() end - ----@return number availableMem in MB -function Spring.GetVidMemUsage() end - - ---- ----@return Timer -function Spring.GetTimer() end - ----@return Timer -function Spring.GetTimerMicros() end - ----Parameters ----@param lastFrameTime boolean (default): `false` ----@return Timer -function Spring.GetFrameTimer([lastFrameTime=false]) end - ----Parameters ----@param endTimer Timer ----@param startTimer Timer ----@param returnMs boolean (default): `false` ----@param fromMicroSecs boolean (default): `false` ----@return number timeAmount -function Spring.DiffTimers(endTimer, startTimer[, returnMs=false[, fromMicroSecs=false]]) end - - ---- ----@return number numDisplays as returned by `SDL_GetNumVideoDisplays` -function Spring.GetNumDisplays() end - ----@return number viewSizeX in px -function Spring.GetViewGeometry() end - ----@return number viewSizeY in px -function Spring.GetViewGeometry() end - ----@return number viewPosX offset from leftmost screen left border in px -function Spring.GetViewGeometry() end - ----@return number viewPosY offset from bottommost screen bottom border in px -function Spring.GetViewGeometry() end - ----@return number dualViewSizeX in px -function Spring.GetDualViewGeometry() end - ----@return number dualViewSizeY in px -function Spring.GetDualViewGeometry() end - ----@return number dualViewPosX offset from leftmost screen left border in px -function Spring.GetDualViewGeometry() end - ----@return number dualViewPosY offset from bottommost screen bottom border in px -function Spring.GetDualViewGeometry() end - ----@return number winSizeX in px -function Spring.GetWindowGeometry() end - ----@return number winSizeY in px -function Spring.GetWindowGeometry() end - ----@return number winPosX in px -function Spring.GetWindowGeometry() end - ----@return number winPosY in px -function Spring.GetWindowGeometry() end - ----@return number windowBorderTop in px -function Spring.GetWindowGeometry() end - ----@return number windowBorderLeft in px -function Spring.GetWindowGeometry() end - ----@return number windowBorderBottom in px -function Spring.GetWindowGeometry() end - ----@return number windowBorderRight in px -function Spring.GetWindowGeometry() end - ----Parameters ----@param displayIndex number (default): `-1` ----@param queryUsable boolean (default): `false` ----@return number screenSizeX in px -function Spring.GetScreenGeometry([displayIndex=-1[, queryUsable=false]]) end - ----@return number screenSizeY in px -function Spring.GetScreenGeometry([displayIndex=-1[, queryUsable=false]]) end - ----@return number screenPosX in px -function Spring.GetScreenGeometry([displayIndex=-1[, queryUsable=false]]) end - ----@return number screenPosY in px -function Spring.GetScreenGeometry([displayIndex=-1[, queryUsable=false]]) end - ----@return number windowBorderTop in px -function Spring.GetScreenGeometry([displayIndex=-1[, queryUsable=false]]) end - ----@return number windowBorderLeft in px -function Spring.GetScreenGeometry([displayIndex=-1[, queryUsable=false]]) end - ----@return number windowBorderBottom in px -function Spring.GetScreenGeometry([displayIndex=-1[, queryUsable=false]]) end - ----@return number windowBorderRight in px -function Spring.GetScreenGeometry([displayIndex=-1[, queryUsable=false]]) end - ----@return ?nil|number screenUsableSizeX in px -function Spring.GetScreenGeometry([displayIndex=-1[, queryUsable=false]]) end - ----@return ?nil|number screenUsableSizeY in px -function Spring.GetScreenGeometry([displayIndex=-1[, queryUsable=false]]) end - ----@return ?nil|number screenUsablePosX in px -function Spring.GetScreenGeometry([displayIndex=-1[, queryUsable=false]]) end - ----@return ?nil|number screenUsablePosY in px -function Spring.GetScreenGeometry([displayIndex=-1[, queryUsable=false]]) end - ----@return number minimapPosX in px -function Spring.GetMiniMapGeometry() end - ----@return number minimapPosY in px -function Spring.GetMiniMapGeometry() end - ----@return number minimapSizeX in px -function Spring.GetMiniMapGeometry() end - ----@return number minimapSizeY in px -function Spring.GetMiniMapGeometry() end - ----@return bool minimized -function Spring.GetMiniMapGeometry() end - ----@return bool maximized -function Spring.GetMiniMapGeometry() end - ----@return number amount in radians -function Spring.GetMiniMapRotation() end - ----@return string|false position "left"|"right" when dual screen is enabled, false when not -function Spring.GetMiniMapDualScreen() end - ----@return ?nil|number bottomLeftX -function Spring.GetSelectionBox() end - ----@return ?nil|number topRightX -function Spring.GetSelectionBox() end - ----@return ?nil|number topRightY -function Spring.GetSelectionBox() end - ----@return ?nil|number bottomLeftY -function Spring.GetSelectionBox() end - ----@return bool -function Spring.GetDrawSelectionInfo() end - ----Parameters ----@param x number ----@param y number ----@return bool isAbove -function Spring.IsAboveMiniMap(x, y) end - ----@return number low_16bit -function Spring.GetDrawFrame() end - ----@return number high_16bit -function Spring.GetDrawFrame() end - ----@return nil|number offset of the current draw frame from the last sim frame, expressed in fractions of a frame -function Spring.GetFrameTimeOffset() end - ----@return nil|number lastUpdateSeconds -function Spring.GetLastUpdateSeconds() end - ----@return bool allowRecord -function Spring.GetVideoCapturingMode() end - - ---- ----Parameters ----@param unitID number ----@return nil|bool isAllied nil with unitID cannot be parsed -function Spring.IsUnitAllied(unitID) end - ----Parameters ----@param unitID number ----@return nil|bool isSelected nil when unitID cannot be parsed -function Spring.IsUnitSelected(unitID) end - ----Parameters ----@param unitID number ----@return nil|bool draw nil when unitID cannot be parsed -function Spring.GetUnitLuaDraw(unitID) end - ----Parameters ----@param unitID number ----@return nil|bool nil when unitID cannot be parsed -function Spring.GetUnitNoDraw(unitID) end - ----Parameters ----@param unitID number ----@return nil|bool nil when unitID cannot be parsed -function Spring.GetUnitEngineDrawMask(unitID) end - ----Parameters ----@param unitID number ----@return nil|bool nil when unitID cannot be parsed -function Spring.GetUnitAlwaysUpdateMatrix(unitID) end - ----Parameters ----@param unitID number ----@return nil|number nil when unitID cannot be parsed -function Spring.GetUnitDrawFlag(unitID) end - ----Parameters ----@param unitID number ----@return nil|bool nil when unitID cannot be parsed -function Spring.GetUnitNoMinimap(unitID) end - ----Parameters ----@param unitID number ----@return nil|bool nil when unitID cannot be parsed -function Spring.GetUnitNoSelect(unitID) end - ----Parameters ----@param unitID number ----@param nil nil|bool ----Parameters ----@param unitID number ----@return number|nil scaleX nil when unitID cannot be parsed -function Spring.GetUnitSelectionVolumeData(unitID) end - ----@return number scaleY -function Spring.GetUnitSelectionVolumeData(unitID) end - ----@return number scaleZ -function Spring.GetUnitSelectionVolumeData(unitID) end - ----@return number offsetX -function Spring.GetUnitSelectionVolumeData(unitID) end - ----@return number offsetY -function Spring.GetUnitSelectionVolumeData(unitID) end - ----@return number offsetZ -function Spring.GetUnitSelectionVolumeData(unitID) end - ----@return number volumeType -function Spring.GetUnitSelectionVolumeData(unitID) end - ----@return number useContHitTest -function Spring.GetUnitSelectionVolumeData(unitID) end - ----@return number getPrimaryAxis -function Spring.GetUnitSelectionVolumeData(unitID) end - ----@return bool ignoreHits -function Spring.GetUnitSelectionVolumeData(unitID) end - - ---- ----Parameters ----@param featureID number ----@return nil|bool nil when featureID cannot be parsed -function Spring.GetFeatureLuaDraw(featureID) end - ----Parameters ----@param featureID number ----@return nil|bool nil when featureID cannot be parsed -function Spring.GetFeatureNoDraw(featureID) end - ----Parameters ----@param featureID number ----@return nil|bool nil when featureID cannot be parsed -function Spring.GetFeatureEngineDrawMask(featureID) end - ----Parameters ----@param featureID number ----@return nil|bool nil when featureID cannot be parsed -function Spring.GetFeatureAlwaysUpdateMatrix(featureID) end - ----Parameters ----@param featureID number ----@return nil|number nil when featureID cannot be parsed -function Spring.GetFeatureDrawFlag(featureID) end - ----Parameters ----@param featureID number ----@return number|nil scaleX nil when unitID cannot be parsed -function Spring.GetFeatureSelectionVolumeData(featureID) end - ----@return number scaleY -function Spring.GetFeatureSelectionVolumeData(featureID) end - ----@return number scaleZ -function Spring.GetFeatureSelectionVolumeData(featureID) end - ----@return number offsetX -function Spring.GetFeatureSelectionVolumeData(featureID) end - ----@return number offsetY -function Spring.GetFeatureSelectionVolumeData(featureID) end - ----@return number offsetZ -function Spring.GetFeatureSelectionVolumeData(featureID) end - ----@return number volumeType -function Spring.GetFeatureSelectionVolumeData(featureID) end - ----@return number useContHitTest -function Spring.GetFeatureSelectionVolumeData(featureID) end - ----@return number getPrimaryAxis -function Spring.GetFeatureSelectionVolumeData(featureID) end - ----@return bool ignoreHits -function Spring.GetFeatureSelectionVolumeData(featureID) end - - ---- ----Parameters ----@param unitID number ----@return number|nil m11 nil when unitID cannot be parsed -function Spring.GetUnitTransformMatrix(unitID) end - ----@return number m12 -function Spring.GetUnitTransformMatrix(unitID) end - ----@return number m13 -function Spring.GetUnitTransformMatrix(unitID) end - ----@return number m14 -function Spring.GetUnitTransformMatrix(unitID) end - ----@return number m21 -function Spring.GetUnitTransformMatrix(unitID) end - ----@return number m22 -function Spring.GetUnitTransformMatrix(unitID) end - ----@return number m23 -function Spring.GetUnitTransformMatrix(unitID) end - ----@return number m24 -function Spring.GetUnitTransformMatrix(unitID) end - ----@return number m31 -function Spring.GetUnitTransformMatrix(unitID) end - ----@return number m32 -function Spring.GetUnitTransformMatrix(unitID) end - ----@return number m33 -function Spring.GetUnitTransformMatrix(unitID) end - ----@return number m34 -function Spring.GetUnitTransformMatrix(unitID) end - ----@return number m41 -function Spring.GetUnitTransformMatrix(unitID) end - ----@return number m42 -function Spring.GetUnitTransformMatrix(unitID) end - ----@return number m43 -function Spring.GetUnitTransformMatrix(unitID) end - ----@return number m44 -function Spring.GetUnitTransformMatrix(unitID) end - ----Parameters ----@param featureID number ----@return number|nil m11 nil when featureID cannot be parsed -function Spring.GetFeatureTransformMatrix(featureID) end - ----@return number m12 -function Spring.GetFeatureTransformMatrix(featureID) end - ----@return number m13 -function Spring.GetFeatureTransformMatrix(featureID) end - ----@return number m14 -function Spring.GetFeatureTransformMatrix(featureID) end - ----@return number m21 -function Spring.GetFeatureTransformMatrix(featureID) end - ----@return number m22 -function Spring.GetFeatureTransformMatrix(featureID) end - ----@return number m23 -function Spring.GetFeatureTransformMatrix(featureID) end - ----@return number m24 -function Spring.GetFeatureTransformMatrix(featureID) end - ----@return number m31 -function Spring.GetFeatureTransformMatrix(featureID) end - ----@return number m32 -function Spring.GetFeatureTransformMatrix(featureID) end - ----@return number m33 -function Spring.GetFeatureTransformMatrix(featureID) end - ----@return number m34 -function Spring.GetFeatureTransformMatrix(featureID) end - ----@return number m41 -function Spring.GetFeatureTransformMatrix(featureID) end - ----@return number m42 -function Spring.GetFeatureTransformMatrix(featureID) end - ----@return number m43 -function Spring.GetFeatureTransformMatrix(featureID) end - ----@return number m44 -function Spring.GetFeatureTransformMatrix(featureID) end - ----Parameters ----@param forced boolean (default): `false` ----@return bool -function Spring.MakeGLDBQuery([forced=false]) end - ----Parameters ----@param blockingCall boolean (default): `true` ----@return nil|bool ready -function Spring.GetGLDBQuery([blockingCall=true]) end - ----@return bool drivers not ok when true -function Spring.GetGLDBQuery([blockingCall=true]) end - ----@return number maxCtxX -function Spring.GetGLDBQuery([blockingCall=true]) end - ----@return number maxCtxY -function Spring.GetGLDBQuery([blockingCall=true]) end - ----@return string url -function Spring.GetGLDBQuery([blockingCall=true]) end - ----@return string driver -function Spring.GetGLDBQuery([blockingCall=true]) end - ----Parameters ----@param collectGC boolean (default): `false` ----@return nil|number GC values are expressed in Kbytes: #bytes/2^10 -function Spring.GetSyncedGCInfo([collectGC=false]) end - - ---- ----Parameters ----@param unitID number ----@return nil|bool inView nil when unitID cannot be parsed -function Spring.IsUnitInView(unitID) end - ----Parameters ----@param unitID number ----@param radius number (optional) ----@param checkIcon boolean ----@return nil|bool isVisible nil when unitID cannot be parsed -function Spring.IsUnitVisible(unitID[, radius], checkIcon) end - ----Parameters ----@param unitID number ----@return nil|bool isUnitIcon nil when unitID cannot be parsed -function Spring.IsUnitIcon(unitID) end - ----Parameters ----@param minX number ----@param minY number ----@param minZ number ----@param maxX number ----@param maxY number ----@param maxZ number ----@return bool inView -function Spring.IsAABBInView(minX, minY, minZ, maxX, maxY, maxZ) end - ----Parameters ----@param posX number ----@param posY number ----@param posZ number ----@param radius number (default): `0` ----@return bool inView -function Spring.IsSphereInView(posX, posY, posZ[, radius=0]) end - ----Parameters ----@param unitID number ----@param midPos boolean (default): `false` ----@return number|nil x nil when unitID cannot be parsed -function Spring.GetUnitViewPosition(unitID[, midPos=false]) end - ----@return number y -function Spring.GetUnitViewPosition(unitID[, midPos=false]) end - ----@return number z -function Spring.GetUnitViewPosition(unitID[, midPos=false]) end - ----Parameters ----@param teamID number (default): `-1` ----@param radius number (default): `30` ----@param icons boolean (default): `true` ----@return nil|{[number],...} unitIDs -function Spring.GetVisibleUnits([teamID=-1[, radius=30[, icons=true]]]) end - ----Parameters ----@param teamID number (default): `-1` ----@param radius number (default): `30` ----@param icons boolean (default): `true` ----@param geos boolean (default): `true` ----@return nil|{[number],...} featureIDs -function Spring.GetVisibleFeatures([teamID=-1[, radius=30[, icons=true[, geos=true]]]]) end - ----Parameters ----@param allyTeamID number (default): `-1` ----@param addSyncedProjectiles boolean (default): `true` ----@param addWeaponProjectiles boolean (default): `true` ----@param addPieceProjectiles boolean (default): `true` ----@return nil|{[number],...} projectileIDs -function Spring.GetVisibleProjectiles([allyTeamID=-1[, addSyncedProjectiles=true[, addWeaponProjectiles=true[, addPieceProjectiles=true]]]]) end - ----@return nil -function Spring.ClearUnitsPreviousDrawFlag() end - ----@return nil -function Spring.ClearFeaturesPreviousDrawFlag() end - ----Parameters ----@param left number ----@param top number ----@param right number ----@param bottom number ----@param allegiance number (default): `-1` ----@return nil|{[number],...} unitIDs -function Spring.GetUnitsInScreenRectangle(left, top, right, bottom[, allegiance=-1]) end - ----Parameters ----@param left number ----@param top number ----@param right number ----@param bottom number ----@return nil|{[number],...} featureIDs -function Spring.GetFeaturesInScreenRectangle(left, top, right, bottom) end - ----@return number playerID -function Spring.GetLocalPlayerID() end - ----@return number teamID -function Spring.GetLocalTeamID() end - ----@return number allyTeamID -function Spring.GetLocalAllyTeamID() end - ----@return bool spectating -function Spring.GetSpectatingState() end - ----@return bool spectatingFullView -function Spring.GetSpectatingState() end - ----@return bool spectatingFullSelect -function Spring.GetSpectatingState() end - ----@return {[number],...} unitIDs -function Spring.GetSelectedUnits() end - ----@return {[number]={number,...},...} where keys are unitDefIDs and values are unitIDs -function Spring.GetSelectedUnitsSorted() end - ----@return n the number of unitDefIDs -function Spring.GetSelectedUnitsSorted() end - ----@return {[number]=number,...} unitsCounts where keys are unitDefIDs and values are counts -function Spring.GetSelectedUnitsCounts() end - ----@return n the number of unitDefIDs -function Spring.GetSelectedUnitsCounts() end - ----@return number selectedUnitsCount -function Spring.GetSelectedUnitsCount() end - ----@return bool when true engine won't select units inside selection box when released -function Spring.GetBoxSelectionByEngine() end - ----@return bool -function Spring.IsGUIHidden() end - ----@return shadowsLoaded -function Spring.HaveShadows() end - ----@return bool useAdvShading -function Spring.HaveAdvShading() end - ----@return bool groundUseAdvShading -function Spring.HaveAdvShading() end - ----@return number waterRendererID -function Spring.GetWaterMode() end - ----@return string waterRendererName -function Spring.GetWaterMode() end - ----@return nil|string "normal"|"height"|"metal"|"pathTraversability"|"los" -function Spring.GetMapDrawMode() end - ----Parameters ----@param texSquareX number ----@param texSquareY number ----@param texMipLevel number ----@param luaTexName string ----@return nil|bool success -function Spring.GetMapSquareTexture(texSquareX, texSquareY, texMipLevel, luaTexName) end - ----Fields ----@param r number ----@param g number ----@param b number ----@return { always=rgb, LOS=rgb, radar=rgb, jam=rgb, radar2=rgb } -function Spring.GetLosViewColors() end - ----@return number rotVal in degrees -function Spring.GetNanoProjectileParams() end - ----@return number rotVel in degrees -function Spring.GetNanoProjectileParams() end - ----@return number rotAcc in degrees -function Spring.GetNanoProjectileParams() end - ----@return number rotValRng in degrees -function Spring.GetNanoProjectileParams() end - ----@return number rotVelRng in degrees -function Spring.GetNanoProjectileParams() end - ----@return number rotAccRng in degrees -function Spring.GetNanoProjectileParams() end - ----@return {[string] = number} where keys are names and values are indices -function Spring.GetCameraNames() end - ----Fields ----@param name string ----@param mode number ----@param fov number ----@param px number ----@param py number ----@param pz number ----@param dx number ----@param dy number ----@param dz number ----@param rx number ----@param ry number ----@param rz number ----@param angle number ----@param flipped number ----@param dist number ----@param height number ----@param oldHeight number ----Parameters ----@param useReturns boolean (default): `true` ----@return any|camState ret1 -function Spring.GetCameraState([useReturns=true]) end - ----@return any|nil ret2 -function Spring.GetCameraState([useReturns=true]) end - ----@return any|nil retn -function Spring.GetCameraState([useReturns=true]) end - ----@return posX -function Spring.GetCameraPosition() end - ----@return posY -function Spring.GetCameraPosition() end - ----@return posZ -function Spring.GetCameraPosition() end - ----@return dirX -function Spring.GetCameraDirection() end - ----@return dirY -function Spring.GetCameraDirection() end - ----@return dirZ -function Spring.GetCameraDirection() end - ----@return rotX in radians -function Spring.GetCameraRotation() end - ----@return rotY in radians -function Spring.GetCameraRotation() end - ----@return rotZ in radians -function Spring.GetCameraRotation() end - ----@return number vFOV -function Spring.GetCameraFOV() end - ----@return number hFOV -function Spring.GetCameraFOV() end - ----Fields ----@param x number ----@param y number ----@param z number ----@return { forward = xyz, up = xyz, right = xyz, topFrustumPlane = xyz, botFrustumPlane = xyz, lftFrustumPlane = xyz, rgtFrustumPlane = xyz } -function Spring.GetCameraVectors() end - ----Parameters ----@param x number ----@param y number ----@param z number ----@return viewPortX -function Spring.WorldToScreenCoords(x, y, z) end - ----@return viewPortY -function Spring.WorldToScreenCoords(x, y, z) end - ----@return viewPortZ -function Spring.WorldToScreenCoords(x, y, z) end - ----Parameters ----@param screenX number ----@param screenY number ----@param onlyCoords boolean (default): `false` ----@param useMinimap boolean (default): `false` ----@param includeSky boolean (default): `false` ----@param ignoreWater boolean (default): `false` ----@param heightOffset number (default): `0` ----@return nil|string description of traced position -function Spring.TraceScreenRay(screenX, screenY[, onlyCoords=false[, useMinimap=false[, includeSky=false[, ignoreWater=false[, heightOffset=0]]]]]) end - ----@return nil|number|string|xyz unitID or feature, position triple when onlyCoords=true -function Spring.TraceScreenRay(screenX, screenY[, onlyCoords=false[, useMinimap=false[, includeSky=false[, ignoreWater=false[, heightOffset=0]]]]]) end - ----@return nil|number|string featureID or ground -function Spring.TraceScreenRay(screenX, screenY[, onlyCoords=false[, useMinimap=false[, includeSky=false[, ignoreWater=false[, heightOffset=0]]]]]) end - ----@return nil|xyz coords -function Spring.TraceScreenRay(screenX, screenY[, onlyCoords=false[, useMinimap=false[, includeSky=false[, ignoreWater=false[, heightOffset=0]]]]]) end - ----Parameters ----@param x number ----@param y number ----@return dirX -function Spring.GetPixelDir(x, y) end - ----@return dirY -function Spring.GetPixelDir(x, y) end - ----@return dirZ -function Spring.GetPixelDir(x, y) end - ----Parameters ----@param teamID number ----@return nil|number r factor from 0 to 1 -function Spring.GetTeamColor(teamID) end - ----@return nil|number g factor from 0 to 1 -function Spring.GetTeamColor(teamID) end - ----@return nil|number b factor from 0 to 1 -function Spring.GetTeamColor(teamID) end - ----@return nil|number a factor from 0 to 1 -function Spring.GetTeamColor(teamID) end - ----Parameters ----@param teamID number ----@return nil|number r factor from 0 to 1 -function Spring.GetTeamOrigColor(teamID) end - ----@return nil|number g factor from 0 to 1 -function Spring.GetTeamOrigColor(teamID) end - ----@return nil|number b factor from 0 to 1 -function Spring.GetTeamOrigColor(teamID) end - ----@return nil|number a factor from 0 to 1 -function Spring.GetTeamOrigColor(teamID) end - ----@return time in seconds -function Spring.GetDrawSeconds() end - - ---- ----@return number playTime -function Spring.GetSoundStreamTime() end - ----@return number time -function Spring.GetSoundStreamTime() end - - ---- ----@return number fps -function Spring.GetFPS() end - ----@return number wantedSpeedFactor -function Spring.GetGameSpeed() end - ----@return number speedFactor -function Spring.GetGameSpeed() end - ----@return bool paused -function Spring.GetGameSpeed() end - ----Parameters ----@param maxLatency number (default): `500` ----@return bool doneLoading -function Spring.GetGameState([maxLatency=500]) end - ----@return bool isSavedGame -function Spring.GetGameState([maxLatency=500]) end - ----@return bool isClientPaused -function Spring.GetGameState([maxLatency=500]) end - ----@return bool isSimLagging -function Spring.GetGameState([maxLatency=500]) end - - ---- ----@return nil|number cmdIndex -function Spring.GetActiveCommand() end - ----@return nil|number cmdID -function Spring.GetActiveCommand() end - ----@return nil|number cmdType -function Spring.GetActiveCommand() end - ----@return nil|string cmdName -function Spring.GetActiveCommand() end - ----@return nil|number cmdIndex -function Spring.GetDefaultCommand() end - ----@return nil|number cmdID -function Spring.GetDefaultCommand() end - ----@return nil|number cmdType -function Spring.GetDefaultCommand() end - ----@return nil|string cmdName -function Spring.GetDefaultCommand() end - ----Fields ----@param id number ----@param type number ----@param name string ----@param action string ----@param tooltip string ----@param texture string ----@param cursor string ----@param queueing boolean ----@param hidden boolean ----@param disabled boolean ----@param showUnique boolean ----@param onlyTexture boolean ----@param params {[string],...} ----@return {[cmdDesc],...} cmdDescs -function Spring.GetActiveCmdDescs() end - ----Parameters ----@param cmdIndex number ----@return nil|cmdDesc -function Spring.GetActiveCmdDesc(cmdIndex) end - ----Parameters ----@param cmdID number ----@return nil|number cmdDescIndex -function Spring.GetCmdDescIndex(cmdID) end - ----@return number buildFacing -function Spring.GetBuildFacing() end - ----@return number buildSpacing -function Spring.GetBuildSpacing() end - ----@return number gatherMode -function Spring.GetGatherMode() end - ----@return number activePage -function Spring.GetActivePage() end - ----@return number maxPage -function Spring.GetActivePage() end - - ---- ----@return number x -function Spring.GetMouseState() end - ----@return number y -function Spring.GetMouseState() end - ----@return number lmbPressed left mouse button pressed -function Spring.GetMouseState() end - ----@return number mmbPressed middle mouse button pressed -function Spring.GetMouseState() end - ----@return number rmbPressed right mouse button pressed -function Spring.GetMouseState() end - ----@return bool offscreen -function Spring.GetMouseState() end - ----@return bool mmbScroll -function Spring.GetMouseState() end - ----@return string cursorName -function Spring.GetMouseCursor() end - ----@return number cursorScale -function Spring.GetMouseCursor() end - ----Parameters ----@param button number ----@return number x -function Spring.GetMouseStartPosition(button) end - ----@return number y -function Spring.GetMouseStartPosition(button) end - ----@return number camPosX -function Spring.GetMouseStartPosition(button) end - ----@return number camPosY -function Spring.GetMouseStartPosition(button) end - ----@return number camPosZ -function Spring.GetMouseStartPosition(button) end - ----@return number dirX -function Spring.GetMouseStartPosition(button) end - ----@return number dirY -function Spring.GetMouseStartPosition(button) end - ----@return number dirZ -function Spring.GetMouseStartPosition(button) end - - ---- ----@return string text -function Spring.GetClipboard() end - ----@return bool -function Spring.IsUserWriting() end - - ---- ----@return {xyz,...} message positions -function Spring.GetLastMessagePositions() end - ----Parameters ----@param maxLines number ----@return nil|{{text=string,priority=number},...} pair array of (text, priority) -function Spring.GetConsoleBuffer(maxLines) end - ----@return string tooltip -function Spring.GetCurrentTooltip() end - - ---- ----Parameters ----@param scanSymbol string ----@return string keyName -function Spring.GetKeyFromScanSymbol(scanSymbol) end - ----Parameters ----@param keyCode number ----@return bool pressed -function Spring.GetKeyState(keyCode) end - ----@return bool alt -function Spring.GetModKeyState() end - ----@return bool ctrl -function Spring.GetModKeyState() end - ----@return bool meta -function Spring.GetModKeyState() end - ----@return bool shift -function Spring.GetModKeyState() end - ----@return {[number|string]=true,...} where keys are keyCodes or key names -function Spring.GetPressedKeys() end - ----@return {[number|string]=true,...} where keys are scanCodes or scan names -function Spring.GetPressedScans() end - ----@return nil|number queueKey -function Spring.GetInvertQueueKey() end - ----Parameters ----@param keySym string ----@return number keyCode -function Spring.GetKeyCode(keySym) end - ----Parameters ----@param keyCode number ----@return string keyCodeName -function Spring.GetKeySymbol(keyCode) end - ----@return string keyCodeDefaultName name when there are not aliases -function Spring.GetKeySymbol(keyCode) end - ----Parameters ----@param scanCode number ----@return string scanCodeName -function Spring.GetScanSymbol(scanCode) end - ----@return string scanCodeDefaultName name when there are not aliases -function Spring.GetScanSymbol(scanCode) end - ----Fields ----@param command string ----@param extra string ----@param boundWith string ----Parameters ----@param keySet1 string (optional) ----@param keySet2 string (optional) ----@return {[keybindingSpec],...} -function Spring.GetKeyBindings([keySet1[, keySet2]]) end - ----Parameters ----@param actionName string ----@return nil|{[string],...} hotkeys -function Spring.GetActionHotKeys(actionName) end - - ---- ----@return nil|{[number]=number,...} where keys are groupIDs and values are counts -function Spring.GetGroupList() end - ----@return number groupID -1 when no group selected -function Spring.GetSelectedGroup() end - ----Parameters ----@param unitID number ----@return nil|number groupID -function Spring.GetUnitGroup(unitID) end - ----Parameters ----@param groupID number ----@return nil|{[number],...} unitIDs -function Spring.GetGroupUnits(groupID) end - ----Parameters ----@param groupID number ----@return nil|{[number]={[number],...},...} where keys are unitDefIDs and values are unitIDs -function Spring.GetGroupUnitsSorted(groupID) end - ----Parameters ----@param groupID number ----@return nil|{[number]=number,...} where keys are unitDefIDs and values are counts -function Spring.GetGroupUnitsCounts(groupID) end - ----Parameters ----@param groupID number ----@return nil|number groupSize -function Spring.GetGroupUnitsCount(groupID) end - - ---- ----Fields ----@param name string ----@param playerID number ----@param teamID number ----@param allyTeamID number ----@param spectator boolean ----@param cpuUsage number ----@param pingTime number ----Parameters ----@param sortType number (optional) ----@param showPathingPlayers boolean (default): `false` ----@return nil|{[rosterSpec],...} playerTable -function Spring.GetPlayerRoster([sortType[, showPathingPlayers=false]]) end - ----Parameters ----@param playerID number ----@param packetID number ----@return number traffic -function Spring.GetPlayerTraffic(playerID, packetID) end - ----Parameters ----@param playerID number ----@return nil|number mousePixels nil when invalid playerID -function Spring.GetPlayerStatistics(playerID) end - ----@return number mouseClicks -function Spring.GetPlayerStatistics(playerID) end - ----@return number keyPresses -function Spring.GetPlayerStatistics(playerID) end - ----@return number numCommands -function Spring.GetPlayerStatistics(playerID) end - ----@return number unitCommands -function Spring.GetPlayerStatistics(playerID) end - - ---- ----Fields ----@param name string ----@param type string ----@param description string ----@param defaultValue string ----@param minimumValue string ----@param maximumValue string ----@param safemodeValue string ----@param declarationFile string ----@param declarationLine string ----@param readOnly boolean ----@return {[configSpec],...} -function Spring.GetConfigParams() end - ----Parameters ----@param name string ----@param default number|nil (default): `0` ----@return nil|number configInt -function Spring.GetConfigInt(name[, default=0]) end - ----Parameters ----@param name string ----@param default number|nil (default): `0` ----@return nil|number configFloat -function Spring.GetConfigFloat(name[, default=0]) end - ----Parameters ----@param name string ----@param default string|nil (default): `""` ----@return nil|number configString -function Spring.GetConfigString(name[, default=""]) end - ----@return {[string]=number,...} sections where keys are names and loglevel are values. E.g. `{ "KeyBindings" = LOG.INFO, "Font" = LOG.INFO, "Sound" = LOG.WARNING, ... }` -function Spring.GetLogSections() end - - ---- ----@return nil|{[number],...} decalIndices -function Spring.GetAllDecals() end - ----Parameters ----@param decalIndex number ----@return nil|number posX -function Spring.GetDecalPos(decalIndex) end - ----@return number posY -function Spring.GetDecalPos(decalIndex) end - ----@return number posZ -function Spring.GetDecalPos(decalIndex) end - ----Parameters ----@param decalIndex number ----@return nil|number sizeX -function Spring.GetDecalSize(decalIndex) end - ----@return number sizeY -function Spring.GetDecalSize(decalIndex) end - ----Parameters ----@param decalIndex number ----@return nil|number rotation in radians -function Spring.GetDecalRotation(decalIndex) end - ----Parameters ----@param decalIndex number ----@return nil|string texture -function Spring.GetDecalTexture(decalIndex) end - ----Parameters ----@param decalIndex number ----@return nil|number alpha -function Spring.GetDecalAlpha(decalIndex) end - ----Parameters ----@param decalIndex number ----@return nil|number unitID -function Spring.GetDecalOwner(decalIndex) end - ----Parameters ----@param decalIndex number ----@return nil|string type "explosion"|"building"|"lua"|"unknown" -function Spring.GetDecalType(decalIndex) end - diff --git a/luamocks/autogenerated/VAO.lua b/luamocks/autogenerated/VAO.lua deleted file mode 100644 index c115b6bac08..00000000000 --- a/luamocks/autogenerated/VAO.lua +++ /dev/null @@ -1,69 +0,0 @@ ----VAO - ---- ----@return nil -function vao:Delete() end - ----Parameters ----@param vbo VBO ----@return nil -function vao:AttachVertexBuffer(vbo) end - ----Parameters ----@param vbo VBO ----@return nil -function vao:AttachInstanceBuffer(vbo) end - ----Parameters ----@param vbo VBO ----@return nil -function vao:AttachIndexBuffer(vbo) end - ----Parameters ----@param glEnum number ----@param numVertices number (optional) ----@param vertexCount number (optional) ----@param vertexFirst number (optional) ----@param instanceCount number (optional) ----@param instanceFirst number (optional) ----@return nil -function vao:DrawArrays(glEnum[, numVertices[, vertexCount[, vertexFirst[, instanceCount[, instanceFirst]]]]]) end - ----Parameters ----@param glEnum number ----@param drawCount number (optional) ----@param baseIndex number (optional) ----@param instanceCount number (optional) ----@param baseVertex number (optional) ----@param baseInstance number (optional) ----@return nil -function vao:DrawElements(glEnum[, drawCount[, baseIndex[, instanceCount[, baseVertex[, baseInstance]]]]]) end - ----Parameters ----@param unitIDs number|{number,...} ----@return number submittedCount -function vao:AddUnitsToSubmission(unitIDs) end - ----Parameters ----@param featureIDs number|{number,...} ----@return number submittedCount -function vao:AddFeaturesToSubmission(featureIDs) end - ----Parameters ----@param unitDefIDs number|{number,...} ----@return number submittedCount -function vao:AddUnitDefsToSubmission(unitDefIDs) end - ----Parameters ----@param featureDefIDs number|{number,...} ----@return number submittedCount -function vao:AddFeatureDefsToSubmission(featureDefIDs) end - ----Parameters ----@param index number ----@return nil -function vao:RemoveFromSubmission(index) end - ----@return nil -function vao:Submit() end - diff --git a/luamocks/autogenerated/VBO.lua b/luamocks/autogenerated/VBO.lua deleted file mode 100644 index 989d5badf75..00000000000 --- a/luamocks/autogenerated/VBO.lua +++ /dev/null @@ -1,151 +0,0 @@ ----VBO - ---- ----@return nil -function vbo:Delete() end - ----Parameters ----@param size number ----@param attribs number|{{number,number,number,number,number},...} ----@return nil -function vbo:Define(size, attribs) end - ----terrainVertexVBO:Define(numPoints, { {id = 0, name = "pos", size = 2}, }) ----@return number elementsCount -function vbo:GetBufferSize() end - ----@return number bufferSizeInBytes -function vbo:GetBufferSize() end - ----@return number size -function vbo:GetBufferSize() end - ----Parameters ----@param vboData {number,...} ----@param attributeIndex number (default): `-1` ----@param elemOffset number (default): `0` ----@param luaStartIndex number (default): `0` ----@param luaFinishIndex number (optional) ----@return {number, ...} indexData -function vbo:Upload(vboData[, attributeIndex=-1[, elemOffset=0[, luaStartIndex=0[, luaFinishIndex]]]]) end - ----@return number elemOffset -function vbo:Upload(vboData[, attributeIndex=-1[, elemOffset=0[, luaStartIndex=0[, luaFinishIndex]]]]) end - ----@return number|{number,number,number,number} attrID -function vbo:Upload(vboData[, attributeIndex=-1[, elemOffset=0[, luaStartIndex=0[, luaFinishIndex]]]]) end - ----vbo:Upload(posArray, 0, 1) --- 0 is offset into vbo (on GPU) in this case no offset --- 1 is lua index index into the Lua table, in this case it's same as default --- Upload will upload from luaOffset to end of lua array ----rectInstanceVBO:Upload({1},0) ----Parameters ----@param attributeIndex number (default): `-1` ----@param elementOffset number (default): `0` ----@param elementCount number (optional) ----@param forceGPURead boolean (default): `false` ----@return {{number,...},...} vboData -function vbo:Download([attributeIndex=-1[, elementOffset=0[, elementCount[, forceGPURead=false]]]]) end - ----@return nil|number buffer size in bytes -function vbo:ModelsVBO() end - ----Parameters ----@param unitDefIDs number|{number,...} ----@param attrID number ----@param teamIdOpt number (optional) ----@param elementOffset number (optional) ----@return {number,number,number,number} instanceData -function vbo:InstanceDataFromUnitDefIDs(unitDefIDs, attrID[, teamIdOpt[, elementOffset]]) end - ----@return number elementOffset -function vbo:InstanceDataFromUnitDefIDs(unitDefIDs, attrID[, teamIdOpt[, elementOffset]]) end - ----@return attrID -function vbo:InstanceDataFromUnitDefIDs(unitDefIDs, attrID[, teamIdOpt[, elementOffset]]) end - ----Data Layout - - ----Parameters ----@param featureDefIDs number|{number,...} ----@param attrID number ----@param teamIdOpt number (optional) ----@param elementOffset number (optional) ----@return {number,number,number,number} instanceData -function vbo:InstanceDataFromFeatureDefIDs(featureDefIDs, attrID[, teamIdOpt[, elementOffset]]) end - ----@return number elementOffset -function vbo:InstanceDataFromFeatureDefIDs(featureDefIDs, attrID[, teamIdOpt[, elementOffset]]) end - ----@return attrID -function vbo:InstanceDataFromFeatureDefIDs(featureDefIDs, attrID[, teamIdOpt[, elementOffset]]) end - ----Data Layout - - ----Parameters ----@param unitIDs number|{number,...} ----@param attrID number ----@param teamIdOpt number (optional) ----@param elementOffset number (optional) ----@return {number,number,number,number} instanceData -function vbo:InstanceDataFromUnitIDs(unitIDs, attrID[, teamIdOpt[, elementOffset]]) end - ----@return number elementOffset -function vbo:InstanceDataFromUnitIDs(unitIDs, attrID[, teamIdOpt[, elementOffset]]) end - ----@return attrID -function vbo:InstanceDataFromUnitIDs(unitIDs, attrID[, teamIdOpt[, elementOffset]]) end - ----Data Layout - - ----Parameters ----@param featureIDs number|{number,...} ----@param attrID number ----@param teamIdOpt number (optional) ----@param elementOffset number (optional) ----@return {number,number,number,number} instanceData -function vbo:InstanceDataFromFeatureIDs(featureIDs, attrID[, teamIdOpt[, elementOffset]]) end - ----@return number elementOffset -function vbo:InstanceDataFromFeatureIDs(featureIDs, attrID[, teamIdOpt[, elementOffset]]) end - ----@return attrID -function vbo:InstanceDataFromFeatureIDs(featureIDs, attrID[, teamIdOpt[, elementOffset]]) end - ----Parameters ----@param projectileIDs number|{number,...} ----@param attrID number ----@param teamIdOpt number (optional) ----@param elementOffset number (optional) ----@return {number, ...} matDataVec 4x4 matrix -function vbo:MatrixDataFromProjectileIDs(projectileIDs, attrID[, teamIdOpt[, elementOffset]]) end - ----@return number elemOffset -function vbo:MatrixDataFromProjectileIDs(projectileIDs, attrID[, teamIdOpt[, elementOffset]]) end - ----@return number|{number,number,number,number} attrID -function vbo:MatrixDataFromProjectileIDs(projectileIDs, attrID[, teamIdOpt[, elementOffset]]) end - ----Parameters ----@param index number ----@param elementOffset number (optional) ----@param elementCount number (optional) ----@param target number (optional) ----@return number bindingIndex when successful, -1 otherwise -function vbo:BindBufferRange(index[, elementOffset[, elementCount[, target]]]) end - ----Parameters ----@param index number ----@param elementOffset number (optional) ----@param elementCount number (optional) ----@param target number (optional) ----@return number bindingIndex when successful, -1 otherwise -function vbo:UnbindBufferRange(index[, elementOffset[, elementCount[, target]]]) end - ----@return nil -function vbo:DumpDefinition() end -