mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-12 22:41:49 +00:00
update doc/*/scripting/builtins/libgui.md
This commit is contained in:
parent
047b1772f2
commit
6844b4c5e4
2 changed files with 23 additions and 1 deletions
|
|
@ -62,6 +62,17 @@ gui.escape_markup(
|
||||||
|
|
||||||
Escapes markup in text.
|
Escapes markup in text.
|
||||||
|
|
||||||
|
```lua
|
||||||
|
gui.alert(
|
||||||
|
-- message (not automatically translated, use gui.str(...))
|
||||||
|
message: str,
|
||||||
|
-- function called on close
|
||||||
|
on_ok: function() -> nil
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
Displays a message box. **Non-blocking**.
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
gui.confirm(
|
gui.confirm(
|
||||||
-- message (does not translate automatically, use gui.str(...))
|
-- message (does not translate automatically, use gui.str(...))
|
||||||
|
|
@ -78,7 +89,7 @@ gui.confirm(
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
Requests confirmation from the user for an action. **Does not** stop code execution.
|
Requests confirmation from the user for an action. **Non-blocking**.
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
gui.load_document(
|
gui.load_document(
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,17 @@ gui.escape_markup(
|
||||||
|
|
||||||
Экранирует разметку в тексте.
|
Экранирует разметку в тексте.
|
||||||
|
|
||||||
|
```lua
|
||||||
|
gui.alert(
|
||||||
|
-- сообщение (не переводится автоматически, используйте gui.str(...))
|
||||||
|
message: str,
|
||||||
|
-- функция, вызываемая при закрытии
|
||||||
|
on_ok: function() -> nil
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
Выводит окно с сообщением. **Не** останавливает выполнение кода.
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
gui.confirm(
|
gui.confirm(
|
||||||
-- сообщение (не переводится автоматически, используйте gui.str(...))
|
-- сообщение (не переводится автоматически, используйте gui.str(...))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue