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

Examine contents header and column fix #52854

Merged

Conversation

ZeroInternalReflection
Copy link
Contributor

Summary

None

Purpose of change

A new screen for examining the contents of items was added in #51252. However, display of the header and item list relied on a couple of hackish workarounds in inventory_selector and inventory_column. Those workarounds were cleaned up in #52572, but that PR was focused on the trading UI and resulted in some display issues for inventory_examiner.

Describe the solution

Several related parts of inventory_ui are tweaked to clean up display of inventory_examiner. There should be no impact on any other ui screens.

  1. Remove the display of inventory stats (weight/volume) in the header of inventory_examiner. On smaller screen sizes, they would be displayed over the title showing what you're looking at the contents of. The stats are not particularly relevant to this screen, since it's focused on a particular container and the stats are for the player's full inventory.
  2. Move calculation of the indent for an item in a container from inventory_column::draw() to ::get_entry_indent(). There was a quirk where screens that indent contained items (i.e. this one, and the new 'g'et screen) would get cut off because the column width would be based on get_entry_indent, which didn't account for indentation. This should resolve that issue without impacting any screens that don't indent.
  3. Rename "num_parents()", a function in inventory_ui.cpp to "contained_offset()", because it's actually returning twice the number of parents
  4. Add an option to reduce indentation in inventory screens. Since everything shown in inventory_examiner is in a container, it was being indented. And if everything is indented, it doesn't provide any information.

Describe alternatives you've considered

Fixing item list display:

  • Forcing the width of the first (only) column in inventory_examiner (a bit brute force)
  • Disabling indentation in inventory_examiner (would make it a bit harder to follow nested containers)
  • Remove "are_columns_centered" check for expanding the column (This check is probably doing work on a different screen, and since I don't know where it is, it's a bit tricky to make sure it doesn't break anything)

Fixing header display:

  • Extending the header across the screen (Requires forcing the width of the first column)

Testing

I set up an inventory with several nested containers, then ensured that each of those containers displayed the header and item list correctly when examining contents.
I also checked before/after for each of the other inventory_selector screens (eat, get, disassemble, etc.) and checked to make sure that none of them changed indentation after these changes.

Additional context

Currently, the item list names are improperly truncated:
CURRENT_EXAMINE_CONTENTS_SCREEN
And when the screen is small, the parent item name in the header is overwritten by the inventory stats:
Examiner_Screen

After these changes, it looks like this:
UPDATED_EXAMINE_CONTENTS_SCREEN

The item names in the list will still get truncated, but only when they're actually too long:
UPDATED_SMALL_SCREEN

Since this is a bugfix for something that was just implemented, I figured a changelog entry for it wasn't particularly beneficial and called this a "None" rather than a "Bugfix"

@wapcaplet wapcaplet added <Bugfix> This is a fix for a bug (or closes open issue) Info / User Interface Game - player communication, menus, etc. [C++] Changes (can be) made in C++. Previously named `Code` Inventory / AIM / Zones Inventory, Advanced Inventory Management or Zones labels Nov 16, 2021
@kevingranade kevingranade merged commit 6ccec74 into CleverRaven:master Nov 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Info / User Interface Game - player communication, menus, etc. Inventory / AIM / Zones Inventory, Advanced Inventory Management or Zones
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants