dialog close functions

This commit is contained in:
Luke committed 2022-09-29 11:50:25 +02:00
1 parent 15863b8508
commit c318cdb467
2 files changed
+44

No files matched your search

+23
View File
@@ -8,6 +8,8 @@ import TabItem from '@theme/TabItem';
Simple alert dialog that can display a message to the player.
Returns whether the player pressed the confirm button or canceled the dialog.
### lib.alertDialog
<Tabs>
<TabItem value='Lua'>
@@ -42,6 +44,27 @@ lib.alertDialog(data)
Returns `confirm` if the player pressed the confirm button, otherwise if the player pressed the cancel button
or has exited the dialog with ESC the return will be `cancel`.
### lib.closeAlertDialog
Force closes the active alert dialog and sets its return data as `nil`
<Tabs>
<TabItem value='Lua'>
```lua
lib.closeAlertDialog()
```
</TabItem>
<TabItem value='JS/TS'>
```ts
import lib from '@overextended/ox_lib/client'
lib.closeAlertDialog()
```
</TabItem>
</Tabs>
**Example:**
<Tabs>
+21
View File
@@ -78,6 +78,27 @@ you can define `options` **ONLY** with type `'select'`.
Doing so otherwise ***will*** result in errors.
:::
### lib.closeInputDialog
Force closes the active input dialog and sets its return data as `nil`
<Tabs>
<TabItem value='Lua'>
```lua
lib.closeInputDialog()
```
</TabItem>
<TabItem value='JS/TS'>
```ts
import lib from '@overextended/ox_lib/client'
lib.closeInputDialog()
```
</TabItem>
</Tabs>
## Usage Example
### Basic