Skip to content
This repository was archived by the owner on Dec 29, 2024. It is now read-only.

v2.1-beta3

Pre-release
Pre-release

Choose a tag to compare

@Trey2k Trey2k released this 13 Jul 16:21
2c1b23d

⚠️ This release of LuaAPI is for godot version 4.1.x

This is the first large feature update for LuaAPI v2.1

What's Changed

  • Added memory_limit property to the LuaAPI class. This allows to set the max allowed memory usage for the Lua state in bytes.
  • Added object_metatable property to the LuaAPI class. This sets the default metatable for Objects which do not define a lua_metatable property.
  • Removed permissive property from the LuaAPI class. This has been replaced with the permissive property on LuaDefaultObjectMetatable which occupies the LuaAPI object_metatable property by default.
  • Added get_memory_usage() method to the LuaAPI class. This returns the current memory usage of the Lua state in bytes.
  • Removed expose_object_constructor() from the LuaAPI class. This is no longer needed, you can push the obj.new method as a global using LuaAPI.push_global() for the same effect but with constructor argument support.
  • New LuaObjectMetatable class. This is a interface class meant to be used to define metatables.
  • New LuaDefaultObjectMetatable class. This is the type that object_metatable defaults to, it provides the same functionality with metatables and metamethods we had before this update. The LuaAPI permissive property has been moved to this class now. It will yield metamethod calls to the object if it defines them like before. Otherwise looks for the lua_fields method which is either a blacklist or a whitelist depending on permissive.

There are a lot of changes with this update so I suspect there may be some regression, if you notice any please open an issue.