mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 05:51:51 +00:00
added description to item
This commit is contained in:
parent
b4b49ccd83
commit
21364af7a3
4 changed files with 41 additions and 7 deletions
|
|
@ -124,15 +124,23 @@ void SlotView::refreshTooltip(const ItemStack& stack, const ItemDef& item) {
|
|||
}
|
||||
if (itemid) {
|
||||
dv::value* caption = stack.getField("caption");
|
||||
if (caption != nullptr) {
|
||||
tooltip = util::pascal_case(
|
||||
langs::get(util::str2wstr_utf8(caption->asString()))
|
||||
);
|
||||
dv::value* description = stack.getField("description");
|
||||
std::wstring captionText;
|
||||
std::wstring descriptionText;
|
||||
|
||||
if (description != nullptr) {
|
||||
descriptionText = util::pascal_case( langs::get( util::str2wstr_utf8( description->asString() ) ) );
|
||||
} else {
|
||||
tooltip = util::pascal_case(
|
||||
langs::get(util::str2wstr_utf8(item.caption))
|
||||
);
|
||||
descriptionText = util::pascal_case( langs::get( util::str2wstr_utf8( item.description ) ) );
|
||||
}
|
||||
|
||||
if (caption != nullptr) {
|
||||
captionText = util::pascal_case( langs::get( util::str2wstr_utf8( caption->asString() ) ) );
|
||||
} else {
|
||||
captionText = util::pascal_case( langs::get( util::str2wstr_utf8( item.caption ) ) );
|
||||
}
|
||||
|
||||
tooltip = captionText + L"\n" + descriptionText;
|
||||
} else {
|
||||
tooltip.clear();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue