bmarian / token-tooltip-alt

A module that adds a tooltip next to the currently hovered token to show some useful information for players and DMs.
MIT License
9 stars 15 forks source link

[BUG] Custom icon fonts no longer consistently work #58

Closed BoltsJ closed 3 years ago

BoltsJ commented 3 years ago

Describe the bug In older versions, different webfonts could be used by specifying multiple classes to the icon.

To Reproduce Steps to reproduce the behavior:

  1. On the LANCER system (which provides google's material design icons)
  2. Create a tooltip using mdi mdi-arrow-right-bold-hexagon-outline as the icon specifier
  3. No icon will be displayed

Screenshots On the old version: image

On the latest: image

If applicable, add screenshots to help explain your problem.

Please complete the following information:

An export of your tooltip settings Please provide an export of your settings, found by going into the Tooltip manger and clicking Export.

{"gmSettings":{"default":{"items":[{"disposition":"FRIENDLY","items":[{"value":"mech.evasion","icon":"cci-evasion","expression":false,"isNumber":false,"color":"#eeeeee"},{"value":"mech.edef","icon":"cci-edef","expression":false,"isNumber":false,"color":"#eeeeee"},{"value":"mech.structure","icon":"cci-structure","expression":false,"isNumber":false,"color":"#eeeeee"},{"value":"mech.stress","icon":"cci-reactor","expression":false,"isNumber":false,"color":"#eeeeee"},{"value":"mech.armor","icon":"mdi mdi-shield-outline","expression":false,"isNumber":false,"color":"#eeeeee"},{"value":"mech.speed","icon":"mdi mdi-arrow-right-bold-hexagon-outline","expression":false,"isNumber":false,"color":"#eeeeee"},{"value":"mech.sensors","icon":"cci-sensor","expression":false,"isNumber":false,"color":"#eeeeee"},{"value":"mech.save","icon":"cci-save","expression":false,"isNumber":false,"color":"#eeeeee"}]},{"disposition":"NEUTRAL","items":[{"value":"mech.evasion","icon":"cci-evasion","expression":false,"isNumber":false,"color":"#eeeeee"},{"value":"mech.edef","icon":"cci-edef","expression":false,"isNumber":false,"color":"#eeeeee"},{"value":"mech.structure","icon":"cci-structure","expression":false,"isNumber":false,"color":"#eeeeee"},{"value":"mech.stress","icon":"cci-reactor","expression":false,"isNumber":false,"color":"#eeeeee"},{"value":"mech.armor","icon":"mdi mdi-shield-outline","expression":false,"isNumber":false,"color":"#eeeeee"},{"value":"mech.speed","icon":"mdi mdi-arrow-right-bold-hexagon-outline","expression":false,"isNumber":false,"color":"#eeeeee"},{"value":"mech.sensors","icon":"cci-sensor","expression":false,"isNumber":false,"color":"#eeeeee"},{"value":"mech.save","icon":"cci-save","expression":false,"isNumber":false,"color":"#eeeeee"}]},{"disposition":"HOSTILE","items":[{"value":"mech.evasion","icon":"cci-evasion","expression":false,"isNumber":false,"color":"#eeeeee"},{"value":"mech.edef","icon":"cci-edef","expression":false,"isNumber":false,"color":"#eeeeee"},{"value":"mech.structure","icon":"cci-structure","expression":false,"isNumber":false,"color":"#eeeeee"},{"value":"mech.stress","icon":"cci-reactor","expression":false,"isNumber":false,"color":"#eeeeee"},{"value":"mech.armor","icon":"mdi mdi-shield-outline","expression":false,"isNumber":false,"color":"#eeeeee"},{"value":"mech.speed","icon":"mdi mdi-arrow-right-bold-hexagon-outline","expression":false,"isNumber":false,"color":"#eeeeee"},{"value":"mech.sensors","icon":"cci-sensor","expression":false,"isNumber":false,"color":"#eeeeee"},{"value":"mech.save","icon":"cci-save","expression":false,"isNumber":false,"color":"#eeeeee"}]}],"static":{"displayNameInTooltip":true,"useAccentEverywhere":false,"accentColor":"#242424","tokenDispositions":["FRIENDLY","NEUTRAL","HOSTILE"],"useAccentColorForEverything":false}},"pilot":{"items":[{"disposition":"FRIENDLY","items":[]},{"disposition":"NEUTRAL","items":[]},{"disposition":"HOSTILE","items":[]}],"static":{"displayNameInTooltip":true,"accentColor":"#12406c","useAccentColorForEverything":false,"tokenDispositions":["FRIENDLY","NEUTRAL","HOSTILE"]}},"npc":{"items":[{"disposition":"FRIENDLY","items":[{"value":"mech.evasion","icon":"","expression":true,"isNumber":true,"color":"#b4b64a"}]},{"disposition":"NEUTRAL","items":[{"value":"mech.evasion","icon":"","expression":true,"isNumber":true,"color":"#b4b64a"}]},{"disposition":"HOSTILE","items":[{"value":"mech.evasion","icon":"","expression":true,"isNumber":true,"color":"#b4b64a"}]}],"static":{"displayNameInTooltip":true,"useAccentEverywhere":false,"accentColor":"#cbe581","tokenDispositions":["FRIENDLY","NEUTRAL","HOSTILE"],"useAccentColorForEverything":false}},"deployable":{"items":[{"disposition":"FRIENDLY","items":[]},{"disposition":"NEUTRAL","items":[]},{"disposition":"HOSTILE","items":[]}],"static":{"displayNameInTooltip":true,"accentColor":"#9fd4da","useAccentColorForEverything":false,"tokenDispositions":["FRIENDLY","NEUTRAL","HOSTILE"]}}},"playerSettings":{"default":{"items":[{"disposition":"OWNED","items":[]},{"disposition":"FRIENDLY","items":[{"value":"mech.evasion","icon":"cci-evasion","expression":false,"isNumber":false,"color":"#eeeeee"},{"value":"mech.edef","icon":"cci-edef","expression":false,"isNumber":false,"color":"#eeeeee"},{"value":"mech.structure","icon":"cci-structure","expression":false,"isNumber":false,"color":"#eeeeee"},{"value":"mech.stress","icon":"cci-reactor","expression":false,"isNumber":false,"color":"#eeeeee"},{"value":"mech.armor","icon":"mdi mdi-shield-outline","expression":false,"isNumber":false,"color":"#eeeeee"},{"value":"mech.speed","icon":"mdi mdi-arrow-right-bold-hexagon-outline","expression":false,"isNumber":false,"color":"#eeeeee"},{"value":"mech.sensors","icon":"cci-sensor","expression":false,"isNumber":false,"color":"#b31514"},{"value":"mech.save","icon":"cci-save","expression":false,"isNumber":false,"color":"#369453"}]},{"disposition":"NEUTRAL","items":[]},{"disposition":"HOSTILE","items":[]}],"static":{"displayNameInTooltip":"FRIENDLY","useAccentEverywhere":false,"accentColor":"#242424","tokenDispositions":["OWNED","FRIENDLY","NEUTRAL","HOSTILE"],"useAccentColorForEverything":false}},"pilot":{"items":[{"disposition":"OWNED","items":[]},{"disposition":"FRIENDLY","items":[]},{"disposition":"NEUTRAL","items":[]},{"disposition":"HOSTILE","items":[]}],"static":{"displayNameInTooltip":"FRIENDLY","accentColor":"#2b55e1","useAccentColorForEverything":false,"tokenDispositions":["OWNED","FRIENDLY","NEUTRAL","HOSTILE"]}},"npc":{"items":[{"disposition":"OWNED","items":[]},{"disposition":"FRIENDLY","items":[]},{"disposition":"NEUTRAL","items":[]},{"disposition":"HOSTILE","items":[]}],"static":{"displayNameInTooltip":"FRIENDLY","useAccentEverywhere":false,"accentColor":"#433288","tokenDispositions":["OWNED","FRIENDLY","NEUTRAL","HOSTILE"],"useAccentColorForEverything":false}},"deployable":{"items":[{"disposition":"OWNED","items":[]},{"disposition":"FRIENDLY","items":[]},{"disposition":"NEUTRAL","items":[]},{"disposition":"HOSTILE","items":[]}],"static":{"displayNameInTooltip":"FRIENDLY","accentColor":"#6c5319","useAccentColorForEverything":false,"tokenDispositions":["OWNED","FRIENDLY","NEUTRAL","HOSTILE"]}}}}
bmarian commented 3 years ago

Yap. This is expected. I never took into consideration that other systems would add icon packs. My bad here. Because it has multiple words with spaces between them the regex considers that a path to an icon...

I'm fixing it tomorrow.

bmarian commented 3 years ago

If You have a game today and need things to work and you are comfortable making changes in the files, you can go into the modules folder token-tooltip-alt/module/Tooltip.js

And change

return {icon, iconType: icon ? this._reg.faIcon.test(icon.trim()) : true, iconSize: this._fontSize};

to

return {icon, iconType: true, iconSize: this._fontSize};

You would not be able to use urls/paths but the icons should display nicely for now.

bmarian commented 3 years ago

The issue should be fixed now 😄

BoltsJ commented 3 years ago

Just checked and it is indeed working. Thank you so much!