-
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 description widgets for pain, thirst, fatigue, weight, hunger and more #50945
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
actual-nh
added
<Enhancement / Feature>
New features, or enhancements on existing
[C++]
Changes (can be) made in C++. Previously named `Code`
Code: Infrastructure / Style / Static Analysis
Code internal infrastructure and style
Info / User Interface
Game - player communication, menus, etc.
Mechanics: Character / Player
Character / Player mechanics
labels
Aug 21, 2021
I have a somewhat more urgent refactoring to remove about 200 lines of |
wapcaplet
force-pushed
the
w-desc-widgets
branch
2 times, most recently
from
August 28, 2021 00:11
0fa18c8
to
b350598
Compare
wapcaplet
changed the title
Add description widgets for pain, thirst, fatigue, weight, hunger
Add description widgets for pain, thirst, fatigue, weight, hunger and more
Aug 28, 2021
Add several `xx_text` widget variables associated with "text color functions", which are functions in the panels.h `display` namespace returning a (text, color) pair for the description strings of the pain, hunger, thirst, fatigue, and weight attributes.
Add phrase widgets which may be added to custom sidebar layouts or to the root layout widget.
The word "phrase" is a little awkward; "text" fits better conceptually with "number" and "graph". Include comments on the intention of text functions vs normal widgets.
Gives cleaner-looking results, especially when value is empty
Also add a weariness_text_color wrapper accepting a Character reference, to simplify usage, and provide a pair( std::string, nc_color ) response like its kin.
For showing wielded weapon and martial arts style
wapcaplet
force-pushed
the
w-desc-widgets
branch
from
August 28, 2021 19:06
4748790
to
8ddc7b9
Compare
9 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[C++]
Changes (can be) made in C++. Previously named `Code`
Code: Infrastructure / Style / Static Analysis
Code internal infrastructure and style
<Enhancement / Feature>
New features, or enhancements on existing
Info / User Interface
Game - player communication, menus, etc.
Mechanics: Character / Player
Character / Player mechanics
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Features "Add description widgets for pain, thirst, fatigue, weight, hunger"
Purpose of change
Make the custom sidebar more capable of displaying useful information.
Describe the solution
Build on #44683 adding new "var" (
widget_var
) values:hunger_text
showingdisplay::hunger_text_color
thirst_text
showingdisplay::thirst_text_color
pain_text
showingdisplay::pain_text_color
fatigue_text
showingdisplay::fatigue_text_color
weight_text
showingdisplay::weight_text_color
weariness_text
showingdisplay::weariness_text_color
wielding_text
showingavatar.weapname
style_text
showingavatar.martial_arts_data->selected_style_name
date_text
showingcalendar::name_season
andday_of_season
place_text
showing avatar location from overmap bufferget_name
Add some notes to
doc/SIDEBAR_MOD.md
for using "text" style variables, with a few examples.Depends on #50972
Describe alternatives you've considered
Would still like to add a few test cases and some documentation on these. May also include
weariness_description
.Testing
Playing game with widgets added to custom sidebar, values and colors match original sidebar displays.
Additional context
Below is a sample of how the widgets are displayed, if they are simply added to the root layout in
data/json/ui/sidebar.json
, ex.:Wide layout:
Narrow layout: