PDA

View Full Version : reopening softclose window by sharing ?



phantomwhale
November 10th, 2012, 05:28
I have a situation where a player has a window that is marked as softclose, and he closes it.

Then the GM opens up his copy of the window and shares it - but it does not open (become visible) on the player's side ?

So short of manually asking the players nicely to reopen their copy of the window manually, is there any way to programatically get the player's copy of the control to open from the GM's session ?

E.g. I am currently calling Interface.openWindow("class", "datasource").share() but this is not working in this case, presumably as the client never really closed his window, only softclosed it.

phantomwhale
November 10th, 2012, 05:40
Also worth noting I've tried playing with the onShare() method (https://www.fantasygrounds.com/refdoc/windowinstance.xcp#onShare) here, and it never seems to get called ?

Ikael
November 10th, 2012, 10:00
You can always register OOB handler which opens windowclass x with datasourse y on receivers side and as host you send that OOB message to player containing x and y. I did similar in SWFI minitracker closing: window is noclose-tagged and when host closes his main viljat tracker, an OOB is sent to all players requesting automatic closing.

Moon Wizard
November 10th, 2012, 18:59
The onShare event always gets called on the host, and only on the client when the client does the sharing.

I'm going to patch the softclose code to open any window that is minimized (or soft closed). (v2.9.2 beta in the next couple days)

Regards,
JPG

Moon Wizard
November 10th, 2012, 19:59
Updated softclose behavior relative to sharing in v2.9.2 beta.
JPG

phantomwhale
November 11th, 2012, 02:38
Great - thanks JPG. I did end up writing an "unregisterOOBMessageHandler" method (so I could unregister the handlers I needed to) but with this in place, I don't have to use that approach (as I can just keep one copy of the window always loaded, using softclose again).