Merge pull request #821 from Xertis/main

Added script-listener to packs loading
This commit is contained in:
MihailRis 2026-04-03 20:59:21 +03:00 • committed by GitHub
commit 936a5c8525
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 99 additions and 3 deletions

View file

@ -198,11 +198,26 @@ function on_close(invid: int)
Called on element removed from the screen.
## Content events
Callbacks specified in *content.lua* script.
```lua
function on_scripts_loading()
```
Called before the content pack scripts are loaded
```lua
function on_content_loaded()
```
Called after the content pack has been fully loaded
## HUD events
Callbacks specified in *hud.lua* script.
```lua
function on_hud_open(playerid: int)
```

View file

@ -5,6 +5,7 @@
- [События предметов](#события-предметов)
- [События мира](#события-мира)
- [События макета](#события-макета)
- [События контента](#события-контента)
- [События HUD](#события-hud)
- [События ECS](ecs.md#события-компонента)
- [Библиотека *Events*](#библиотека-events)
@ -189,7 +190,6 @@ function on_inventory_closed(invid: int, playerid: int)
Вызывается при закрытии инвентаря.
## События макета
События прописываются в файле `layouts/имя_макета.xml.lua`.
@ -208,6 +208,22 @@ function on_close(invid: int)
Вызывается при удалении элемента с экрана.
## События контента
События жизненного цикла контент-пака прописываются в файле `scripts/content.lua`
```lua
function on_scripts_loading()
```
Вызывается перед загрузкой скриптов контент-пака
```lua
function on_content_loaded()
```
Вызывается после того, как контент-пак был полностью загружен
## События HUD
События связанные с игровым интерфейсом прописываются в файле `scripts/hud.lua`