Do not drop item when clicking on UI window

Thoughts on the further development of Haven & Hearth? Feel free to opine!

Do not drop item when clicking on UI window

Postby VDZ » Sat Aug 27, 2022 6:31 am

So this has been an annoyance of mine for ages: Item slots are very small, so every now and then I have an item on my cursor which I try to put into a slot, but my cursor is slightly off (I'm still not 100% sure what the correct alignment is even) and instead of the item going into the slot, I drop the item. I just took 8 Jellyfish Sting damage by dropping and picking back up a Jellyfish I was trying to study. (Fortunately it was only on an alt.)

For reference, here's the study window:
Image

The cursor itself is omitted, but you can see the Woodworm is half over the slot, half over the study window outside the slot. Clicking in this position drops the item on the ground. This makes no sense and I don't think this is ever what the player intends - when I want to drop an item I either CTRL+click it or I hover it over the game world (i.e. any part of the screen not covered by UI) and click. Having it drop the item when clicking the interface is not what people expect when clicking any part of the interface - most notably the actually interactable parts of the UI, such as buttons. (If you try to click a button while holding an item, it instead drops the item and does not activate the button.)

So the simple change I'd like to see is that
  • If the player clicks an interactable UI element, the UI element is activated, regardless of whether there's something on the cursor or not. The item is not dropped.
  • If the player clicks a non-interactable UI element (e.g. UI window background, edge of slots, etc), nothing happens. Even if there's an item on the cursor, it doesn't get dropped.

Compare how the UI interacts with any other part of the game world. You cannot click any location in the world through a window background to move there, you cannot click an object through a decorative interface edge to interact with the thing in the game world obscured by the UI, and you cannot take any item from a slot behind the active window through any part of the active window. 'Having an item on your cursor' is the only use case where the UI simply stops accepting mouse input entirely and you perform a game world interaction regardless of where you click (with item slots being the only part of the interface that does respond to mouse input). There's been custom clients with 'drop protection' (require holding CTRL to drop the item on the cursor), and frankly I don't think that would even be necessary if slight misclicks just weren't interpreted as 'drop this item right now'.
User avatar
VDZ
 
Posts: 2681
Joined: Sun Jul 17, 2011 2:27 am

Re: Do not drop item when clicking on UI window

Postby VDZ » Sun Aug 28, 2022 3:59 am

Okay, so this is the case that trips me up the most:

Image

Clicking in this situation drops the bucket instead of swapping it with the other bucket. The cursor is in the top left of the bucket sprite, which is entirely outside of the bucket and very slightly outside of the top left item slot.

I experimented with it a bit and found that
  • Only the cursor itself matters for determining where you're clicking; it takes the tip of the cursor and the visual location of the item under the cursor is entirely irrelevant.
  • The relative location of the cursor compared to the location of the visual item under the cursor depends on where you click the item to pick it up. Click the center of the item to have item all around the cursor with the cursor being at the center; click the top left of the item to have the item below and to the right of the cursor; etc. This means if you select an item by one of the corners, you will run into cases where visually 'dropping' an item into a slot makes it miss that slot.
  • When an item is put under your cursor for reasons other than having clicked an item slot (e.g. you equip an item by dropping it on your equipment window and get the previously equipped item under your cursor), the cursor-item relative positioning is a bit of a crapshoot, though it'll be relatively close to the center (I didn't notice any 'corner selection' like in the screenshot from this).
  • Ender Client has useful hand slots in the top right of the screen, and it turns out that these may be part of the reason why this happens so often for me; when dropping an item into a hand slot, the previously equipped item will always be put under your cursor with the cursor at the top left corner of the item. In cases like the bucket, this causes a significant position mismatch as the cursor is anchored to transparent space.
User avatar
VDZ
 
Posts: 2681
Joined: Sun Jul 17, 2011 2:27 am


Return to Critique & Ideas

Who is online

Users browsing this forum: ChatGPT [Bot], Claude [Bot], Dotbot [Bot] and 271 guests