double space for line break

This commit is contained in:
DokaDoka committed 2022-12-11 16:07:56 +11:00
1 parent 724c7e356d
commit 2b549c3d06
5 files changed
+16 -37

No files matched your search

+1 -2
View File
@@ -4,8 +4,7 @@ title: Home
Here you can find all of the official documentation for resources developed by the Overextended team Here you can find all of the official documentation for resources developed by the Overextended team
If you feel like the documentation is lacking in some department then feel free to go onto that page If you feel like the documentation is lacking in some department then feel free to go onto that page and click the "Edit this page" at the bottom and submit a Pull Request.
and click the "Edit this page" at the bottom and submit a Pull Request.
## Support our team ## Support our team
+6 -13
View File
@@ -78,9 +78,7 @@ You can register as many context menus in one `lib.registerContext` function
as you'd like. as you'd like.
The menu can be either in the order you write it in, or sorted alphabetically. The menu can be either in the order you write it in, or sorted alphabetically.
To sort the menu alphabetically the buttons (and/or metadata) need to be defined as keys, To sort the menu alphabetically the buttons (and/or metadata) need to be defined as keys, otherwise not using keys and instead using tables will make the menu be in the order you define it as.
otherwise not using keys and instead using tables will make the menu be in the order you
define it as.
### lib.showContext ### lib.showContext
@@ -283,8 +281,7 @@ RegisterCommand('testcontext', () => {
</TabItem> </TabItem>
</Tabs> </Tabs>
To trigger the event from the `Event button` and get it's data we first To trigger the event from the `Event button` and get it's data we first need to register the event properly:
need to register the event properly:
<Tabs> <Tabs>
<TabItem value='Lua'> <TabItem value='Lua'>
@@ -337,19 +334,15 @@ onNet('some_event', () => {
</TabItem> </TabItem>
</Tabs> </Tabs>
The data from the `args` table in the menu is passed as a first argument to The data from the `args` table in the menu is passed as a first argument to the event you register, in this case that argument is called `data`.
the event you register, in this case that argument is called `data`.
Using this event we also register a new context menu with it's own options. Using this event we also register a new context menu with it's own options.
By defining a `menu` param to be the id of the first menu we can get the By defining a `menu` param to be the id of the first menu we can get the neat back arrow button next to the menu title that will take us back.
neat back arrow button next to the menu title that will take us back.
If we have a button that does not define either event, serverEvent or menu If we have a button that does not define either event, serverEvent or menu the button will do nothing upon being clicked.
the button will do nothing upon being clicked.
Of course just registering the event won't do much so we need to display it Of course just registering the event won't do much so we need to display it with the `lib.showContext` function, passing in the menu's id.
with the `lib.showContext` function, passing in the menu's id.
![menu_example](https://i.imgur.com/aJu92dv.png) ![menu_example](https://i.imgur.com/aJu92dv.png)
![metadata](https://i.imgur.com/kFGSlBF.png) ![metadata](https://i.imgur.com/kFGSlBF.png)
+3 -9
View File
@@ -58,17 +58,11 @@ lib.inputDialog(heading, rows)
* step?: `number` * step?: `number`
* Amount of change per slider step. Used only with `'slider'` type. * Amount of change per slider step. Used only with `'slider'` type.
The callback data is promise based meaning that the thread will The callback data is promise based meaning that the thread will not continue executing until the user either sends the data or exits the popup.
not continue executing until the user either sends the data
or exits the popup.
The data returned will be a table (array), indexes represent the rows The data returned will be a table (array), indexes represent the rows sent to the dialog, so if we want data from the first field that would be index `1` (`0`), if we want data from the third field, that would be index `3` (`2`), etc...
sent to the dialog, so if we want data from the first field that
would be index `1` (`0`), if we want data from the third field, that would
be index `3` (`2`), etc...
The standard input rows will always return a string, if you want a row to be of The standard input rows will always return a string, if you want a row to be of number data type, you can use set the `type` to `number`.
number data type, you can use set the `type` to `number`.
If a user left an input field empty it will return `nil`. If a user left an input field empty it will return `nil`.
+5 -11
View File
@@ -41,8 +41,7 @@ All supported functions are located inside the `resource` folder in the lib.
You can get the npm package [here](https://npmjs.com/package/@overextended/ox_lib). You can get the npm package [here](https://npmjs.com/package/@overextended/ox_lib).
**Usage:** **Usage:**
You can either import the whole library object which contains all the functions for that scope (client/server/shared) or You can either import the whole library object which contains all the functions for that scope (client/server/shared) or you can deconstruct it and import the functions you find needed at the time.
you can deconstruct it and import the functions you find needed at the time.
```ts ```ts
import lib from '@overextended/ox_lib/server' import lib from '@overextended/ox_lib/server'
@@ -65,16 +64,12 @@ add_ace resource.ox_lib command.remove_principal allow
``` ```
That's it! That's it!
You can now use the library functions inside of your resource, check the rest of the You can now use the library functions inside of your resource, check the rest of the documentation to see how to utilise them.
documentation to see how to utilise them.
## Using icons for interface functions ## Using icons for interface functions
The icon library used is Font Awesome 6.0, if for the icon you define only a string The icon library used is Font Awesome 6.0, if for the icon you define only a string the default icon type will be `solid`.
the default icon type will be `solid`. If you want to use a different icon type, i.e apple as a brand, you need to define icon as a table (`array`) with the first value being the icon type (`fas`, `far`, `fab`) as a string, and the second being the icon name.
If you want to use a different icon type, i.e
apple as a brand, you need to define icon as a table (`array`) with the first value being
the icon type (`fas`, `far`, `fab`) as a string, and the second being the icon name.
<Tabs> <Tabs>
<TabItem value='Lua'> <TabItem value='Lua'>
@@ -95,8 +90,7 @@ icon: ['fab', 'apple']
## Building the UI ## Building the UI
If you wish to edit any of the UI elements you will need to download the *source* code, edit what you need and then If you wish to edit any of the UI elements you will need to download the *source* code, edit what you need and then compile it.
compile it.
:::danger :::danger
+1 -2
View File
@@ -76,8 +76,7 @@ Before using the UI first you have to make sure you have the `mysql_ui` convar s
set mysql_ui true set mysql_ui true
``` ```
Also make sure that you have `command` ace permission access, then you should be able to use the Also make sure that you have `command` ace permission access, then you should be able to use the `mysql` command in game to open up the UI and see your query data.
`mysql` command in game to open up the UI and see your query data.
## Compatibility ## Compatibility