Setting a tooltip, works one way, not another...
For this requirement I need to be able to add a CR\r (return) in the text so it looks something like this.
Code:
NPC: do something there.
PC: do something here.
So I thought I could just set the string value to this.
Code:
<string name="cta_hptotal_tooltip"">NPC: Double click to adjust base HP.\rPC: Open Combat details section to adjust.</string>
And then just assign it as normal. <tooltip textres="cta_hptotal_tooltip" />.
But all that did was set the tooltip to the literal value and showed the "\r" instead of added the return/CR. I knew I'd done this (programmatically for another situation) before so I dug around and found it and manually set it this way.
Code:
function onInit()
local aHPTotalTip = {};
table.insert(aHPTotalTip, Interface.getString("cta_hptotal_npc_tooltip"));
table.insert(aHPTotalTip, Interface.getString("cta_hptotal_pc_tooltip"));
setTooltipText(table.concat(aHPTotalTip, "\r"));
end
I split the string into _npc and _pc values then used table concat and it works.
https://i.imgur.com/Ouu2y3o.png
This seems like odd behavior. Is there some translation going on for \r in the concat im missing?