-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Clean up and organize item info panel #38030
Conversation
You've got a bit of a messy history here, just FYI. |
Compiled these changes and compared with a number of different items, and what you've done seems fairly sensible so far. Subtle. Nothing glaringly out of place, though I still disagree with the item description being at the top. |
@anothersimulacrum Yeah, it went all wonky after I merged from upstream master, and now shows the full commit history of my
@Kilvoctu Thanks for testing - yes, I am doing my best not to change anything too radically, since I know players have gotten used to the placement of things. What kind of info would you put before the item description? |
I'll bet the problem is that you're not wiping your branch between each PR - this isn't a wrong thing to do, and doesn't necessarily lead to this problem - but because most PRs have their commits squashed, git can't just fast-forward when you try to merge with upstream (you can see it's not fast-forwarding because there are merge commits), because you've got different commits. So, a few ways to keep this from happening:
To clean this up:
If you need any further explanation or help, I'm pretty available on the discord. I can also help out here, though to a bit of a lesser extent. |
That's the work I always wanted to do. Good job. Suggestion: move "Techniques when wielded" section closer to or even merge it with the "Weapon stats" section. |
@wapcaplet Can you make the item name, at the very top of window, have a color like in the inventory? You must use the function |
Brighter text for keywords at the start of the sections would maek quick scanning faster. White for Disassembling and repair. |
Existing headings were about half and half between these two styles: <bold>Heading:</bold> <bold>Heading</bold>: This commit standardizes on the latter, for all item info.
Factoring out armor-related info to (mostly) one place, via two new functions: - `armor_protection_info` (formerly duplicated at the end of both `armor_info` and `animal_armor_info`), showing bash/cut/acid/fire/env protection for the armor - `armor_fit_info` (formerly embedded in `final_info`) showing how well/poorly the armor fits, and reszability options Does not change display functionality at all; verified by `cata_test`.
Readability
For modularity and symmetry with disassembly_info
The repair_info function was incorrectly returning only IF the item is repairable. It should be the opposite.
Qualities are somewhat more important than repair or disassembly; this moves item qualities above both of them. Repair and disassembly attributes were sometimes widely separated; they are conceptually similar and belong together. Their headings are now similarly formatted as well, changing this: <bold>Repaired with</bold>: ... Disassembling this item takes ... and might yield ... to this: <bold>Repair</bold>: using ... <bold>Disassembly</bold>: takes ... and might yield ... Finally, adds some tags to the iteminfo tests for more granular control over which tests run.
To keep conductivity (and wool allergy while we're at it) in the same section with the other flags
Volume is not more important than other labels in this section and doesn't need to be bold.
Jacking quality is handled separately from other qualities; good to include a test case for it.
Looks better having material with other physical attributes instead of with offensive combat ratings.
A big bold "Rigid" heading was displayed always and only for NON-rigid items, which seemed a little counterintuitive. Removed the boldness, and added a message for rigid items too, along with an explanation for both, e.g. Rigid: Volume and encumbrance are constant. Not rigid: Volume and encumbrance increase when filled. Added test cases (rigid briefcase, non-rigid backpack).
On second thought, this looks rather silly. Remove the rigidity indicator for the 99% of items that are rigid; leave it for non-rigid items, but do not make it bold.
These sections don't need to draw the eye so much. Also do a little bit of code refactoring to avoid unnecessary math.
01387b8
to
b34cf1a
Compare
Thanks everyone for the feedback! These are all good suggestions - please keep them coming. I've edited the "planned" list in the description to include them. I believe I have the commit history sorted now thanks to some help from the Discord chat, and force-pushed a cleaner branch. |
To avoid MacOS compiler errors (I hope - no way to test but push and see what Travis CI says)
Travis CI has been giving a persistent error with A single-line static cast seems to get around it, but that's an ugly thing to fill the entire test with, so I added (and did my best to explain) a wrapper function to (hopefully) work around it: bbc8909 |
I like most of the changes, but I agree with @Night-Pryanik that item description looks more natural when displayed right after item name. I would like to keep item name and description together. Maybe we can make ordering of various item info blocks configurable (in current or some other PR)? I also suggest highlighting item name with |
What if we display at the top the first lines of description and ellipsis for long descriptions? And a full description at the bottom. |
@AMurkin I don't think splitting the description into two pieces is a good idea, especially if it could happen arbitrarily (leaving, say, two words moved to page 3). A proper solution would need to be intelligent about splitting on sentence boundaries, and it could be difficult to find the other half of the description without a distinctive footnote marker or something. I'm not opposed to the idea, but I don't have any interest in doing all that stuff for this PR.
@ZhilkinSerg I did consider this, but it's complicated by the fact that clothing, favorited items, (and possibly others) have their names displayed twice at the top of this window. In these cases, the second one would get the white highlight, which could be weird. Lines 847 to 852 in 05940bf
I didn't try to tackle this because I don't know whether |
I think @AMurkin meant in their proposal that the description effectively would be in two places. At the top, the description would get cut off if it exceeded one line. Then at the bottom, the description would be displayed again in full. |
the idea in this PR is very nice. if i may add an idea that is outside the scope of this PR: anyway in my opinion, it's already quite good first step in right direction. |
Also force lbs for one potentially failing test
…into iteminfo-cleanup
Can you resolve conflicts please? |
Merge in Damage per second from CleverRaven#38600 and include it in existing iteminfo test cases
Conflicts are resolved; Travis CI is failing on Manatouched mutation tests, but I can't reproduce it locally. |
Item description allows you to instantly understand item value. Since most of the CDDA items are from real life, player doesn't need to dive into numbers and stats. Item description should be on top after name. |
(cherry picked from commit ea2c098)
Summary
SUMMARY: Interface "Clean up and organize item info panel"
Purpose of change
This is a broad set of changes aimed at making the item description panel more readable and consistent, and improve player morale by grouping the information in a clear and logical manner.
Describe the solution
Changes made so far:
User interface:
:
is not emphasizedInfrastructure:
item::armor_protection_info
item::armor_fit_info
item::bionic_info
item::repair_info
item::contents_info
item::combat_info
Describe alternatives you've considered
There were some things I planned to try and tackle, but now think may be better addressed in separate PRs:
input_event draw_item_info(...)
insrc/output.cpp
- seems like someone wanted it this way, and I didn't want to break itTesting
Rerunning
tests/cata_test [iteminfo]
after incremental changes; adding tests as I went along; frequent playtestingAdditional context
Screenshots below compare items before (left) and after (right) the changes applied in this PR.
Halligan bar:
Compound bow: