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
27 files changed
+63 -84

No files matched your search

+1 -1
View File
@@ -5,7 +5,7 @@ title: Alert Dialog
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
Simple alert dialog that can display a message to the player.
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
+7 -14
View File
@@ -77,10 +77,8 @@ lib.registerContext(context)
You can register as many context menus in one `lib.registerContext` function
as you'd like.
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,
otherwise not using keys and instead using tables will make the menu be in the order you
define it as.
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, otherwise not using keys and instead using tables will make the menu be in the order you define it as.
### lib.showContext
@@ -283,8 +281,7 @@ RegisterCommand('testcontext', () => {
</TabItem>
</Tabs>
To trigger the event from the `Event button` and get it's data we first
need to register the event properly:
To trigger the event from the `Event button` and get it's data we first need to register the event properly:
<Tabs>
<TabItem value='Lua'>
@@ -337,19 +334,15 @@ onNet('some_event', () => {
</TabItem>
</Tabs>
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 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`.
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
neat back arrow button next to the menu title that will take us back.
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.
If we have a button that does not define either event, serverEvent or menu
the button will do nothing upon being clicked.
If we have a button that does not define either event, serverEvent or menu the button will do nothing upon being clicked.
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.
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.
![menu_example](https://i.imgur.com/aJu92dv.png)
![metadata](https://i.imgur.com/kFGSlBF.png)
+4 -10
View File
@@ -58,21 +58,15 @@ lib.inputDialog(heading, rows)
* step?: `number`
* Amount of change per slider step. Used only with `'slider'` type.
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.
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.
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...
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...
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`.
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`.
If a user left an input field empty it will return `nil`.
You can also add checkboxes that will return `true` if checked and `nil` if unchecked.
You can also add checkboxes that will return `true` if checked and `nil` if unchecked.
Look at the *Advanced* example for it's usage.
:::caution