minetest-mods / unified_inventory

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

Variable inventory size #194

Open JordanL2 opened 2 years ago

JordanL2 commented 2 years ago

I'm looking into a way for the player to be able to customise the size of their hotbar and inventory. I can change the size of the hotbar / inventory itself, but UI would need patches to work with it.

I see two possible approaches:

  1. I make a mod with settings that configure the inventory size, and UI uses it as an optional dependency, and uses the settings from it if found
  2. The hotbar / inventory settings are part of UI itself rather than a separate mod, defaults to the current 8x4

Would either of these approaches be acceptable? If so, which would be preferable?

SmallJoker commented 2 years ago

I suppose the simplest implementation would be done using a 3rd party mod which overwrites ui.style_full.standard_inv and ui.style_lite.standard_inv. https://github.com/minetest-mods/unified_inventory/blob/master/init.lua#L149-L150

Alternatively, it would be necessary to expose and document an API function to specify the list size. That one could basically change the same variable to center the list.