-
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
Add widgets for movement mode, bodypart status, weather, and vehicle #53874
Conversation
973f286
to
01877f7
Compare
I don't understand the point of doubling up on movement mode in the screenshots. If there is a point to showing the movement letter (I fail to see it, but there probably is one), it could be crammed in front of the full name "(R) running", "(W) walking", "(C) crouching", "(P) prone". This format would still use less horizontal space than e.g. "Portal Storm", so there shouldn't be an issue of insufficient room for it. |
The screenshots with both "R" and "running" shown are demonstrating examples of two different widget variables for indicating movement mode, {
"//": "...",
"style": "layout",
"arrange": "rows",
"widgets": [ "move_mode_letter", "move_mode_desc" ]
} Before this PR, the only indicator fo movement mode was the single-letter version (and it was hard-coded into the sidebar locations where it appeared). But because a red "R" by itself is not very informative without context, I added another widget variable to show the full word, which you can add to your own sidebar if you want it. Now, you the player have the option of which version you want to see (or both, or neither), and where in your sidebar you want it to appear. |
0ee98ed
to
e4b92e8
Compare
2ea634b
to
34c7025
Compare
6ba2115
to
feb6e78
Compare
- New move_mode::type_name - full name of mode ("walking", "running") - New display::move_mode_text_color - full name ("walking", "running") - Existing function moved to display::move_mode_letter_color ("W", "R") - New widget_vars: move_mode_letter, move_mode_text - New widget JSON: move_mode_letter, move_mode_desc - Test cases TODO: - Rename "desc" to "text" Return ERROR for invalid movement mode type_name
- New display::weather_text_color - current weather conditions, in color - New weather_text widget_var - showing weather_text_color - New weather_desc widget TODO: - Rename "desc" to "text"
- Add display::vehicle_cruise_text_color TODO: - Merge with widget changes - Add tests
Indicates bitten, bleeding, and/or infected status by comma-separated list of words, with colorization by limb_color. - 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 sidebar.json - Test cases TODO: - Fold limb_color refactor into this - Remove "top" and "bottom" layouts, replace with more useful layout
Calling set_nextweather refreshes current weather, so overridden weather and windspeed can take effect immediately.
Due to tidy warning/error about too-complex function
c1b22dd
to
9f35df1
Compare
This PR is getting pretty chonky. I will probably peel off a few of the major standalone parts as separate PRs for easier review. |
Summary
Features "Add widgets for movement mode, bodypart status, weather, and vehicle"
Purpose of change
To flesh out some important remaining widgets, building on #44683
Describe the solution
Add widget variables, JSON definitions, and supporting functions for:
Add more widget test cases to cover these and existing stuff.
Describe alternatives you've considered
There is no way but forward
Testing
tests/cata_test '[widget]'
Additional context
Some in-progress screenshots of sidebar using the new widgets:
Driving around with plenty of gas:
Reckless acceleration beyond safe speed:
Backing up:
Low on gas:
New bodypart status text/color indicators (with classic color-coded health bars beneath):