SWBF2 Lua API [LuaDoc]
Posted: Sat Nov 12, 2016 12:02 am
Hey everyone, so I've spent the last several hours documenting the entire SWBF2 Lua API (all the Lua functions, basically) in LuaDoc format, so that they can be read by the Lua Development Tools. I'm currently around halfway done.
What does this mean?
Well, basically, whenever you hover your mouse cursor over a function or variable in LDT, a small window will pop up displaying any comments located above or in-line-with the function or variable. However, you can take it a step further: if you format your function comments in the LuaDoc syntax, you can enter descriptions of what the function does, what each parameter does, any return values, etc. Here's what LuaDoc looks like in action with a custom function:
Function declaration in normal .lua file:
LuaDoc popup:
Now, along with formatting function comments with LuaDoc in your .lua files, you can define an entire function library (without actually overriding what the functions do) in external .doclua files.
Here's what it looks like in action with a pre-defined LuaDoc library:
Function declaration in .doclua file:
LuaDoc popup:
Be sure to leave any comments/questions/etc. below!
What does this mean?
Well, basically, whenever you hover your mouse cursor over a function or variable in LDT, a small window will pop up displaying any comments located above or in-line-with the function or variable. However, you can take it a step further: if you format your function comments in the LuaDoc syntax, you can enter descriptions of what the function does, what each parameter does, any return values, etc. Here's what LuaDoc looks like in action with a custom function:
Function declaration in normal .lua file:
Hidden/Spoiler:
Hidden/Spoiler:
Here's what it looks like in action with a pre-defined LuaDoc library:
Function declaration in .doclua file:
Hidden/Spoiler:
Hidden/Spoiler: