mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-13 06:51:51 +00:00
add '@' prefix support to tooltips
This commit is contained in:
parent
9286f297c1
commit
fa990e3939
1 changed files with 7 additions and 1 deletions
|
|
@ -158,7 +158,13 @@ static void read_uinode(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (element.has("tooltip")) {
|
if (element.has("tooltip")) {
|
||||||
node.setTooltip(util::str2wstr_utf8(element.attr("tooltip").getText()));
|
auto tooltip = util::str2wstr_utf8(element.attr("tooltip").getText());
|
||||||
|
if (!tooltip.empty() && tooltip[0] == '@') {
|
||||||
|
tooltip = langs::get(
|
||||||
|
tooltip.substr(1), util::str2wstr_utf8(reader.getContext())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
node.setTooltip(tooltip);
|
||||||
}
|
}
|
||||||
if (element.has("tooltip-delay")) {
|
if (element.has("tooltip-delay")) {
|
||||||
node.setTooltipDelay(element.attr("tooltip-delay").asFloat());
|
node.setTooltipDelay(element.attr("tooltip-delay").asFloat());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue