You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a frame (or dialog or overlay) needs to reflect the current application state (e.g., current selection, etc), it's a bit painful to accomplish. The onChangeSelection event and similar won't notify the frame itself of the changes. Instead they invoke another macro that is then responsible for reacting to the change, which could involve pushing data to the frame or reloading the frame.
The Solution you'd like
When an onChangeSelection, onChangeImpersonated, onChangeToken, onChangeMap, or onInitiativeChange event is emitted (I think that's all of them), it is also sent as a JavaScript event to any open HTML frame, dialog, or overlay. The event would contain any pertinent details (e.g., selected token ID, current map ID, etc).
It would then be possible to react to such an event in JavaScript, e.g.:
window.addEventListener("onChangeSelection",event=>{/* Handle it here. */});
Alternatives that you've considered.
None.
Additional Context
No response
The text was updated successfully, but these errors were encountered:
I have a framework where I follow this pattern, but have to translate the events myself into JS events. It basically just uses runJSFunction() to inject code like this:
Describe the Problem
If a frame (or dialog or overlay) needs to reflect the current application state (e.g., current selection, etc), it's a bit painful to accomplish. The
onChangeSelection
event and similar won't notify the frame itself of the changes. Instead they invoke another macro that is then responsible for reacting to the change, which could involve pushing data to the frame or reloading the frame.The Solution you'd like
When an
onChangeSelection
,onChangeImpersonated
,onChangeToken
,onChangeMap
, oronInitiativeChange
event is emitted (I think that's all of them), it is also sent as a JavaScript event to any open HTML frame, dialog, or overlay. The event would contain any pertinent details (e.g., selected token ID, current map ID, etc).It would then be possible to react to such an event in JavaScript, e.g.:
Alternatives that you've considered.
None.
Additional Context
No response
The text was updated successfully, but these errors were encountered: