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

Restore direction-selector for 'g' item pickup menu #52683

Merged
merged 5 commits into from
Nov 7, 2021

Conversation

wapcaplet
Copy link
Contributor

@wapcaplet wapcaplet commented Nov 7, 2021

Summary

Bugfixes "Restore direction-selector for 'g' item pickup menu"

Purpose of change

The new item pickup menu implemented in #51033 removed the directional selector, in favor of showing all items from all adjacent tiles. This behavior is not only surprising to many players, but breaks the rule followed by all other world-affecting actions, including Drop, examine, open, close, Grab, smash and so on, that the player must select which nearby tile to act on.

Describe the solution

Re-implement a directional selector for the g action. When using g, highlight all adjacent tiles with items that can be picked up, and prompt "Pick up items where?" When a direction is selected, show the new item pick-up menu, including only the items on the selected tile. Make this directional-prompt behavior the default, as it has been for years.

Add a new action, ACTION_PICKUP_ALL, that uses the new pick-up behavior encompassing all adjacent tiles. This action is not bound to any shortcut keys by default, but can be reassigned from the ? global keybinding menu. Now, you may choose whether g will prompt for a direction (default behavior), whether g will pick up all adjacent items (if you rebind it to the new action), or whether you want separate shortcut keys for each action. See screenshots below for example.

Describe alternatives you've considered

The tiles with nearby items are not actually highlighted as expected. It would be nice to fix this as well. Fixed in commit edaa635

Testing

Go near some items and try to pick them up with g

Additional context

The g shortcut key is bound to its original "one nearby tile" behavior by default. Here is the ? keybinding screen:

image

Pressing g to pick up items shows the "Pick up items where?" prompt:

image

After selecting a direction that has items, those items are shown:

image

Choosing a direction with no items displays "There is nothing to pick up."

image

Back in the keybinding menu, if you would prefer the ability to pick up from all adjacent tiles, you may reassign g or add a different shortcut key - here I used h for example:

image

Pressing h now will open the pick-up menu containing all items from the current and adjacent tiles, without prompting for a direction.

Re-implement the old behavior of `g` to pick up items, requiring a
directional selector before the pickup menu is displayed.
@wapcaplet wapcaplet added [C++] Changes (can be) made in C++. Previously named `Code` Info / User Interface Game - player communication, menus, etc. Controls / Input Keyboard, mouse, keybindings, input UI, etc. and removed Info / User Interface Game - player communication, menus, etc. labels Nov 7, 2021
@wapcaplet wapcaplet marked this pull request as draft November 7, 2021 04:05
@mqrause
Copy link
Contributor

mqrause commented Nov 7, 2021

This behavior [...] breaks the rule followed by all other world-affecting actions, including Drop, examine, open, close, Grab, smash and so on.

I don't think that rule actually exists. It makes sense for the mentioned actions because you're interacting with specific things. However it doesn't for more generalistic actions like activate or Eat, which I personally considered more similar to pickup when I made the PR.

That doesn't mean I'm against doing this, of course. I'd still suggest keeping both variants with different hotkeys. I got more thoughts on the whole matter, but I'm still kinda low on time and it's not necessarily relevant for the goals of this PR.

@kevingranade
Copy link
Member

The direction selector needs to be optional, I'm ok with it defaulting to prompting for a direction, but I'd like that to be a toggle, probably by having one version bound to g by default.

By default, the traditional single-tile pick-up action is bound to the
`g` key, and the new pick-up action that operates on all adjacent tiles
is unbound by default. This allows players to choose whether they want
`g` to prompt for an adjacent tile, to always select all adjacent tiles,
or to have separate keybindings for both actions.
@mqrause
Copy link
Contributor

mqrause commented Nov 7, 2021

The tiles with nearby items are not actually highlighted as expected. It would be nice to fix this as well.

You need to restore the can_pickup_at method and the associated case in can_interact_at in action.cpp I think. See ac80392.

Restore can_pickup_at and the corresponding ACTION_PICKUP case in
can_interact_at, to allow the pickup directional prompt to highlight
nearby tiles with items.
@wapcaplet
Copy link
Contributor Author

wapcaplet commented Nov 7, 2021

The tiles with nearby items are not actually highlighted as expected. It would be nice to fix this as well.

You need to restore the can_pickup_at method and the associated case in can_interact_at in action.cpp I think. See ac80392.

Thanks! This made it very easy to restore the highlight behavior. PR description and screenshots updated accordingly.

The direction selector needs to be optional, I'm ok with it defaulting to prompting for a direction, but I'd like that to be a toggle, probably by having one version bound to g by default.

@kevingranade So it isn't really a toggle, but I changed it so we have two distinct actions, with potentially different keybindings (see feb18c9). Now g is by default bound to "Pick up items from one nearby tile" (with directional prompt), and a new action "Pick up items from all nearby tiles" (unbound by default) implements the no-directional-prompt version. I hope this is satisfactory.

@kevingranade
Copy link
Member

Yeah sorry toggle is the wrong word I was editing my reply because at first I said option but then realized I definitely do not want this to be hoisted to an option and didn't correct the rest of my post to match.

And yes despite my lack of clarity you got what I was asking for.

@kevingranade
Copy link
Member

Any reason this is still in draft?

@wapcaplet
Copy link
Contributor Author

Nope, should be good to go.

@wapcaplet wapcaplet marked this pull request as ready for review November 7, 2021 21:17
@kevingranade kevingranade merged commit b381b4b into CleverRaven:master Nov 7, 2021
@ccaviness
Copy link
Contributor

Thank you for re-adding this! It doesn't seem to work inside a vehicle, though - I press g while inside a vehicle, choose a direction (to a cargo space), and it says There is nothing to pick up..

Seems to work fine outside on the ground.

@mqrause
Copy link
Contributor

mqrause commented Nov 7, 2021

Thank you for re-adding this! It doesn't seem to work inside a vehicle, though - I press g while inside a vehicle, choose a direction (to a cargo space), and it says There is nothing to pick up..

The easy solution is to just add both map and vehicle items on the target tile. The more elaborate one to ask which if there's both. Not sure if there's a need for that?

@Zhid13
Copy link
Contributor

Zhid13 commented Nov 8, 2021

There is a need for that. Sometimes you have to pick up stuff that fell on the floor because you overloaded your trunk and it's easier to pick it up when you can select it directly.

@adamkad1
Copy link
Contributor

adamkad1 commented Nov 11, 2021

Cool, but is there something to replace the old feature? the 'look at items in targeted tile and be able to see descriptions as well'? honestly, nobody needs to examine a tile and be told 'yeah this is floor'

@ProfoundDarkness
Copy link
Contributor

'e' and 'E' work on most if not all inventory handling screens to get details about an item. So for example 'i'nventory, highlight an item, 'e'.

@adamkad1
Copy link
Contributor

get menu doesnt let you select too big items though

@ProfoundDarkness
Copy link
Contributor

Might I suggest checking options - General - "Dangerous pickups" ? You may see something a bit more like what is desired if that is enabled. Also I thought it was enabled for me but it wasn't when I just checked...

Now the 'g'et menu still seems to try and block you from picking up items which would put you on the ground, even with dangerous pickups enabled. For some light testing I tried filling my inventory with a LOT of water (lots of weight) and then tried to pick up an empty 200L barrel. With dangerous pickups off, it was marked as too heavy and thus couldn't pick it up. Turned on dangerous pickups and now I could pick up (then wield via the automatic prompt) the 200L barrel. I set that barrel down and tried to pick up a 100L barrel full of water. I was denied doing so, this is with dangerous pickups ON. When I wielded the item I hit the floor - crushed to the floor from carrying too much weight.

The precise point where item pickup still blocks you, even with dangerous pickups enabled, is unknown to me. It may kick in somewhat sooner. I haven't been playing with dangerous pickups enabled combined with the new pickup interface for long...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Controls / Input Keyboard, mouse, keybindings, input UI, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants