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

Add widgets for bodypart status #53975

Merged
merged 1 commit into from
Jan 7, 2022

Conversation

wapcaplet
Copy link
Contributor

@wapcaplet wapcaplet commented Jan 2, 2022

Summary

Features "Add widgets for bodypart status"

Purpose of change

Widget to indicate bitten, bleeding, and/or infected status by comma-separated list of words, with colorization by limb_color.

Describe the solution

  • New display::bodypart_status - bitten, bleeding, and/or infected
  • New display::bodypart_status_text_color - colorized status for part
  • New bp_status_text widget_var - showing bodypart_status_text_color
  • New widget declarations in data/json/ui/sidebar.json
  • Test cases

Describe alternatives you've considered

Unfortunately, these take up a large amount of space; it is not really practical to squish all six into two or even three rows like the HP widgets do, without implementing a more condensed way of showing this info. Showing letters or symbols for each status would make this possible at the cost of intelligibility.

For now, I mostly want it to be possible to see all this info, and not just as a bunch of color codes applied to each limb.

There's an opportunity to expand this feature considerably, to show several other status effects on limbs:

  • broken
  • splinted
  • bandaged
  • disinfected
  • too hot/cold
  • overencumbered
  • others?

I may do did some of these in this PR as well.

Testing

Run tests/cata_test '[widget][bp_status]'

Configure your sidebar, and enable the "custom" sidebar. Ensure the "Body Part Status" widget is toggled on and visible.

Have monsters attack you, or debug add effect statuses to various body parts.

Save game with a character having various bodypart ailments and treatments, to save time adding all of them yourself: BodyPartStatuses.zip

Additional context

Body part statuses with individual coloration:

image

These new status colors are slightly different than the old ones, for several reasons:

  • The old dark blue "bitten" color is hard to read on a black background
  • The old green "infected" color is too good-looking for such a negative effect

New colors include:

  • yellow for "bitten"
  • pink for "infected"
  • light green for "disinfected"
  • white for "bandaged"
  • grey for "splinted"
  • magenta for "broken"

Split from #53874

@github-actions github-actions bot added the astyled astyled PR, label is assigned by github actions label Jan 2, 2022
@wapcaplet wapcaplet added [C++] Changes (can be) made in C++. Previously named `Code` [JSON] Changes (can be) made in JSON Code: Tests Measurement, self-control, statistics, balancing. Info / User Interface Game - player communication, menus, etc. Mechanics: Character / Player Character / Player mechanics labels Jan 2, 2022
@github-actions github-actions bot added the json-styled JSON lint passed, label assigned by github actions label Jan 2, 2022
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jan 2, 2022
@github-actions github-actions bot added BasicBuildPassed This PR builds correctly, label assigned by github actions and removed BasicBuildPassed This PR builds correctly, label assigned by github actions labels Jan 7, 2022
Indicates bitten, bleeding, infected, broken, distinfected, bandaged,
and splinted status by comma-separated list of words, with colorization
by limb_color.

- New display::bodypart_status_colors, returning statuses and colors
- New display::colorized_bodypart_status_text, fully colorized string
- New bp_status_text widget_var - showing bodypart_status_text_color
- New widget declarations in sidebar.json
- Test cases
@wapcaplet wapcaplet marked this pull request as ready for review January 7, 2022 04:09
@kevingranade kevingranade merged commit d746187 into CleverRaven:master Jan 7, 2022
@wapcaplet wapcaplet deleted the w-widgets-bodystat branch January 7, 2022 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing. Info / User Interface Game - player communication, menus, etc. [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions Mechanics: Character / Player Character / Player mechanics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants