mirror of
https://github.com/minetest-mods/craftguide.git
synced 2025-06-29 06:30:55 +02:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
06c5307a45 | |||
5446e0dbdd |
11
API.md
11
API.md
@ -168,14 +168,3 @@ You can add a stereotype like so:
|
|||||||
```Lua
|
```Lua
|
||||||
craftguide.group_stereotypes.radioactive = "mod:item"
|
craftguide.group_stereotypes.radioactive = "mod:item"
|
||||||
```
|
```
|
||||||
|
|
||||||
#### `craftguide.background`
|
|
||||||
|
|
||||||
You can set a custom background theme by overriding this variable:
|
|
||||||
|
|
||||||
```Lua
|
|
||||||
craftguide.background = "<file_name.png>#<middle>"
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
`middle` (number) refers to a 9-sliced background. Read the engine's Lua API documentation for more info.
|
|
||||||
|
@ -19,4 +19,4 @@ For developers, `craftguide` also has a [modding API](https://github.com/minetes
|
|||||||
Love this mod? Donations are appreciated: https://www.paypal.me/jpg84240
|
Love this mod? Donations are appreciated: https://www.paypal.me/jpg84240
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
23
init.lua
23
init.lua
@ -1745,23 +1745,16 @@ function craftguide.show(name, item, show_usages)
|
|||||||
reset_data(data)
|
reset_data(data)
|
||||||
|
|
||||||
item = reg_items[item] and item or query_item
|
item = reg_items[item] and item or query_item
|
||||||
|
local recipes, usages = get_recipes(item, data, player)
|
||||||
|
|
||||||
data.query_item = item
|
if not recipes and not usages and
|
||||||
data.recipes, data.usages = get_recipes(item, data, player)
|
not recipes_cache[item] and not usages_cache[item] then
|
||||||
|
|
||||||
if not data.recipes and not data.usages then
|
|
||||||
if recipes_cache[item] then
|
|
||||||
return false, msg(name, S("You don't know a recipe for this node"))
|
|
||||||
end
|
|
||||||
|
|
||||||
if usages_cache[item] then
|
|
||||||
return false, msg(name, S("You don't know an usage for this node"))
|
|
||||||
end
|
|
||||||
|
|
||||||
if not recipes_cache[item] and not usages_cache[item] then
|
|
||||||
return false, msg(name, S("No recipe or usage for this node"))
|
return false, msg(name, S("No recipe or usage for this node"))
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
data.query_item = item
|
||||||
|
data.recipes = recipes
|
||||||
|
data.usages = usages
|
||||||
|
|
||||||
if sfinv_only then
|
if sfinv_only then
|
||||||
data.show_usages = show_usages
|
data.show_usages = show_usages
|
||||||
@ -1791,7 +1784,7 @@ register_command("craft", {
|
|||||||
end
|
end
|
||||||
|
|
||||||
if not node_name then
|
if not node_name then
|
||||||
return false, clr("red", "[craftguide] ") .. S("No node pointed")
|
return false, msg(name, S("No node pointed"))
|
||||||
end
|
end
|
||||||
|
|
||||||
return true, craftguide.show(name, node_name)
|
return true, craftguide.show(name, node_name)
|
||||||
|
@ -19,8 +19,6 @@ No item to show=
|
|||||||
Collect items to reveal more recipes=
|
Collect items to reveal more recipes=
|
||||||
Show recipe(s) of the pointed node=
|
Show recipe(s) of the pointed node=
|
||||||
No node pointed=
|
No node pointed=
|
||||||
You don't know a recipe for this node=
|
|
||||||
You don't know an usage for this node=
|
|
||||||
No recipe or usage for this node=
|
No recipe or usage for this node=
|
||||||
Node=
|
Node=
|
||||||
Entity=
|
Entity=
|
||||||
|
Reference in New Issue
Block a user