minetest-mods / craftguide

:book: The most comprehensive Crafting Guide on Minetest
Other
43 stars 20 forks source link

Fix tooltip display #115

Closed louisroyer closed 4 years ago

louisroyer commented 4 years ago

Tooltip was displaying "Unknown item" on empty slots when using a replacement in craft.

You can test this by installing basic_materials and looking at the craft for basic_materials:terracotta_base.

Note: the R symbol is printed on each slot and this is weird (I expected it to be only printed on the bucket) but I don't know how to fix this.

kilbith commented 4 years ago

Tooltips don't work like that but I'll fix it later.

louisroyer commented 4 years ago

Ok. I have another bug related to tooltip when replacement is set with more than 1 item: 2020-07-12-202929_1366x768_scrot Here, I have:


minetest.register_craft({
  output = "keyring:keyring",
  recipe = {
    { "",           "group:wire", ""           },
    { "group:wire", "group:key",  "group:wire" },
    { "",           "group:wire", ""           },
  },
  replacements = {
    { "group:wire", "basic_materials:empty_spool" },
    { "group:wire", "basic_materials:empty_spool" },
    { "group:wire", "basic_materials:empty_spool" },
    { "group:wire", "basic_materials:empty_spool" }
  },
})
``` and the line about replacement is desplayed 4 times on each wire, instead of 1 time on each wire.
kilbith commented 4 years ago

Fixed: https://github.com/minetest-mods/craftguide/commit/1980fefa50a63e09f6793c840aeb1a87c03f6699

The repeated string is not a bug, the replacements field supports more than one entry. You should only keep one entry in your case, it will apply to all group:wire in your recipe.

kilbith commented 4 years ago

By the way, I can't seem to find an item with the wire group. I looked though the basic_materials and I can't see any declaration to the wire group.

louisroyer commented 4 years ago

By the way, I can't seem to find an item with the wire group. I looked though the basic_materials and I can't see any declaration to the wire group.

Be sure to use the latest version of basic_materials (from today on master).

The repeated string is not a bug, the replacements field supports more than one entry. You should only keep one entry in your case, it will apply to all group:wire in your recipe.

I just double checked and this doesn't apply to all: if I keep one entry, only 1 get replaced, and 3 others get consumed. Oh, you mean I must do { "group:wire", "basic_materials:empty_spool 4"}, thank you.

kilbith commented 4 years ago

You can return back to the previous declaration: https://github.com/minetest-mods/craftguide/commit/e6d1857799ea81bd