Compare commits

...

20 Commits
1.5.1 ... 1.7

Author SHA1 Message Date
e3861bcc6a Change sign texture 2019-09-06 18:18:03 +02:00
6b76c8c10f API to set a custom background 2019-09-06 17:56:41 +02:00
5f68d2de11 Improve the interface 2019-09-06 17:06:23 +02:00
ea12d5ca14 Optimize textures with oxipng 2019-09-06 16:33:19 +02:00
3d77ec58b4 Ability to register custom crafts dynamically 2019-09-06 15:51:30 +02:00
83151cb394 More interface fine-tuning 2019-09-06 13:31:50 +02:00
337ac898cd Fine-tune items positioning + Remove zoom in/out features 2019-09-05 21:04:27 +02:00
cb0200a222 Small cleanup 2019-09-05 15:02:38 +02:00
ae4b15a748 Improve grid display 2019-09-05 14:42:35 +02:00
2fa14ae146 Code cleaning 2019-08-31 13:34:54 +02:00
8b86dfc857 Fine-tune HUD 2019-08-30 18:36:34 +02:00
c468ab22fd Update mod.conf 2019-08-30 17:20:39 +02:00
d324c5f1e5 Progressive mode: Add a Steam-like HUD success + remove useless API functions 2019-08-30 17:05:03 +02:00
dfa45789e2 Style cleaning 2019-08-29 15:41:32 +02:00
80a0d67f15 Ability to register recipes in MC-like way 2019-08-29 14:56:53 +02:00
22c5c9444e Interpret group value 0 as "not in group".
This fixes instances where items are counted as part of a group by
craftguide but not by the engine.
2019-08-29 14:47:19 +02:00
97676d094e Fix possible crash 2019-06-30 19:42:32 +02:00
ca18ae0e3a Fix nil item crash in get_tooltip() - Fixes #84, regression caused by d950c71db (@pauloue) 2019-06-30 16:37:09 +02:00
e710fcd483 Small optimization 2019-06-23 01:42:12 +02:00
a2e4f20791 Items with no recipes but with usages are shown 2019-06-23 01:25:18 +02:00
13 changed files with 514 additions and 468 deletions

View File

@ -2,6 +2,7 @@ unused_args = false
allow_defined_top = true
read_globals = {
"core",
"minetest",
"default",
"sfinv",

78
API.md
View File

@ -11,17 +11,35 @@ craftguide.register_craft_type("digging", {
})
```
#### Registering a custom crafting recipe (example)
#### Registering a custom crafting recipe (examples)
```Lua
craftguide.register_craft({
type = "digging",
width = 1,
output = "default:cobble 2",
result = "default:cobble 2",
items = {"default:stone"},
})
```
Recipes can also be registered in a Minecraft-like way:
```Lua
craftguide.register_craft({
grid = {
"X #",
" ## ",
"X#X#",
"X X",
},
key = {
['#'] = "default:wood",
['X'] = "default:glass",
},
result = "default:mese 3",
})
```
---
### Recipe filters
@ -55,10 +73,6 @@ end)
Removes the recipe filter with the given name.
#### `craftguide.set_recipe_filter(name, function(recipe, player))`
Removes all recipe filters and adds a new one.
#### `craftguide.get_recipe_filters()`
Returns a map of recipe filters, indexed by name.
@ -119,49 +133,6 @@ Returns a map of search filters, indexed by name.
---
### Custom formspec elements
#### `craftguide.add_formspec_element(name, def)`
Adds a formspec element to the current formspec.
Supported types: `box`, `label`, `image`, `button`, `tooltip`, `item_image`, `image_button`, `item_image_button`
Example:
```lua
craftguide.add_formspec_element("export", {
type = "button",
element = function(data)
-- Should return a table of parameters according to the formspec element type.
-- Note: for all buttons, the 'name' parameter *must not* be specified!
if data.recipes then
return {
data.iX - 3.7, -- X
sfinv_only and 7.9 or 8, -- Y
1.6, -- W
1, -- H
ESC(S("Export")) -- label
}
end
end,
-- Optional.
action = function(player, data)
-- When the button is pressed.
print("Exported!")
end
})
```
#### `craftguide.remove_formspec_element(name)`
Removes the formspec element with the given name.
#### `craftguide.get_formspec_elements()`
Returns a map of formspec elements, indexed by name.
---
### Miscellaneous
#### `craftguide.show(player_name, item, show_usages)`
@ -180,3 +151,12 @@ You can add a stereotype like so:
```Lua
craftguide.group_stereotypes.radioactive = "mod:item"
```
#### `craftguide.background`
You can set a custom background theme by overriding this variable:
```Lua
craftguide.background = "my_custom_bg.png"
```

View File

@ -17,5 +17,4 @@ Use the command `/craft` to show the recipe(s) of the pointed node.
For developers, `craftguide` also has a [modding API](https://github.com/minetest-mods/craftguide/blob/master/API.md).
![Preview2](https://i.imgur.com/bToFH38.png)
![Preview2](https://i.imgur.com/oGSvbTW.png)

View File

@ -1,2 +0,0 @@
sfinv?
sfinv_buttons?

896
init.lua

File diff suppressed because it is too large Load Diff

View File

@ -1 +1,3 @@
name = craftguide
optional_depends = sfinv, sfinv_buttons
description = The most comprehensive Crafting Guide on Minetest

Binary file not shown.

Before

Width:  |  Height:  |  Size: 169 B

After

Width:  |  Height:  |  Size: 68 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 728 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 685 B

After

Width:  |  Height:  |  Size: 894 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 685 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB