Moerill / token-mold

MIT License
27 stars 33 forks source link

[BUG] Overlays not rendered since Actor5e#data object is no longer used #137

Closed jshank closed 2 years ago

jshank commented 2 years ago

Describe the bug Hovering over an actor with an enabled Overlay does not present configured overlay information

commons.js:1256 Error: You are accessing the Actor5e#data object which is no longer used. Since V10 the Document class and its contained DataModel are merged into a combined data structure. You should now reference keys which were previously contained within the data object directly.
    at logCompatibilityWarning (commons.js:1245:19)
    at Actor5e._logV10CompatibilityWarning (commons.js:6166:14)
    at get data [as data] (commons.js:6066:24)
    at getProperty (commons.js:1707:41)
    at overlay.js:21:53
    at Array.map (<anonymous>)
    at TokenMoldOverlay.getData (overlay.js:17:27)
    at TokenMoldOverlay._render (foundry.js:5014:29)
    at TokenMoldOverlay._render (foundry.js:67787:17)
    at TokenMoldOverlay.render (foundry.js:4973:10)

To Reproduce

  1. Install and enable Token Mold
  2. Go to Actors tab
  3. Go to Stat Overlay
  4. Configure Icon: {any} Attribute: movement.walk [character, npc, vehicle]
  5. Make sure Overlay is checked
  6. Drag a new actor to the screen
  7. Hover over new actor token

Expected behavior Configured overlay data is presented adjacent to the actor token

Module incompatibilities All other modules disabled

Desktop (please complete the following information):

cs96and commented 1 year ago

I'm still having this problem. Looks like the problem is on line 21 of overlay.js. I'm wondering if TokenMoldOverlay.defaultOptions() is not getting called for some reason, which means TokenMoldOverlay.FOUNDRY_VERSION will be stuck on 0.

commons.js:1703 Error: You are accessing the Actor5e#data object which is no longer used. Since V10 the Document class and its contained DataModel are merged into a combined data structure. You should now reference keys which were previously contained within the data object directly.
    at logCompatibilityWarning (commons.js:1692:19)
    at Actor5e._logV10CompatibilityWarning (commons.js:6617:14)
    at get data [as data] (commons.js:6517:24)
    at getProperty (commons.js:2161:41)
    at overlay.js:21:53
    at Array.map (<anonymous>)
    at TokenMoldOverlay.getData (overlay.js:17:27)
    at TokenMoldOverlay._render (foundry.js:5067:29)
    at TokenMoldOverlay._render (foundry.js:68043:17)
    at TokenMoldOverlay.render (foundry.js:5026:10)
    at TokenMoldOverlay.bind (foundry.js:68018:10)
    at Object.fn (token-mold.js:69:30)
    at #call (foundry.js:724:20)
    at Hooks.callAll (foundry.js:681:17)
    at Token5e._onHoverIn (foundry.js:25404:11)
    at Token5e._onHoverIn (foundry.js:46888:18)
    at MouseInteractionManager.callback (foundry.js:27702:45)
    at MouseInteractionManager._handleMouseOver (foundry.js:27819:17)
    at a.emit (index.js:181:35)
    at r.dispatchEvent (interaction.min.mjs:8:12235)
    at r.processInteractive (interaction.min.mjs:8:13101)
    at r.onPointerMove (interaction.min.mjs:8:16687)
cs96and commented 1 year ago

Actually I went into the settings and saw that overlay attributes had been cleared. After setting them, the problem went away.