mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 10:31:50 +00:00
update doc/*/scripting/builtins/libapp.md
This commit is contained in:
parent
8de3c0de57
commit
466f515ea9
2 changed files with 35 additions and 1 deletions
|
|
@ -191,3 +191,20 @@ app.reset_content_sources()
|
|||
```
|
||||
|
||||
Resets content sources.
|
||||
|
||||
## Sub-instances
|
||||
|
||||
```lua
|
||||
-- Creates a headless engine instance with the current project and the specified application script.
|
||||
-- Returns the instance ID. The number of active sub-instances is currently limited to one.
|
||||
app.start_background_instance(
|
||||
-- script file
|
||||
app_script: string,
|
||||
-- log file
|
||||
output_file: string | nil
|
||||
) -> int
|
||||
|
||||
-- Stops the engine sub-instance.
|
||||
-- Returns true if the instance was alive at the time of the call.
|
||||
app.terminate(handle: int) -> boolean
|
||||
```
|
||||
|
|
|
|||
|
|
@ -142,4 +142,21 @@ app.set_content_sources(sources: table<string>)
|
|||
|
||||
-- Сбрасывает список источников контента.
|
||||
app.reset_content_sources()
|
||||
```
|
||||
```
|
||||
|
||||
## Под-экземпляры
|
||||
|
||||
```lua
|
||||
-- Создаёт headless-экземпляр движка с текущим проектом и указанным сценарием.
|
||||
-- Возвращает id экземпляра. Число живых под-экземпляров, на данный момент, ограничено одним.
|
||||
app.start_background_instance(
|
||||
-- файл сценария
|
||||
app_script: string,
|
||||
-- файл лога
|
||||
output_file: string | nil
|
||||
) -> int
|
||||
|
||||
-- Останавливает под-экземпляр движка.
|
||||
-- Возвращает true если экземпляр был жив в момент вызова.
|
||||
app.terminate(handle: int) -> boolean
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue