Skip to content

2.1.5

Compare
Choose a tag to compare
@astrochili astrochili released this 11 Jun 21:07
· 24 commits to master since this release

Added

  • Added annotations and the ---@package marker for script lifecycle snippets. The ---@package allows to hide lifecycle functions from the global context so that you don't get confused when choosing between a snippet and a real declared function with the same name.
  • Added the script snippet with the self class definition and annotated lifecycle functions. Useful to create a script file with ready to use self annotations. By default, the class is named by filename.

Note

Example of output with the script snippet in the player.script file:

---@class player.script

---@package
---@param self player.script
function init(self)
  
end

---@package
---@param self player.script
---@param dt number
function update(self, dt)
  
end

---@package
---@param self player.script
---@param message_id hash
---@param message table
---@param sender hash
function on_message(self, message_id, message, sender)
  
end

---@package
---@param self player.script
---@param action_id hash
---@param action on_input.action
---@return boolean|nil
function on_input(self, action_id, action)
  
end

---@package
---@param self player.script
function final(self)
  
end