Compare commits
10 Commits
88e3d6f6da
...
a35e00bb62
Author | SHA1 | Date | |
---|---|---|---|
|
a35e00bb62 | ||
|
777448dddf | ||
|
e6b30c8761 | ||
|
51974ed5b9 | ||
|
20ef10f95a | ||
|
ebb1f7cc9f | ||
|
9db2760976 | ||
|
4f3b075b60 | ||
|
9886a2db73 | ||
|
3c38635f03 |
2
.mailmap
Normal file
2
.mailmap
Normal file
@ -0,0 +1,2 @@
|
||||
Wuzzy <Wuzzy@disroot.org> <Wuzzy2@mail.ru>
|
||||
Wuzzy <Wuzzy@disroot.org> <almikes@aol.com>
|
20
API.md
20
API.md
@ -1,18 +1,20 @@
|
||||
# API documentation for [`sfinv_buttons`]
|
||||
|
||||
Use this API to add your own buttons to the page.
|
||||
Use this very simple 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)
|
||||
* `def`: Configuration table (see below)
|
||||
|
||||
### Fields of `def`
|
||||
* `title`: Human-readable text on the button
|
||||
* `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)
|
||||
* `player`: The `ObjectRef` of the player who triggered the button
|
||||
* Default behaviour: Nothing happens
|
||||
* `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
|
||||
|
@ -3,7 +3,12 @@ This mod adds a new tab (“More”) to the Simple Fast Inventory [`sfinv`] on
|
||||
which other mods can add their buttons to make it easier to access their
|
||||
core functionality.
|
||||
|
||||
The idea is to free users from typing in lame-ass chat commands. ;-)
|
||||
The idea is to free users from typing in boring chat commands. ;-)
|
||||
|
||||
Minetest version 5.0.0 or later is required.
|
||||
|
||||
Version: 1.1.2
|
||||
(This mod uses [semantic versioning](http://semver.org/) as of version 2.0.0 of the standard.)
|
||||
|
||||
## API
|
||||
The API is documented in `API.md`.
|
||||
|
@ -1,2 +0,0 @@
|
||||
sfinv
|
||||
intllib?
|
@ -1 +0,0 @@
|
||||
Adds a tab to the Simple Fast Inventory on which mods can add buttons for easy access.
|
8
init.lua
8
init.lua
@ -1,10 +1,4 @@
|
||||
-- Boilerplate to support localized strings if intllib mod is installed.
|
||||
local S
|
||||
if minetest.get_modpath("intllib") then
|
||||
S = intllib.Getter()
|
||||
else
|
||||
S = function(s) return s end
|
||||
end
|
||||
local S = minetest.get_translator("sfinv_buttons")
|
||||
|
||||
local buttons = {}
|
||||
local button_names_sorted = {}
|
||||
|
@ -1,2 +0,0 @@
|
||||
More = Mehr
|
||||
Go = Los
|
3
locale/sfinv_buttons.de.tr
Normal file
3
locale/sfinv_buttons.de.tr
Normal file
@ -0,0 +1,3 @@
|
||||
# textdomain: sfinv_buttons
|
||||
More=Mehr
|
||||
Go=Los
|
@ -1,2 +1,3 @@
|
||||
More =
|
||||
Go =
|
||||
# textdomain: sfinv_buttons
|
||||
More=
|
||||
Go=
|
||||
|
Loading…
x
Reference in New Issue
Block a user