Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make moving items inside containers require an empty hand #32706

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SlamBamActionman
Copy link
Member

About the PR

This PR makes moving and dropping objects inside containers require a free hand, and any interaction with picking up/dropping an object are now applied when doing the aforementioned actions inside a container.

Why / Balance

The drag & drop is a nice feature to have, but it bypasses a few key systems in a way that wouldn't be intuitive. This includes forensics, glue/lube and dual wielding.

It also doesn't make much sense that you would be able to rearrange your inventory with your hands full or empty a container. This PR essentially leaves it up to user preference; if you wish to move things in your inventory, you can either do it by taking the item out and placing it back where you want it, or you can drag & drop. Neither method becomes better than the other.

Technical details

This code replaces the in-container moving by making the player immediately pick up and then drop the item into the container again. For dragging an item out of a container, the item is picked up and then immediately dropped on the floor.

There's also a check for an empty hand when trying to start a drag&drop drag, to keep the UI easy to understand.

For forensics to correctly apply, #30609 is necessary (PRs can be merged independently).

Media

2024-10-09.00-13-21.mp4
2024-10-09.00-13-58.mp4

Requirements

Breaking changes

Changelog

🆑

  • tweak: An empty hand is now required to move objects inside containers.

@bruhmogus
Copy link

i don't see why this would make sense, irl you can just... move it with your arm

@packmore
Copy link
Contributor

packmore commented Oct 8, 2024

how is this any more intuitive than just being allowed to move things in your inventory whenever? this is a goofy space game, no reason to be going anti-QoL just for realism.

@metalgearsloth
Copy link
Contributor

how is this any more intuitive

Moving entities around your inventory already requires a hand, making storage require it is more consistent and I would argue more intuitive due to this.

@SlamBamActionman
Copy link
Member Author

i don't see why this would make sense, irl you can just... move it with your arm

You have to make concessions for stuff like glue and forensics to work, or something like #25253. If you're moving an object around, you're interacting by touching it, and if you're touching it you should require a free hand.

@Erisfiregamer1
Copy link
Contributor

Moving entities around your inventory already requires a hand, making storage require it is more consistent and I would argue more intuitive due to this.

while I agree it'd be slightly more intuitive, this is just annoying as a casual player. in a real life situation, as bruhmogus said, I'd just use my arm to move it if my hands were full.

@packmore
Copy link
Contributor

packmore commented Oct 9, 2024

Moving entities around your inventory already requires a hand, making storage require it is more consistent and I would argue more intuitive due to this.

i guess i'm looking at it from the perspective of "intuitive for a video game" and not "intuitive for someone who has never played a video game". like, i wouldn't automatically assume that my item not moving in my inventory is because of my filled hand, i'd assume i'm lagging or that there's a bug. i might figure it out quickly, but i think it would just be more frustrating and be an overall negative payoff.

@metalgearsloth
Copy link
Contributor

i wouldn't automatically assume that my item not moving in my inventory is because of my filled hand

Does this mean you should be able to unequip inventory items even if your hands are full?

@packmore
Copy link
Contributor

packmore commented Oct 9, 2024

Does this mean you should be able to unequip inventory items even if your hands are full?

this is a false equivalence imo. equipped items are inserted into your hands when unequipped, and there is no other way to take the equipped items off (as far as i'm aware). also, the equip UI has no reason to be organized and it doesn't really affect QoL in any way. being able to move things around while holding an item then quickly store the item makes sense and doesn't even require you to put that item down IRL - why should it in game when it only adds needless frustration? not to mention, being able to organize your items in a container UI is a pretty obvious game abstraction that doesn't really make sense to force into being more realistic.

@UbaserB
Copy link
Member

UbaserB commented Oct 9, 2024

I actually never knew it was possible to move items with something in your hand, I always picked it up and placed back into the inventory... I've been playing the game wrong lol (but honestly this pr will change nothing for me so its fine)

@Centronias
Copy link
Contributor

To set a bit of context, presently with full hands, you can

  • Click and drag to rearrange items in storage
  • Click and drag to remove items from storage (they're dropped on the floor under your sprite)

, and you cannot

  • Click and drag to pick up items from the world, either to inventory (ie. pockets) or storage; or to equip
    • because click and drag doesn't do anything to items in the world -- the click tries to pick up, but fails because full hands
  • Click and drag to equip items from storage, either to equipment slots, pockets or hands
    • This is perhaps the most inconsistent one for somebody who doesn't know how the UI works because...
    • It just drops the item on the ground. The clicked-and-dragged ghost UI thingy doesn't interact with the inventory/pockets/hands UI at all, and it acts like you're just dropping the item in the world

So, perhaps the broader question @metalgearsloth is asking here is whether or not the inventory/hands/pockets should work more like storage. That is, specifically, if it should have the same sort of click-and-drag capability.
And then the flipside would be if storage should work more like the inventory/hands/pockets and require an open hand to make any position changes.

/// <summary>
/// Check if the entity interacting with the container is doing so with an empty hand.
/// </summary>
private bool ValidateEmptyHand(EntitySessionEventArgs args, [NotNullWhen(true)] out Hand? emptyHand)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO a name like TryGetEmptyHand (to parallel TryComp) fits better with the out var semantics.
But at the same time I have next to no experience with out vars, so I dunno.

@Graded5
Copy link

Graded5 commented Oct 10, 2024

i dont really like that you cant move items if you have a empty hand but its not your active hand

@PJB3005 PJB3005 added the Undergoing Maintainer Discussion This PR is currently going through the 72-hour discussion window as per maintainer policy label Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Undergoing Maintainer Discussion This PR is currently going through the 72-hour discussion window as per maintainer policy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants