-
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
make clause
of widget
to support displaying global_val
#71070
Merged
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
Qrox
reviewed
Jan 19, 2024
github-actions
bot
added
<Enhancement / Feature>
New features, or enhancements on existing
<Documentation>
Design documents, internal info, guides and help.
NPC / Factions
NPCs, AI, Speech, Factions, Ownership
Info / User Interface
Game - player communication, menus, etc.
[C++]
Changes (can be) made in C++. Previously named `Code`
[Markdown]
Markdown issues and PRs
labels
Jan 19, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Auto-requesting reviews from non-collaborators: @wapcaplet
github-actions
bot
added
astyled
astyled PR, label is assigned by github actions
json-styled
JSON lint passed, label assigned by github actions
labels
Jan 19, 2024
Qrox
reviewed
Jan 19, 2024
github-actions
bot
added
the
BasicBuildPassed
This PR builds correctly, label assigned by github actions
label
Jan 19, 2024
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`
<Documentation>
Design documents, internal info, guides and help.
<Enhancement / Feature>
New features, or enhancements on existing
Info / User Interface
Game - player communication, menus, etc.
json-styled
JSON lint passed, label assigned by github actions
[Markdown]
Markdown issues and PRs
NPC / Factions
NPCs, AI, Speech, Factions, Ownership
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 "make
clause
ofwidget
to support displayingglobal_val
and other custom entries"Purpose of change
Allow widgets to display anything you want to display.
If you have a custom variable and you want to display it in a widget, you just need to use the
clause
andset parse_tags
to true.At this point, the values such as <global_val:XXX> in the 'text' will be converted to the corresponding text.
Describe the solution
In widget.cpp, add this to allow to parse tags.
Also, in npctalk.cpp, I modify
parse_tags
function to make it support color tags:Now, it will not remove the color tags automatically.
Describe alternatives you've considered
None.
Testing
I didn't find where to place a ui test, so I place it here.
It seems like this:
https://github.com/CleverRaven/Cataclysm-DDA/assets/81861009/3b53d41b-8541-460e-bbc7-9ed02d4c073e
Additional context