make numbers in tooltip descriptions pop
This commit is contained in:
parent
5b94564e86
commit
3f0fb053b9
1 changed files with 3 additions and 2 deletions
|
@ -1075,8 +1075,9 @@ function generateTooltip(UI_elem, node_elem, ability, atree_map) {
|
||||||
container.innerHTML += "<br/><br/>";
|
container.innerHTML += "<br/><br/>";
|
||||||
|
|
||||||
// description
|
// description
|
||||||
let description = make_elem("p", ["scaled-font-sm", "my-0", "mx-1", "text-wrap"], {});
|
let description = make_elem("p", ["scaled-font-sm", "my-0", "mx-1", "text-wrap", "mc-gray"], {});
|
||||||
description.innerHTML = ability.desc;
|
let numberRegex = /[+-]?\d+(\.\d+)?[%+s]?/g; // +/- (optional), 1 or more digits, period followed by 1 or more digits (optional), %/+/s (optional)
|
||||||
|
description.innerHTML = ability.desc.replaceAll(numberRegex, (m) => { return "<span class = 'mc-white'>" + m + "</span>" });
|
||||||
container.appendChild(description);
|
container.appendChild(description);
|
||||||
|
|
||||||
container.appendChild(document.createElement("br"));
|
container.appendChild(document.createElement("br"));
|
||||||
|
|
Loading…
Reference in a new issue