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 a detailed_description to items #8752
Conversation
if (!i.detailed_description.empty()) { | ||
lua_pushstring(L, i.detailed_description.c_str()); | ||
lua_setfield(L, -2, "detailed_description"); | ||
} |
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.
Should do this even if the detailed_description
is empty?
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.
This field should only be set when it isn't empty (like all other text fields, AFAIK). If this field isn't explicitly set, this would be nil
, which is the correct behaviour.
e6e2940
to
a4da5d9
Compare
a4da5d9
to
19852a8
Compare
Rebased. |
I'm tied on this PR. Alternatives I'm wondering whether it's better to do this the opposite way, and have a It's worth noting that mods which show the description probably already only show the first line, if coded well This is a solution that mostly works, but isn't flexible. Problems It's possible that mods only want to show the shorter description on item image buttons etc, which is not allowed. There feature doesn't exist already though, so is irrelevant for this PR |
|
I've decided that having short_description would be a much better idea. I suggest automatically creating this short_description by taking the long description and cutting all but the first line. There is a problem - what to do if description is changed using meta but short_description isn't. I suggest ignoring this case This has the added benefit of not needing to change the description code behind tooltips |
I'll close this for now. |
detailed_description
to the item definition and also the corresponding meta field.detailed_description
is used in favour ofdescription
when the same key is pressed as the one needed for listrings, shift (not sneak).Screenshot
(That mouse is not real.)
To do
This PR is a Ready for Review.
Please read my code comments, too.
How to test
Try the minimal mese pick and use the following chatcommand to test the meta field: