PDA

View Full Version : Bug - windowinstance.close(true) - does not close on clients



jharp
September 10th, 2021, 21:34
I have no reason to think this is a new but (maybe it is, no idea) but I had reason to use windowinstance.close(true) to force windows to close on a client but they never do.

Maybe I'm using it for the wrong purpose but what I wanted was:

Host sets image to public. Host opens the image. Client opens the image. Host hits a new button to close it on the host side with the version closing on the client as well. Should this not work with windowinstance.close(true)?


From the API guide:


close

function close([closeclients])
Closes the window.

Parameters

closeclients (boolean) [optional]
If true and running as the host, the corresponding window will be closed for all clients that have it open as well.

For various reasons I don't want to make the image private to force the close.

Am I wrong somehow or is this a bug. I'm using 2E ruleset but I don't think this is a 2E issue.

Thanks,
Jason

Moon Wizard
September 11th, 2021, 23:18
That API document is not correct; and did not work that way in FGC either. I'm not sure where that came from; but it's been the same way for at least 5 years (if not longer).

windowinstance.close will only close the local copy of the window on a client. (whether GM or player).

EDIT: I also fixed the API documentation page as well.

Regards,
JPG

jharp
September 12th, 2021, 00:31
LOL. Thanks, that explains it.

Jason

jharp
September 13th, 2021, 04:27
Moon,

Are there any api details you can share about the imagedatacontrol?

Thanks,
Jason

Moon Wizard
September 13th, 2021, 15:52
The imagedatacontrol is a completely internally built component meant to be a black box. There is only a single API of setColor that is unique to the imagedatacontrol to allow setting the foreground color for theming.

Regards,
JPG