add gui.confirm(...)

This commit is contained in:
MihailRis
2025-01-02 16:53:28 +03:00
parent e2f6c263e7
commit 7fce735ca1
6 changed files with 76 additions and 5 deletions
+18
View File
@@ -61,3 +61,21 @@ gui.escape_markup(
```
Escapes markup in text.
```lua
gui.confirm(
-- message (does not translate automatically, use gui.str(...))
message: str,
-- function called upon confirmation
on_confirm: function() -> nil,
-- function called upon denial/cancellation
[optional] on_deny: function() -> nil,
-- text for the confirmation button (default: "Yes")
-- use an empty string for the default value if you want to specify no_text.
[optional] yes_text: str,
-- text for the denial button (default: "No")
[optional] no_text: str,
)
```
Requests confirmation from the user for an action. **Does not** stop code execution.