mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-01 22:21:48 +00:00
wip js/ts examples
This commit is contained in:
1 parent
3aee4976c3
commit
d44c42104e
7 files changed
+602
-163
No files matched your search
@@ -2,23 +2,38 @@
|
||||
title: Alert Dialog
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
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.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value='Lua'>
|
||||
|
||||
```lua
|
||||
-- data: table
|
||||
-- header: string
|
||||
-- content: string
|
||||
-- centered: boolean (optional)
|
||||
-- cancel: boolean (optional)
|
||||
lib.alertDialog(data)
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value='JS/TS'>
|
||||
|
||||
```ts
|
||||
import lib from '@overextended/ox_lib/client'
|
||||
|
||||
lib.alertDialog(data)
|
||||
```
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
`header` - Dialog title.
|
||||
`content` - Dialog body content, supports markdown.
|
||||
`centered` - Centers the dialog vertically and horizontally.
|
||||
`cancel` - Displays a cancel button (ESC is still available if this is not defined).
|
||||
* data: `table` (`object`)
|
||||
* header: `string`
|
||||
* Dialog title.
|
||||
* content: `string`
|
||||
* Dialog body content, supports markdown.
|
||||
* centered?: `boolean`
|
||||
* Centers the dialog vertically and horizontally.
|
||||
* cancel?: `boolean`
|
||||
* Displays a cancel button (ESC is still available if this is not defined).
|
||||
|
||||
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`.
|
||||
@@ -36,4 +51,4 @@ local alert = lib.alertDialog({
|
||||
print(alert)
|
||||
```
|
||||
|
||||

|
||||

|
||||
Reference in new issue
Block a user