Shift-click armor item in inventory to equip #4451
Labels
No Label
#P1 CRITICAL
#P2: HIGH
#P3: elevated
#P4 priority: medium
#P6: low
#Review
annoying
API
bug
code quality
combat
commands
compatibility
configurability
contribution inside
controls
core feature
creative mode
delayed for engine release
documentation
duplicate
enhancement
environment
feature request
gameplay
graphics
ground content conflict
GUI/HUD
help wanted
incomplete feature
invalid / won't fix
items
looking for contributor
mapgen
meta
mineclone2+
Minecraft >= 1.13
Minecraft >= 1.17
missing feature
mobile
mobs
mod support
model needed
multiplayer
Needs adoption
needs discussion
needs engine change
needs more information
needs research
nodes
non-mob entities
performance
player
possible close
redstone
release notes
schematics
Skyblock
sounds
Testing / Retest
tools
translation
unconfirmed
mcl5
mcla
Media missing
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: VoxeLibre/VoxeLibre#4451
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Feature
If you shift-click an armor item in your inventory and you don't have the corresponding armor slot filled, this should equip the armor item in the armor slot.
Why
This helps speed up inventory management and makes equipping easier. Also it's functionality that Minecraft has.
Point me to the relevant code and I can probably contribute. And if it's an engine thing I will contribute to the upstream minetest.
Thanks
I believe this worked at one point and was broken by a formspec (GUI) rework. See #631 for the old issue and a link to a PR that may have broken it.
This works in Mineclonia and I'm missing it in VoxeLibre, too. IMHO this should be implemented (again), as it is very useful.
I spent the last few hours digging through the source code. I had to look at the minetest source (
src/gui/guiFormSpecMenu.cpp
), which led me to the listrings.This change will equip armor when shift-clicked... but it messes up shift-click for non-armor items:
Thanks for looking into this.
I'll recommend doing what Mineclonia did with furnaces and possibly others: add a hidden sorter inventory, list it after the main inventory list and use a callback to move the items to the correct locations. I'm not sure there is really another way to have shift-click into the armor slots and the crafting grid without this.
For a player inventory, I think you will need to use
minetest.register_on_player_inventory_action(function(player, action, inventory, inventory_info))
to process the sorter inventory.Click to expand
Unfortunately my crack at it wasn't successful. It seems to work for one item (which if armor gets put in the helmet slot) and then no longer accepts anything. I assume it's because something gets "stuck" in the slot and I'm not taking care of it or something.