Skip to content

lua language server meta files for the RoRML api

Notifications You must be signed in to change notification settings

0xAdk/rorml_types

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RoRML Types

RoRML api type information defined using lua-language-server's annotation syntax

The meta files were built by reading the modloader's lua source code and referencing RoRML

ModData Types

Aside from providing types for the RoRML api there are a few declared types used in the Instance:getData() method's return value which can be defined by your mod when needed.

These are

  • InstanceModData
  • PlayerInstanceModData
  • ActorInstanceModData
  • DamagerInstanceModData
  • ItemInstanceModData

For example

---@class PlayerInstanceModData
---@field step_count number

callback.register('onPlayerInit', function (player)
	local pd = player:getData()
	pd.step_count = 0
end)

callback.register('onPlayerStep', function (player)
	local pd = player:getData()
	pd.step_count = pd.step_count + 1
end)

Installation

This repo in intended to be installed inside the ModLoader/mods folder.

To use it, add it to your .luarc.json's workspace.library as ../rorml_types

"workspace.library": [
    "../rorml_types"
]

If you don't have a .luarc.json already you can use this base:

Create a file .luarc.json in the root of your mod's directory and copy in this json.

{
    "$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json",

    "runtime": {
        "version": "LuaJIT",

        "pathStrict": true,
        "path": [
            "?.lua",
            "?"
        ]
    },

    "workspace.library": [
        "../rorml_types",
        "../../resources/libs"
    ]
}

About

lua language server meta files for the RoRML api

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages