minetest-mods / unified_inventory

An extensible inventory mod which allows searching crafting and browsing for recipes in the same dialogue.
Other
49 stars 38 forks source link

[Feature request] Highlight slots on hover #249

Open JanezCZ opened 1 month ago

JanezCZ commented 1 month ago

I would like to have visual feedback in inventory on what slot I am currently pointing at.

Similar behaviour can be seen in default GUI inventory - when cursor points to a slot, the slot is highlighted. This would result in higher precision when picking correct inventory slot.

Highlighting is enabled on all buttons but not on slots themselves, so this change would unify whole experience within GUI.

SmallJoker commented 1 month ago

There is currently only one way to implement the "hover" effect for inventory slots: listcolors[...]. This formspec element changes the border and background colors based on the hover state.

However, Minetest does not provide a functionality to use custom textures for slot rendering. unified_inventory thus sets the default colors to transparent and uses background9[...] to draw the slots manually. Hence there is no callback or styling option that would allow the highlight effect.

Cannot implement. Please open an issue in minetest/minetest to stylize inventory slot backgrounds using style[...].

JanezCZ commented 1 month ago

I was trying few stuff in between. It seems like Everness mod came with ability to tweak look of inventory slots within its chests but kept highlight on hover. I honestly don't know if it can be relevant or not to whole inventory highlighting as I don't know much about code. Also in Minetest issue i3 was mentioned but I suppose i3 either uses default slots or sets only slot color and depends more on game doing it's job with the rest.