Skip to content

Commit cbb901f

Browse files
committed
Update the it_bridge docs part
1 parent 38182e6 commit cbb901f

File tree

8 files changed

+376
-49
lines changed

8 files changed

+376
-49
lines changed

pages/it_bridge/exports/_meta.json

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
11
{
2-
"disptach": {
3-
"title": "⛑・Disptach System"
2+
"shared": {
3+
"title": "🔄・Shared",
4+
"theme": {
5+
"footer": false
6+
}
47
},
58
"framework": {
69
"title": "💾・Framework"
710
},
8-
"interaction": {
9-
"title": "👀・Interaction"
10-
},
1111
"inventory": {
1212
"title": "🛒・Inventory"
1313
},
14-
"menus": {
15-
"title": "🗂️・Menus"
16-
},
1714
"notification": {
1815
"title": "📨・Notification"
1916
},
17+
"interaction": {
18+
"title": "👀・Interaction"
19+
},
2020
"textui": {
2121
"title": "📋・Text UI"
22+
},
23+
"menus": {
24+
"title": "🗂️・Menus"
25+
},
26+
"disptach": {
27+
"title": "⛑・Disptach System"
2228
}
2329
}

pages/it_bridge/exports/disptach/client.mdx

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { Callout } from '@components/Callout'
77

88
# Client
99
<Callout type="warning">
10-
These exports can only be used on the server-side. Make sure to use them in your server-side script files.
10+
These exports can only be used on the client-side. Make sure to use them in your client-side script files.
1111
</Callout>
1212

1313
<Callout type="error">
@@ -18,24 +18,24 @@ You can add your own dispatch system to the bridge by editing the `disptach/serv
1818
### Disptach Data
1919
```lua
2020
{
21-
job = 'police', -- The job that should receive the disptach.
22-
jobs = {'police', 'ambulance'}, -- The jobs that should receive the disptach.
23-
title = 'Robbery', -- The disptach title.
24-
message = 'A robbery has been reported at the bank.', -- The disptach description.
21+
job = 'string', -- The job that should receive the disptach.
22+
jobs = {}, -- List of jobs that should receive the disptach.
23+
title = 'string', -- The disptach title.
24+
message = 'string', -- The disptach description.
2525
coords = {x = 0.0, y = 0.0, z = 0.0}, -- The disptach location.
2626
callCode = {
27-
code = '10-31', -- The disptach code.
28-
snippet = '10-31' -- The disptach priority.
27+
code = 'string', -- The disptach code.
28+
snippet = 'string' -- The disptach priority.
2929
},
30-
flashes = true, -- If the disptach should flash on the map.
31-
image = 'https://i.imgur.com/0J2QX1E.png', -- The disptach image.
30+
flashes = boolean, -- If the disptach should flash on the map.
31+
image = 'string', -- The disptach image.
3232
blip = {
33-
sprite = 1, -- The disptach blip sprite.
34-
colour = 1, -- The disptach blip color.
35-
scale = 1.0, -- The disptach blip scale.
36-
text = 'Robbery', -- The disptach blip label.
37-
time = 30000 -- The disptach blip time.
38-
flashes = true -- If the disptach blip should flash.
33+
sprite = number, -- The disptach blip sprite.
34+
colour = number, -- The disptach blip color.
35+
scale = number, -- The disptach blip scale.
36+
text = 'string', -- The disptach blip label.
37+
time = number -- The disptach blip time.
38+
flashes = boolean -- If the disptach blip should flash.
3939
}
4040
}
4141
```
@@ -48,4 +48,28 @@ exports.it_bridge:SendDispatch(disptachData)
4848

4949
- disptachData: `table`: The disptach data.
5050

51-
Sends a disptach with the specified data.
51+
Sends a disptach with the specified data.
52+
53+
### Example
54+
```lua
55+
exports.it_bridge:SendDispatch({
56+
job = 'police',
57+
title = 'Robbery',
58+
message = 'A robbery has been reported at the bank.',
59+
coords = {x = 0.0, y = 0.0, z = 0.0},
60+
callCode = {
61+
code = '10-31',
62+
snippet = '10-31'
63+
},
64+
flashes = true,
65+
image = 'https://i.imgur.com/0J2QX1E.png',
66+
blip = {
67+
sprite = 1,
68+
colour = 1,
69+
scale = 1.0,
70+
text = 'Robbery',
71+
time = 30000,
72+
flashes = true
73+
}
74+
})
75+
```

pages/it_bridge/exports/disptach/server.mdx

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,24 @@ You can add your own dispatch system to the bridge by editing the `disptach/serv
1818
### Disptach Data
1919
```lua
2020
{
21-
job = 'police', -- The job that should receive the disptach.
22-
jobs = {'police', 'ambulance'}, -- The jobs that should receive the disptach.
23-
title = 'Robbery', -- The disptach title.
24-
message = 'A robbery has been reported at the bank.', -- The disptach description.
21+
job = 'string', -- The job that should receive the disptach.
22+
jobs = {}, -- List of jobs that should receive the disptach.
23+
title = 'string', -- The disptach title.
24+
message = 'string', -- The disptach description.
2525
coords = {x = 0.0, y = 0.0, z = 0.0}, -- The disptach location.
2626
callCode = {
27-
code = '10-31', -- The disptach code.
28-
snippet = '10-31' -- The disptach priority.
27+
code = 'string', -- The disptach code.
28+
snippet = 'string' -- The disptach priority.
2929
},
30-
flashes = true, -- If the disptach should flash on the map.
31-
image = 'https://i.imgur.com/0J2QX1E.png', -- The disptach image.
30+
flashes = boolean, -- If the disptach should flash on the map.
31+
image = 'string', -- The disptach image.
3232
blip = {
33-
sprite = 1, -- The disptach blip sprite.
34-
colour = 1, -- The disptach blip color.
35-
scale = 1.0, -- The disptach blip scale.
36-
text = 'Robbery', -- The disptach blip label.
37-
time = 30000 -- The disptach blip time.
38-
flashes = true -- If the disptach blip should flash.
33+
sprite = number, -- The disptach blip sprite.
34+
colour = number, -- The disptach blip color.
35+
scale = number, -- The disptach blip scale.
36+
text = 'string', -- The disptach blip label.
37+
time = number -- The disptach blip time.
38+
flashes = boolean -- If the disptach blip should flash.
3939
}
4040
}
4141
```
@@ -48,4 +48,28 @@ exports.it_bridge:SendDispatch(disptachData)
4848

4949
- disptachData: `table`: The disptach data.
5050

51-
Sends a disptach with the specified data.
51+
Sends a disptach with the specified data.
52+
53+
### Example
54+
```lua
55+
exports.it_bridge:SendDispatch({
56+
job = 'police',
57+
title = 'Robbery',
58+
message = 'A robbery has been reported at the bank.',
59+
coords = {x = 0.0, y = 0.0, z = 0.0},
60+
callCode = {
61+
code = '10-31',
62+
snippet = '10-31'
63+
},
64+
flashes = true,
65+
image = 'https://i.imgur.com/0J2QX1E.png',
66+
blip = {
67+
sprite = 1,
68+
colour = 1,
69+
scale = 1.0,
70+
text = 'Robbery',
71+
time = 30000,
72+
flashes = true
73+
}
74+
})
75+
```
Lines changed: 90 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,92 @@
1+
---
2+
title: it_bridge | Client Exports - Menus
3+
description: Learn how to use the client Menus exports for the it_bridge resource.
4+
---
5+
16
import { Callout } from '@components/Callout'
27

3-
<Callout type="waring">
4-
Currently not available.
5-
</Callout>
8+
# Client
9+
<Callout type="warning">
10+
These exports can only be used on the client-side. Make sure to use them in your client-side script files.
11+
</Callout>
12+
13+
14+
### Menu Data
15+
```lua
16+
{
17+
id = 'string', -- The unique identifier of the menu.
18+
title = 'string', -- The title of the menu.
19+
menu = 'string', -- The menu to open when the menu is closed. (Only ox_lib)
20+
onBack = function, -- The function to execute when the back button is pressed. (Only ox_lib)
21+
options = {optionData}, -- The options of the menu.
22+
}
23+
```
24+
25+
### Menu optionData
26+
```lua
27+
{
28+
title = 'string', -- The title of the option.
29+
description = 'string', -- The description of the option.
30+
disabled = boolean, -- If the option is disabled.
31+
readOnly = boolean, -- If the option is read-only.
32+
onSelect = function, -- The function to execute when the option is selected.
33+
icon = 'string', -- The icon name. (From FontAwesome)
34+
progress = number, -- The progress amount of the option. (Only ox_lib)
35+
colorScheme = 'string', -- The color scheme of the option. (Only ox_lib)
36+
image = 'string', -- The image URL of the option. (Only ox_lib)
37+
metadata = 'table', -- The metadata of the option. (Only ox_lib)
38+
params = {
39+
event = 'string', -- The event to trigger when the option is selected. (Only qb-menu)
40+
args = 'table', -- The arguments to pass to the event. (Only qb-menu)
41+
}
42+
}
43+
```
44+
45+
If you want your script to work with all Disptach systems that are integrated in it-brige please make sure that you enter all these data
46+
47+
## OpenMenu
48+
```lua
49+
exports.it_bridge:OpenMenu(menuData)
50+
```
51+
52+
- menuData: `table`: The menu data.
53+
54+
Opens a menu with the specified data.
55+
56+
### Example
57+
```lua
58+
exports.it_bridge:OpenMenu({
59+
id = 'example',
60+
title = 'Example Menu',
61+
options = {
62+
{
63+
title = 'Option 1',
64+
description = 'This is option 1',
65+
onSelect = function()
66+
print('Option 1 selected')
67+
end,
68+
params = {
69+
event = 'example:event',
70+
args = { 'arg1', 'arg2' },
71+
},
72+
},
73+
{
74+
title = 'Option 2',
75+
description = 'This is option 2',
76+
onSelect = function()
77+
print('Option 2 selected')
78+
end,
79+
params = {
80+
event = 'example:event',
81+
args = { 'arg1', 'arg2' },
82+
},
83+
},
84+
{
85+
title = 'Disabled Button',
86+
description = 'This button is disabled',
87+
icon = 'fas fa-ban',
88+
disabled = true,
89+
}
90+
},
91+
})
92+
```
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Callout } from '@components/Callout'
22

3-
<Callout type="waring">
4-
Currently not available.
3+
<Callout type="error">
4+
The Menus has no server exports available. If you want to use the TextUI exports please use the client exports.
55
</Callout>

0 commit comments

Comments
 (0)