PDA

View Full Version : custom control on charsheet not sending changes to others



KyleC
June 25th, 2007, 15:25
I have a custom control on my character sheet which does not send changes in realtime to other users looking at the same sheet (i.e. the DM). However, if the DM closes the sheet and the reopens it then the changes are visible. Other controls, such as stringfields, get updated immediately among all viewers, but I'm not sure how to go about getting my control to do the same.

How do I push changes to other viewers?

joshuha
June 25th, 2007, 15:36
This has been brought up during beta and again here https://www.fantasygrounds.com/forums/showthread.php?t=6568 .

Unfortunately the way runtime controls work is the script only executes it on the machine running the code to add the control regardless of when the window is shared.

The reason this happens is when you share a window the client side actually recreates the windowclass (but takes into account an linked DB controls like stringfield) from scratch so the custom controls that have been added from runtime aren't spawned on the client side.

The way to get around this as in the linked thread is to store a state/flag in the DB.xml that the control can read from on the onInit function to know which custom runtimes controls to redraw.

KyleC
June 25th, 2007, 16:26
Thanks for your insight.

The control is working properly now. As I was already storing values in the db, the problem was simply that I did not specify handlers for onUpdate(). I didn't realize that onUpdate would trigger for all instances.

Thanks again!
-Kyle