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
Favorite System v1.0 #29287
Favorite System v1.0 #29287
Conversation
Has any other PR received that many upvotes in so little time? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my knowledge of the inventory system is just enough to get me in trouble, but nothing in this looks obviously bad.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks great to me, haven't compiled or tested though. Nice work!
@@ -20,7 +20,7 @@ | |||
#include "vpart_reference.h" | |||
|
|||
const invlet_wrapper | |||
inv_chars( "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!\"#&()*+.:;=@[\\]^_{|}" ); | |||
inv_chars( "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!\"#&()+.:;=@[\\]^_{|}" ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious as to how loading old saves with *
used as an invlet is handled. (I have no idea what would happen, it may not need any special handling)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested it, and basically the items just keep the invlet. As usual, invlets take precedence over key bindings, so it means you won't be able to use the *
bind until you unassign the item, but I don't think it's a big deal. I thought about cleaning the invlets manually (making sure they match), but I'm not convinced it'd really be worth it to have that piece of code laying around.
I wanted to improve handling of invlet attribution later so it's not as hardcoded (there's no verification at the moment), but that's for another PR.
This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there: https://discourse.cataclysmdda.org/t/latest-experimental-features/5582/1106 |
Summary
SUMMARY: Features "Adds a fully functional item favoriting system"
Back with more better features and 70% cleaner code!
(Thanks to @anothersimulacrum for his save by the way! ❤️ )
Purpose of change
Allows to favorite items from every menu including the advanced item menu (but not from the Compare and Multidrop menus). In addition to selecting a single item via the inventory menu (
Enter
->f
) there's now a new default keybinding to*
that favorites the full stack under the cursor.Two menu behaviours were added to make this actually useful (beyond just the visual aspect) :
,
) key from your inventory, where it only first empties out all non favorite item on the first press, and then drop all the rest of your favourite gear (with a warning).Describe the solution
Changed item stacking, item selector, and other UI stuff.
Future additions
,
key in the multidrop menu (might be redundant with the advanced inventory, but it'd be pretty straightforward if people are interested 🤷♂️ )