Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
93dee8f
luarc
XNTEABDSC Dec 31, 2025
5f8764f
scripts .luarc.json
XNTEABDSC Dec 31, 2025
43fb1f2
.typedefs
XNTEABDSC Dec 31, 2025
3a96d9d
workspace
XNTEABDSC Dec 31, 2025
b0108ac
remove VFS.Include nil check
XNTEABDSC Dec 31, 2025
c37b3cd
type annotation for include
XNTEABDSC Dec 31, 2025
d83be1d
.
XNTEABDSC Dec 31, 2025
cf84b8c
Gadget unit_target_priority.lua typo visiblity -> visibility
XNTEABDSC Dec 31, 2025
52a3fa2
add field tag for type Command
XNTEABDSC Dec 31, 2025
52f5b1e
add field tag for type Command
XNTEABDSC Dec 31, 2025
a582b2e
add param for Spring.SetCustomCommandDrawData
XNTEABDSC Dec 31, 2025
33669c1
add param for Spring.SetCustomCommandDrawData
XNTEABDSC Dec 31, 2025
b5ed758
set param of Spring.SetUnitBlocking
XNTEABDSC Dec 31, 2025
fd1108c
remove Spring.GetUnitDefID's nil return
XNTEABDSC Dec 31, 2025
c0b7c8c
Spring.CreateUnit's teamID is optional
XNTEABDSC Dec 31, 2025
05e3bb4
Spring.GetAllFeatures
XNTEABDSC Dec 31, 2025
dcf8577
Spring.SetCustomCommandDrawData
XNTEABDSC Dec 31, 2025
9281e30
Spring.GetFeatureResurrect
XNTEABDSC Dec 31, 2025
352fb45
Spring.SetFeatureMoveCtrl
XNTEABDSC Dec 31, 2025
b1cefef
Spring.GetFeaturePosition Note recoil doc missing
XNTEABDSC Dec 31, 2025
8b8b91e
.luarc.json runtime.path
XNTEABDSC Dec 31, 2025
dcb4173
wait we can just use https://github.com/beyond-all-reason/recoil-lua-…
XNTEABDSC Dec 31, 2025
647ae7b
bomberassault.lua duplicate selfDestructAs
XNTEABDSC Dec 31, 2025
c5b50b7
.luarc.json
XNTEABDSC Dec 31, 2025
2ea30cb
.luarc.json
XNTEABDSC Dec 31, 2025
34dd119
.luarc.json
XNTEABDSC Dec 31, 2025
1c84c63
Merge branch 'master' into typedefs
XNTEABDSC Jan 2, 2026
148e13c
rename workspace file
XNTEABDSC Jan 2, 2026
ad7f3e8
rename workspace file
XNTEABDSC Jan 2, 2026
2cfa2df
gui_sensor_ranges_radar_preview.lua
XNTEABDSC Jan 2, 2026
51563ea
scripts' typedefs
XNTEABDSC Jan 2, 2026
77df3e5
some missing typedefs
XNTEABDSC Jan 2, 2026
9a5056d
.luarc.json
XNTEABDSC Jan 2, 2026
a6e82dd
scripts/dronelight.lua missing pivotSpeed
XNTEABDSC Jan 2, 2026
c3f0e1e
scripts/shipheavyarty.lua what is Hide(barrels[num][i], SFX.FALL + SF…
XNTEABDSC Jan 2, 2026
02ea2cc
scripts/platehover.lua typo fals
XNTEABDSC Jan 2, 2026
bb24798
scripts/raveparty.lua missing LOS_ACCESS
XNTEABDSC Jan 2, 2026
da753da
scripts/.luarc.json add cast-local-type
XNTEABDSC Jan 2, 2026
d5070eb
.
XNTEABDSC Jan 3, 2026
36a93c3
Merge branch 'typedefs' of https://github.com/XNTEABDSC/Zero-K into t…
XNTEABDSC Jan 3, 2026
fbfd40a
.
XNTEABDSC Jan 3, 2026
dc9a16d
some other typedefs
XNTEABDSC Jan 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "recoil-lua-library"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scary, do submodules with with stuff like rapid or infra steam depot?

path = recoil-lua-library
url = https://github.com/beyond-all-reason/recoil-lua-library
53 changes: 53 additions & 0 deletions .luarc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json",
"diagnostics.globalsRegex": ["CMD_.*"],
"diagnostics.globals": [
"Spring",
"gadget",
"widget",
"VFS",
"UnitDefs",
"UnitDefNames",
"FeatureDefs",
"ModularCommDefsShared",
"piece",
"GG",
"Script",
"WG",
"widgetHandler",
"widget",
"GameData",
"Shared",
"gadget",
"DEFS",
"LOG",
"FeatureDefNames",
"SendToUnsynced",
"CMD",
"WeaponDefs",
"CMDTYPE",
"WeaponDefNames"
//,{ "name": "script", "include": "scripts/**.lua" }
],
"runtime.version": "Lua 5.1",
"diagnostics.disable": [
"duplicate-set-field",
"cast-local-type" // because it is frequently used
],
"completion.requireSeparator": "/",
"runtime.path": [
"?",
"?.lua"
],
"runtime.special": {
"include":"require",
"VFS.Include":"require",
"shard_include": "require"
},
"workspace.library": [
"recoil-lua-library/**"
],
"workspace.ignoreDir": [
"scripts/**"
]
}
13 changes: 13 additions & 0 deletions .typedefs/LuaGlobal.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---Just nil, number, string and boolean datatypes are allowed as arguments! NO tables, userdatas, ...
---@param ... nil|number|string|boolean
function SendToUnsynced(...)end

---@param teamID integer
---@param f function
---@param ... any
function CallAsTeam(teamID,f,...)end

---@param access {ctrl:number|nil,read:number|nil,select:number|nil}
---@param f function
---@param ... any
function CallAsTeam(access,f,...)end
73 changes: 73 additions & 0 deletions .typedefs/SpringDefines less.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
-- ---@diagnostic disable: missing-return

---@class table:{[any]:any}
---@class list<T>:{[integer]:T}

---@class UnitId : integer
---@class UnitDefId:integer

---@class PlayerId:integer
---@class TeamId:integer
---@class AllyteamId:integer
--[==[
---@class timeSec:number

---@class frame:integer
---@operator div(framePerSec):timeSec
---@class framePerSec:integer
---@operator mul(timeSec):frame

---@class WldDist:number
---@operator div(frame):WldSpeed
---@operator add(WldDist):WldDist
---@operator add(WldSpeed):WldDist
---@alias WldxPos WldDist
---@alias WldyPos WldDist
---@alias WldzPos WldDist
--[=[
---@class WldxPos:number
---@operator div(frame):WldxVel
---@operator add(WldxPos):WldxPos
---@operator add(WldxVel):WldxPos
---@class WldyPos:number
---@operator div(frame):WldyVel
---@operator add(WldyPos):WldyPos
---@operator add(WldyVel):WldyPos
---@class WldzPos:number
---@operator div(frame):WldzVel
---@operator add(WldzPos):WldzPos
---@operator add(WldzVel):WldzPos
]=]

---@class WldSpeed:number
---@operator mul(frame):WldDist
---@operator unm:WldSpeed

---@alias WldxVel WldSpeed
---@alias WldyVel WldSpeed
---@alias WldzVel WldSpeed
]==]

---@type {[UnitDefId]:table}
UnitDefs={}

---@type {[string]:table}
UnitDefNames={}

---@class WeaponDefId:integer


---@type table<WeaponDefId,table>
WeaponDefs={}

---@type table<string,table>
WeaponDefNames={}

---@class ProjectileId:number

---@generic T
---@param v T
---@param recurse boolean|nil
---@param appendTo T|nil
---@return T
function Spring.Utilities.CopyTable(v,recurse,appendTo) end
1 change: 1 addition & 0 deletions LuaRules/Gadgets/unit_tech_k.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ local autoAiTech = Spring.GetModOptions().aiusetechk ~= "0"
local IterableMap = VFS.Include("LuaRules/Gadgets/Include/IterableMap.lua")
local modCommands, modCmdMap = VFS.Include("LuaRules/Configs/modCommandsDefs.lua")
local CMD_TECH_UP = Spring.Utilities.CMD.TECH_UP

local techCommandData = modCmdMap[CMD_TECH_UP]

if not gadgetHandler:IsSyncedCode() then
Expand Down
1 change: 0 additions & 1 deletion LuaUI/Widgets/chili/Headers/autolocalizer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ local function MyLoadString(str, filename)
return chunk, str2
end


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

random whitespace change in an otherwise untouched file, here and in unit_tech_k.lua

function VFS.Include(filename, enviroment, mode)
local str = LoadFileSafe(filename, mode)

Expand Down
2 changes: 1 addition & 1 deletion LuaUI/Widgets/gui_sensor_ranges_radar_preview.lua
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ end

local function GetRadarUnitToDraw()
if selectedRadarUnitID and options.showOnSelected.value then
unitDefID = Spring.GetUnitDefID(selectedRadarUnitID)
local unitDefID = Spring.GetUnitDefID(selectedRadarUnitID)
if not unitDefID then
selectedRadarUnitID = false
return
Expand Down
6 changes: 6 additions & 0 deletions LuaUI/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ function Basename(fullpath)
return base, path
end

---Load, compiles, run, return
---@param filename string
---@param envTable table|nil
---@param VFSMODE number|nil
---@return any ...any
---@diagnostic disable-next-line: lowercase-global
function include(filename, envTable, VFSMODE)
--[[ support legacy header paths for the time being
in case people use them in their local widgets ]]
Expand Down
1 change: 1 addition & 0 deletions recoil-lua-library
Submodule recoil-lua-library added at dd7ecc
51 changes: 51 additions & 0 deletions scripts/.luarc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json",
"diagnostics.globalsRegex": ["CMD_.*"],
"diagnostics.globals": [
"VFS",
"UnitDefs",
"UnitDefNames",
"FeatureDefs",
"ModularCommDefsShared",
"piece",
"GG",
"Script",
"WG",
"widgetHandler",
"widget",
"GameData",
"Shared",
"gadget",
"DEFS",
"LOG",
"FeatureDefNames",
"SendToUnsynced",
"CMD",
"WeaponDefs",
"CMDTYPE",
"WeaponDefNames",
"script"

//,{ "name": "script", "include": "scripts/**.lua" }
],
"runtime.version": "Lua 5.1",
"diagnostics.disable": [
"duplicate-set-field",
"lowercase-global",
"cast-local-type"
],
"completion.requireSeparator": "/",
"runtime.path": [
"?",
"?.lua"
],
"runtime.special": {
"include":"require",
"VFS.Include":"require"
},
"workspace.library": [
".."
],
"Lua.workspace.checkThirdParty": false

}
Loading