Cataclysm-DDA icon indicating copy to clipboard operation
Cataclysm-DDA copied to clipboard

Furniture and terrain now shows (some) flag information when examined

Open pjf opened this issue 1 year ago • 1 comments

Summary

Interface "Furniture and terrain now shows (some) flag information when examined"

Purpose of change

It bothered me that I couldn't tell if something could safely contain a fire just by looking at it, so I updated map_data_common_t::extended_description() to show some of the common flags players may be interested in.

Describe the solution

Copying the style used in clothing_flags_description(), but for terrain.

Describe alternatives you've considered

This should all be in JSON, which is clearer, makes it easier to add more flags, and is better in every way.

However this PR has all the strings in C++, because:

  1. I am tired.
  2. I am impatient.
  3. I am secretly hoping someone will object enough to submit their own PR which does the same thing, but better.

Testing

Loaded a current game. Looked at a bunch of furniture. Discovered basement furnances are better than I thought (they vent smoke).

rack

furnace

Additional context

This is not a comprehensive list of flags. I'm just starting with a few to see if there are strong objections/recommendations.

It would likely be faster to loop over the flags on the terrain and use a map to display descriptions, rather than walking through a list of descriptions and checking if the flag exists.

Every time I write C++ I find myself thinking "this can't be best-practice for this", so please feel free to critique/improve upon my style. I will appreciate it.

pjf avatar Aug 09 '22 06:08 pjf

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not 'bump' or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.

stale[bot] avatar Sep 21 '22 03:09 stale[bot]

Closing this for now as life has run away with me and I don't want to leave a stale PR draft around. Blanket blessings to reuse any/all code/ideas/messages for anyone who wants to run with this

pjf avatar Oct 27 '22 23:10 pjf