Update lib information and examples

This commit is contained in:
Luke committed 2022-05-10 11:30:48 +02:00
1 parent 4cc2aa440b
commit 8972054319
4 files changed
+24 -23

No files matched your search

+11 -1
View File
@@ -134,4 +134,14 @@ As of the time writing this the buttons are sorted **alphabetically**.
![menu_example](https://i.imgur.com/aJu92dv.png)
![metadata](https://i.imgur.com/kFGSlBF.png)
![event_menu](https://i.imgur.com/r0Ln4VP.png)
![event_menu](https://i.imgur.com/r0Ln4VP.png)
### lib.getOpenContextMenu
Returns the id of the currently open context menu.
If not context menu is open returns `nil`.
```lua
lib.getOpenContextMenu()
```
-9
View File
@@ -69,15 +69,6 @@ end
</TabItem>
<TabItem value='advanced' label='Advanced'>
:::danger
Everything under this advanced exampled requires ox_lib version at least 2.3.0 and
as of the time of writing this version **hasn't** been pushed yet.
Optionally you can download the source code and build the UI yourself if you don't
want to wait for the release.
:::
```lua
local input = lib.inputDialog('Police locker', {
{ type = "input", label = "Locker number" },
+5 -5
View File
@@ -53,14 +53,14 @@ lib.notify({
description = 'Notification description',
position = 'top',
style = {
backgroundColor = 'red',
color = 'blue'
backgroundColor = '#141517',
color = '#909296'
},
icon = 'bed',
iconColor = 'purple'
icon = 'ban',
iconColor = '#C53030'
})
```
![custom_notification](https://i.imgur.com/3gexwWu.png)
![custom_notification](https://i.imgur.com/0EK5APp.png)
</TabItem>
</Tabs>
+8 -8
View File
@@ -22,14 +22,13 @@ lib.showTextUI(text, options)
**Example:**
<Tabs>
<TabItem label="Default" value="default">
<TabItem label="Basic" value="basic">
```lua
lib.showTextUI('[E] - Fuel vehicle', {
position = "top-center",
icon = "gas-pump",
})
lib.showTextUI('[E] - Fuel vehicle')
```
![](https://i.imgur.com/3ptQyAq.png)
</TabItem>
<TabItem label="Custom style" value="custom">
@@ -37,14 +36,15 @@ lib.showTextUI('[E] - Fuel vehicle', {
lib.showTextUI('[E] - Pick apple', {
position = "top-center",
icon = 'hand',
iconColor = "red",
style = {
borderRadius = 0,
backgroundColor = 'blue',
color = 'red'
backgroundColor = '#48BB78',
color = 'white'
}
})
```
![](https://i.imgur.com/gNDwPBN.png)
</TabItem>
</Tabs>