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

Improve directional highlight prompts #37597

Merged
merged 4 commits into from
Feb 3, 2020

Conversation

ifreund
Copy link
Contributor

@ifreund ifreund commented Jan 31, 2020

Summary

SUMMARY: Interface "Improve directional highlight prompts."

Purpose of change

This is just something that was bugging me, and I feel like the new behavior is a UX enhancement. It started off with just opening/closing of doors but the scope expanded to standardizing all such prompts.

Describe the solution

Check adjacent tiles for valid targets before prompting the player to select one. If there are none, exit with a message. If there is exactly one, use that as the target automatically. If there are more than one, prompt as per the current behavior.

Testing

Tested all combinations of opening/closing with 0/1/many adjacent valid targets.

@ifreund ifreund added <Enhancement / Feature> New features, or enhancements on existing Info / User Interface Game - player communication, menus, etc. [C++] Changes (can be) made in C++. Previously named `Code` labels Jan 31, 2020
@BevapDin
Copy link
Contributor

There is an overload of choose_adjacent_highlight that has a parameter auto_select_if_single, which pretty much does this for you.

Bail with a message from prompts lacking a valid target.
Autoselect the target if there is exactly one valid target.
@ifreund
Copy link
Contributor Author

ifreund commented Jan 31, 2020

Thanks for the tip @BevapDin. I tweaked that function slightly to exhibit the behavior I wanted and went ahead and applied the same changes to everything using it. This should give the UI a bit more consistency and avoid unnecessary prompts.

@ifreund ifreund changed the title Automatically select open/close target if there is only 1 valid option Improve directional highlight prompts Jan 31, 2020
@snipercup
Copy link
Contributor

snipercup commented Feb 1, 2020

I'm testing it. It's something to get used to. I tried examining something because I switched tileset and wanted to know what something is, but it would not let me examine it, instead I get:
image
In this case I was trying to examine a bed and there is nothing nearby that I can interact with.

It works fine when there is a table next to me though:
image

Is this what you mean to implement? I can still know what is what using x:
image

If there was an option to exclude 'examine' action to this auto-select feature, I would probably enable it.

Also, I would expect the deconstruction of furniture to be included in this but I don't know the exact scope you have in mind.

src/iuse.cpp Outdated Show resolved Hide resolved
src/iuse.cpp Outdated Show resolved Hide resolved
Co-Authored-By: Alexey Mostovoy <1931904+AMurkin@users.noreply.github.com>
@ifreund
Copy link
Contributor Author

ifreund commented Feb 1, 2020

@snipercup Yes, that is what I indented to implement, though the new behavior can be reverted for just examine if need be. This change pushes a little farther in the direction of separation of uses for the various actions. My thoughts are that, as you point out, x or ; to look around is the "proper" hotkey for checking what a tile is and the e should be used only if interaction with that tile is desired.

Regarding deconstruction and the scope of this PR, deconstruction doesn't currently use the choose_adjacent_highlight() function so migrating that over would be a little more involved and imo out of scope for this one.

The new behavior of bailing with an error message when there is no vaild
target stays.
@ifreund
Copy link
Contributor Author

ifreund commented Feb 1, 2020

As @esotericist pointed out, auto select for examine isn't great if the player is next to one valid target and a second invalid target that they wish to check for interactivity. I've kept the new failure message if there are no valid targets however.

There are good arguments for and against this behavior, so the only
reasonable thing to do is to make it configurable.

Enabling this saves key presses plain and simple.

Disabling this makes directional actions more consistent since one can
always count on pressing the action key and the direction in quick
succession without waiting to see if a target was autoselected.

The default was subjectively chosen to be true based on general
impressions of popularity.
@ifreund
Copy link
Contributor Author

ifreund commented Feb 1, 2020

Quoting from the last commit message:

There are good arguments for and against this behavior, so the only
reasonable thing to do is to make it configurable.

Enabling this saves keypresses plain and simple.

Disabling this makes directional actions more consistent since one can
always count on pressing the action key and the direction in quick
succession without waiting to see if a target was autoselected.

The default was subjectively chosen to be true based on general
impressions of popularity.

The new behavior of bailing with a helpful prompt when there are no valid targets was not made configurable and stayed as is.

@wapcaplet
Copy link
Contributor

I don't understand how any tile could be an invalid target for the "examine" action. Consider these messages as I enter a dark room and examine the area around me, before this change:

That is a chair.
That is a bed.
That is a rock floor.
That is a wall.
That is a dresser.
It is empty.

Now, I can only examine my surroundings like this if there are at least 2 tiles nearby containing items, doors, windows or other interactive things.

Although the "examine" keyboard shortcut has been repurposed to automatically do all kinds of different things, I think it's important to remember the original meaning of the word "examine" in such a strongly text-based role-playing environment. Thank you for making it configurable! I only wish the original behavior had been left as the default.

@ifreund
Copy link
Contributor Author

ifreund commented Feb 5, 2020

@wapcaplet I personally turn this auto setting off as well and since this PR has brought consistency to all the directional actions I think it's an improvement once you find the setting. Before, some actions auto selected a target like pry, and others didn't like examine.

I totally see where you're coming from with the use of examine to look at nearby terrain, but there's been a movement towards separation of functions between the different actions recently. The look around hotkey, ; or x by default, should serve just as well if not better for figuring out what the tiles around you represent. Perhaps examine would be more aptly named "interact" these days

@wapcaplet
Copy link
Contributor

Unfortunately, the "Autoselect if exactly one valid target" setting has no effect on the "examine" shortcomings I mentioned above. Adjacent structures, furniture, and terrain can no longer be examined at all, unless one of them happens to be interactive. #37745

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` <Enhancement / Feature> New features, or enhancements on existing Info / User Interface Game - player communication, menus, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants