Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inventory_overlay is ignored when item does not define inventory_image #8430

Closed
ClobberXD opened this issue Mar 29, 2019 · 3 comments · Fixed by #8433
Closed

inventory_overlay is ignored when item does not define inventory_image #8430

ClobberXD opened this issue Mar 29, 2019 · 3 comments · Fixed by #8433
Labels
Bug Issues that were confirmed to be a bug @ Client / Audiovisuals

Comments

@ClobberXD
Copy link
Contributor

ClobberXD commented Mar 29, 2019

Issue type
  • Bug report
Minetest version
5.1.0-dev-426bdba7
Summary

The itemdef field inventory_overlay is ignored (i.e. overlay isn't visible) when the item uses minetest.inventorycube does not define inventory_image. This bug is present in 0.4.x as well.

Context: CTF duplicates all nodes from default, and sets groups = {immortal = 1} to make them indestructible, and I'm trying to set an inventory overlay to distinguish indestructible nodes from their normal counterparts. See the relevant bit of code here: https://github.com/ClobberXD/capturetheflag/blob/2884b8046fe8a6993a20e0dfa74461ef222ccb34/mods/ctf/ctf_map/nodes.lua#L768-L775

screenshot_20190329_134038

Both the items in the hotbar have the inventory_overlay field defined. But as seen in the screenshot, ctf_map:snow displays the overlay correctly, whereas ctf_map:stone doesn't.

Steps to reproduce
  • Set the inventory_overlay itemdef field to a custom image for two items: one that defines inventory_image, and one that doesn't define inventory_image uses minetest.inventorycube (most nodes fall under the latter).
  • Obtain the items with the inventory_overlay field defined.
  • Observe that the overlay isn't visible for the item that uses minetest.inventorycube doesn't define inventory_image.
@ClobberXD ClobberXD changed the title inventory_overlay is ignored when inventory_image is created using minetest.inventorycube inventory_overlay is ignored when item uses minetest.inventorycube for inventory image Mar 29, 2019
@paramat paramat added Bug Issues that were confirmed to be a bug @ Client / Audiovisuals labels Mar 29, 2019
@Desour
Copy link
Member

Desour commented Mar 29, 2019

I can't reproduce.
I've tested it with this:

minetest.register_node("test_invcube:node", {
	description = "inventorycube node",
	tiles = {"unknown_item.png"},
	inventory_image = minetest.inventorycube("unknown_object.png",
			"unknown_node.png", "unknown_object.png"),
	inventory_overlay = "camera_btn.png",
	groups = {oddly_breakable_by_hand = 3},
})

one that uses minetest.inventorycube (most nodes from default fall under the latter).

This is wrong. They don't set an inventory image.

Searching through the ctf repository, I didn't find minetest.inventorycube being used more than two times (both not for stone).

I think that you think that setting no inventory image is equal to using minetest.inventorycube. But it istn't (enable inventory_items_animations (and restart minetest) to see the difference).

However, I can reproduce that inventory_overlay doesn't work for node items without inventory image.

@ClobberXD ClobberXD changed the title inventory_overlay is ignored when item uses minetest.inventorycube for inventory image inventory_overlay is ignored when item does not define inventory_image Mar 30, 2019
@ClobberXD
Copy link
Contributor Author

Apologies for assuming that tiles uses minetest.inventorycube internally.

@Desour
Copy link
Member

Desour commented Mar 30, 2019

I've made a PR to fix this: #8433

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues that were confirmed to be a bug @ Client / Audiovisuals
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants