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

[E]ating menu stays open on last item #29148

Merged
merged 2 commits into from
Apr 17, 2019

Conversation

cafeoh
Copy link
Contributor

@cafeoh cafeoh commented Mar 30, 2019

Summary

SUMMARY: Interface "[E]ating menu now stays open on the last consume item"
This commit is dependent on #29129 #29287 now I guess

gif

Purpose of change

Fixes #26879
Fixes #23178

The ability to streamline the consumption of items and avoid repetitive menuing has been requested for quite some time, as continuously reopening the menu and scrolling down a potentially long list of consumables can be annoying and prone to errors.

Describe the solution

The net effect of this change is that the selection menu will now stay open after consuming an item, and keep the selection cursor where it was.

This commit defines a new activity (ACT_EAT), that will reopen the menu automatically once the item has been consumed, and reselect the previous entry.

@KorGgenT KorGgenT added <Enhancement / Feature> New features, or enhancements on existing Info / User Interface Game - player communication, menus, etc. Mechanics: Character / Player Character / Player mechanics Quality of Life QoL: degree to which players are comfortable, and able to enjoy CDDA labels Mar 31, 2019
src/game.cpp Outdated Show resolved Hide resolved
@Meuka
Copy link

Meuka commented Apr 1, 2019

I must say, I'm really excited about this PR.

@kevingranade
Copy link
Member

Seems to work ok, but I'm not clear on why the item favoriting is in here... Need to read the code a bit more.

@cafeoh
Copy link
Contributor Author

cafeoh commented Apr 6, 2019

Seems to work ok, but I'm not clear on why the item favoriting is in here... Need to read the code a bit more.

Yeah I built the changes on the first commit of the favorite system (was in another PR that I closed), because I changed parts of the menus. The first PR I marked it dependent to is closed, but #29287 builds on the first commit too.

I can rebase the favoriting change out if you want, or if you just take look at #29287 first, it'll be easier if/once it gets merged.

Edit: Yeah after toying with the UI code for the past week I'm gonna need to clean this PR out before it gets merged. I'm definitely not gonna keep using item_location and an extra argument for going back to the previous spot in inventory. I'll use UI positioning (active column, active row) instead and store it in the activity. It'll be cleaner, but I'll want to wait on that favorite system merge first, in case it gets amended (or straight up rejected), since it needs some of the changes I made there.

@Rivet-the-Zombie
Copy link
Member

What's the status of this PR?

@cafeoh
Copy link
Contributor Author

cafeoh commented Apr 16, 2019

I started remaking it from scratch. I'm not super happy with it, it's still pretty hacky and I don't have much time on my hands these days so can't give an ETA, but whenever I can dedicate an hour or two to it, I'll push a new commit out.

@cafeoh
Copy link
Contributor Author

cafeoh commented Apr 16, 2019

Alright it's good to go now.

Code isn't perfect, I decided to have some more specific code in inv_internal, and that's not amazing, but any other menu using inv_internal could also just use the same system (create an activity beforehand and let the menu push both the selected column and entry to activity.values for reuse).

Alternative would be a pretty length rework of UI, storing menu related entries in the player object (which was my second choice), or generally carrying values back up the stack, which I'm really not fond of.

Of course I'm open to suggestions if someone sees a cleaner way to do this.

Copy link
Contributor

@ifreund ifreund left a comment

Choose a reason for hiding this comment

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

Code looks good to me!

@Rivet-the-Zombie Rivet-the-Zombie merged commit 71d8e6f into CleverRaven:master Apr 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Enhancement / Feature> New features, or enhancements on existing Info / User Interface Game - player communication, menus, etc. Mechanics: Character / Player Character / Player mechanics Quality of Life QoL: degree to which players are comfortable, and able to enjoy CDDA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Eat last food key. Eat from this stack until full
6 participants