Skip to content

Allow players to drop item stacks from the inventory screen #192

@dmccoystephenson

Description

@dmccoystephenson

Problem

The only ways to remove unwanted items from inventory are placing them in the world one at a time or dying. There is no way to drop a full stack directly, which becomes tedious for common items like grass that accumulate quickly and need to be cleared to free up space.

Desired behaviour

Players should be able to drop one or more items from a stack directly from the inventory screen, removing them from the inventory without placing them in the world.

Acceptance criteria

  • A player can drop an entire stack by dragging it outside the inventory panel and releasing
  • A player can drop a single item from a stack (e.g. right-click drag, or a dedicated split-then-drop gesture) — exact input can be decided during implementation, but the behaviour must be documented in README.md under Controls
  • Dropped items are removed from the inventory and do not appear in the world (they are simply discarded)
  • Dropping does not affect other inventory slots
  • The cursor slot is cleared after a successful drop
  • Attempting to drop while the inventory panel is closed (e.g. hotbar drag-out) is out of scope for this issue
  • No existing tests are broken; add tests for the drop interaction on Inventory and InventorySlot where practical

Relevant files

  • src/screen/inventoryScreen.py — mouse event handling (handleMouseClickEvent), cursor slot logic, inventory panel bounds
  • src/inventory/inventory.pyremoveByItem() and related slot manipulation methods
  • src/inventory/inventorySlot.py — slot contents and stack operations
  • README.md — Controls table to be updated with the new drop keybind/gesture

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions