foundryvtt-gmScreen icon indicating copy to clipboard operation
foundryvtt-gmScreen copied to clipboard

v11 RollTables fix

Open GSBicalho opened this issue 1 year ago • 0 comments

The current GmScreen almost works as-is on v11. The only issue I found was with RollTables, which don't render properly. This is caused by three things:

  • getData is now async, so it always returns a promise
  • TextEditor.enrichHTML is now async by default, but you can pass it a flag to make it sync
  • CONST.TABLE_RESULT_TYPES no longer has the ENTITY type, but instead a DOCUMENT type

This PR fixes these issues and allows RollTables to be rendered correctly on the GmScreen. Also, the activateListeners of the RollTable must be overriden, as it tries to set attributes of elements that do not exist. It does not stop rendering, but floods the console with error logs.

Let me know if you're fine with having a direct bump to v11 that doesn't work in v10, or if you'd rather have a check that changes the behavior depending on the detected version

GSBicalho avatar Jul 06 '23 18:07 GSBicalho