-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Show NEW! in List Items menu #73400
Show NEW! in List Items menu #73400
Conversation
You should use
Yeah, I noticed that too in #55503. I didn't get to reimplementing it yet, but I was planning to address it. Might not be worth it to fix in the current ui, since it'll be gone once I finished that PR. Though progress is slow currently. |
You are right, I will. Now that somebody else wrote it, I see I probably didn't just overlook something.
I would like to fix that bug first so that my feature isn't broken from day 0. I will look into it now. |
For the most part it's just pockets missing #56623 also has a little bit more discussion about the topic of knowing/seeing contents of containers if you're interested in improving the feature in general. |
Yeah, I I am changing it with the following force-push, so I am requesting Erk, to review this too. Edit: I seem to be unable to use GitHub to do that. |
I updated the PR description to reflect the latest force push. What changed:
|
I'm not quite sure the function of the line you're switching to an OR here. Is this making it so that you can identify the contents of a backpack from across the room using |
From that list only transparency got implemented. Everything else is still hidden.
I agree with that. The question is if you can tell what's inside a pocket when it's not within reach to actually check the contents. |
Oh! I can add green Maybe This solves my unstated problem I just assumed was obvious: Also I will add forgetting the item contents to debug. Maybe my testing was weird since I was next to the items, so my character might have remembered the contents... I need to improve this a bit... I will revert the change of transparency then. And will make a separate PR, if I have further thoughts on it. |
Do you mean
I'd like a nice short word for "Unviewed" but I don't think |
It doesn't need to be too short. The view menu has some space to grow horizontally. That said, I leaned to single char
Edit: it should be short |
According to you, while plastic bags aren't transparent, they shouldn't show their contents, right? Plastic bags are a bad example since I will change them to be transparent, but for example, the I am pointing this out because otherwise there would be exactly the discrepancy there is now (my unpushed version) with plastic bags: It says "hides contents" but you can clearly see what is inside the (non-transparent) plastic barrel. Furthermore, the first step in the proposed implementation:
This can be remembered only as long as the item is in direct sight, otherwise it would leak information or be very frustrating. If you saw inside a barrel to check it does have water, then somebody else switched it for gasoline out of your sight, your character would either
Therefore it would say it contains water only as long as it is in direct sight after inspecting it is water. 2 would be possible too, but people (including @ kevingranade) already argued against a similar case that the player character is incapable of remembering all items at a glance. In this case, they are trying to remember only the contents of all items, but I would argue that is nearly the same thing.
Another more likely case might be inspecting the contained water amount from a distance. Either a barrel NPC drank from or a barrel with a funnel that is being filled by rain. |
This PR is ready once tests finish. I will play with it right now, but I already checked whatever I could. |
Debug size is fixed in another PR already merged so clang is technically fixed. |
Note: These errors are still in: Error: src/game.cpp:8628: error: ‘new_col’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
src/game.cpp:8604: note: ‘new_col’ was declared here
Error: src/game.cpp:8628: error: ‘new_str’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
src/game.cpp:8601: note: ‘new_str’ was declared here |
Summary
Interface "Show NEW! in List Items menu"
Purpose of change
Discussed something similar in
Relaxed
transparent
for pockets, so that open containers are considered transparent. One line change in commit 5bade42. Originally introduced in #56623 and @I-am-Erk was maybe against this, so we will see...Describe the solution
Heavily inspired by this, which has done it for crafting menu.
referred to as OTHER.Allow the player to track newly learned/unviewed recipes #49819
OTHER allows for reading / unreading recipes. This allows only reading (marking as not NEW!) by going to the item entry byUP
orDOWN
action.OTHER marks as read for more than justUP
&DOWN
, like mouse support. This doesn't.These actions will unNEW:
UP
,DOWN
COMPARE
,EXAMINE
,SCROLL_ITEM_INFO_UP
,SCROLL_ITEM_INFO_DOWN
TRAVEL_TO
RIGHT
,LEFT
(when there are 5 piles of a thing, the LEFT and RIGHT move to the next or previous pile)These actions will NOT unNEW:
PAGE_DOWN
,PAGE_UP
FILTER
,RESET_FILTER
,PRIORITY_INCREASE
,PRIORITY_DECREASE
,SORT
zoom_in
,zoom_out
NEXT_TAB
,PREV_TAB
Note: The List Items menu does not have mouse support.
uistate
remembers a set of items (item_id
s to be precise) in a new member variableread_items
. It is persistent. I actually don't know if per character or totally.V
.read_items
,NEW!
is written, as seen in the picturetransparent
container, then if the item or anything inside the item (recursively, fortransparent
containers) is not inread_items
,NEW!
is displayed.plastic bag -> meat jerky
isNEW!
.NEW!
but some container in the nested path is nottransparent
, then it is marked as "hides contents"UP
orDOWN
to an item, then it is added toread_items
, so it is no longerNEW!
transparent
container, then the item and everything inside the item (recursively, fortransparent
containers) is put intoread_items
and it is no longerNEW!
DOWN
to azipper bag > plastic bag > meat jerky
, then none of these items areNEW!
anymore.Describe alternatives you've considered
transparent
pocket function, but addtransparent
to individual plastic bags, zipper bags etc."transparent": true
to some pockets.V
menu to ImGui #55503Testing
TEST Item List-trimmed.tar.gz (updated for
hides contents test
)NEW
:In this save, I verified that:
DOWN
andUP
, but not onPageUp
etc.p
Player >F
Forget all itemsplastic bag > wild herbs
unNEWs bothplastic bag
andwild herbs
itemsplastic bag
, but notwild herbs
does NOT unNEWplastic bag > wild herbs
plastic bag
andwild herbs
does unNEWplastic bag > wild herbs
hides contents
:Apart from that, I checked the other things shown in the screenshot atop.
Additional context
Introduced a bug (probably):From this code:Cataclysm-DDA/src/item_contents.h
Lines 118 to 122 in db4aa91
I usedall_items_top
instead ofall_known_contents
because the former didn't work with aplastic bag
, maybe it is not transparent yet. So the player probably reveals items inside sealed non-transparent containers they shouldn't see.I would like to allow the player to browse these items later, so it should be addressed, it not only might leak the contents of a container (if you already have the item contained), but it could later show recipes etc. for the yet unseen item inside.Discovered a ~bug:
These keybindings don't reflect the bound keybinding, The green letter is hardcoded:
We seem to be thinking similarly with @mqrause, which is cool, I like there is more of me since more things I care about will be implemented into CDDA :).