Make API intro a bit clearer
This commit is contained in:
parent
88e3d6f6da
commit
3c38635f03
14
API.md
14
API.md
@ -1,8 +1,9 @@
|
||||
# API documentation for [`sfinv_buttons`]
|
||||
|
||||
Use this API to add your own buttons to the page.
|
||||
Use this very API to add your own buttons to the new tab. There is only
|
||||
one function: `sfinv_buttons.register_button`.
|
||||
|
||||
## `sfinv_buttons.register_button(name, def)
|
||||
## `sfinv_buttons.register_button(name, def)`
|
||||
|
||||
* `name`: Unique button identifier
|
||||
* `def`: Coniguration table (see below)
|
||||
@ -12,7 +13,8 @@ Use this API to add your own buttons to the page.
|
||||
* `action(player)`: Function is called when button is triggered
|
||||
* `player`: ObjectRef to player who triggered the button
|
||||
* Default: Nothing happens
|
||||
* `tooltip: A tooltip for the button (optional, only use it for an additional, non-critical explanation)
|
||||
* `tooltip: A tooltip for the button (optional, only use it for an additional,
|
||||
non-critical explanation)
|
||||
* `image`: Texture name for the image to show left of the button (optional)
|
||||
* `show(player)`: Shall return `true` if the button should be displayed (optional)
|
||||
* `player`: ObjectRef to player who triggered the button
|
||||
@ -21,6 +23,8 @@ Use this API to add your own buttons to the page.
|
||||
## Recommendations
|
||||
|
||||
* Try to summarize the most important information on the button
|
||||
* Test if the button title still fits when having >= 9 and <= 18 buttons at a resolution of 800×600
|
||||
* It is recommended to only add buttons to access core mod functionality and not for every minor feature. The rule of thumb is to add at most 1 button per mod
|
||||
* Test if the button title still fits when having >= 9 and <= 18 buttons at a
|
||||
resolution of 800×600
|
||||
* It is recommended to only add buttons to access core mod functionality and
|
||||
not for every minor feature. The rule of thumb is to add at most 1 button per mod
|
||||
* If you like to add many buttons, consider adding your own `sfinv` page instead
|
||||
|
Loading…
x
Reference in New Issue
Block a user