Skip to content

Commit

Permalink
Update for beta3
Browse files Browse the repository at this point in the history
  • Loading branch information
Trey2k committed Jul 14, 2023
1 parent 50abe9c commit 1995bbc
Show file tree
Hide file tree
Showing 8 changed files with 527 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/mike_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
- run: git fetch origin gh-pages --depth=1
- run: pip install mkdocs-material
- run: pip install mike
- run: mike deploy --push v2.0 latest
- run: mike deploy --push -u v2.1 latest
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ This repo contains the source for our static documentation site hosted with gith
We are using the mkdocs static site generator with mike. To build and run locally do the following:
- Download and install python
- Install mkdocs and mike: `pip install mkdocs-material mike setuptools`.
- Run `mike deploy [version]` to build the static site. (replace `[version]` with the current version you would like to build for I.E. v2.0-beta).
- Run `mike deploy [version]` to build the static site. (replace `[version]` with the current version you would like to build for I.E. v2.1).
- Finally, run `mike serve` to serve the site locally.

View local documentation: http://localhost:8000
Expand Down
25 changes: 21 additions & 4 deletions docs/classes/lua_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The LuaAPI class is used to interact with Lua from GDScript.

This class provides the methods to execute Lua code; to call Lua functions from GDScript; to read and write the value of global Lua variables; to create a Lua constructor for a GDScript class and more.

---

## Enumerations
### HookMask
| Name | Value | Description |
Expand All @@ -30,10 +32,15 @@ This class provides the methods to execute Lua code; to call Lua functions from
---

## Properties
### permissive _Bool_
When set to true all methods will be allowed on Objects be default and lua_fields is treated as a blacklist. When set to false, lua_fields is treated as a whitelist.
### object_metatable *[LuaObjectMetatable](lua_object_metatable.md)*
This defines the default object metatable to be used when an object does not define a `lua_metatable` field.

Default value is a [LuaDefaultObjectMetatable](lua_default_object_metatable.md) instance.

Default value is true.
### memory_limit _int_
This defines the maximum amount of memory the Lua state can use in bytes. When 0 there is no limit. When the Lua state reaches the memory limit, it will throw a memory allocation error.

Default value is 0.

---

Expand Down Expand Up @@ -458,10 +465,20 @@ Creates and binds a LuaCoroutine object to a LuaAPI object. This method is equiv

---

### get_running_coroutine *[LuaCoroutine](lua_coroutine.md)* {#do_file}
### get_running_coroutine *[LuaCoroutine](lua_coroutine.md)* {#get_running_coroutine}

Intended to be called from a lua hook. Returns the current running coroutine.

#### Returns

*[LuaCoroutine](lua_coroutine.md)*

---

### get_memory_usage _int_ {#get_memory_usage}

Returns the current memory usage of the Lua state in bytes.

#### Returns

_int_
22 changes: 22 additions & 0 deletions docs/classes/lua_default_object_metatable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# LuaDefaultObjectMetatable

## Description

This is the default [LuaObjectMetatable](lua_object_metatable.md) used by the [LuaAPI](lua_api.md) class as the object_metatable value. It provides v2.0 like funcinality in regards to Object metamethod overides.

By default all fields/methods will be allowed on an object, if the object defines a `lua_fields` method, the array of field names it returns will be treated as a blacklist. If permissive is changed to false, it will be treated as a whitelist instead.

Before any value is returned or any metamethod is called, this metatable will first see if the object defines a method with the same name as the metamethod. If it does, that will be called instead with the normal lua arguments you expect, plus referance to the [LuaAPI](lua_api.md) object as the first argument.

---

## lua_fields
By default every field and method is available to Lua. You can limit what Lua has access to by defining either the `lua_fields()` method, which must return an Array of the names of fields/methods. By default this array is treated as a blacklist of blocked methos. If you set [permissive](../classes/lua_api.md#permissive-bool) to true, it will be treated as a whitelist. The other way to limit access is by defining the `__index()` method, which takes reference to the [LuaAPI](../classes/lua_api.md) and a string of the field being requested by Lua. You can then return any value you please to lua.

---

## Properties
### permissive _Bool_
When set to true all methods will be allowed on Objects be default and lua_fields is treated as a blacklist. When set to false, lua_fields is treated as a whitelist.

Default value is true.
Loading

0 comments on commit 1995bbc

Please sign in to comment.