PDA

View Full Version : Question about Images



Desmodaeus
October 1st, 2011, 20:34
Is there any way to have the image I share with my players close when I close mine? IIRC, this used to be how it worked and it was great, but now it stays open until they close it. Is it possible to get that function back?

Zeus
October 1st, 2011, 22:21
The functionality you describe is already and still supported by FGII's API. The windowinstance method is called close( [closeclients] ) where closeclients is a boolean value. If closeclients is set to true all instances of the window (including clients) will be closed.

So, it depends on what the ruleset has implemented but it is possible for the ruleset devs to add two separate close functions for windows (via radial menu control) Close and Close All.

Desmodaeus
October 1st, 2011, 23:21
Well, this is not the case for me while using the 4E ruleset. Any images I share remain open for the players even if I close them and it is very annoying. Is there a way I can check to see if that is set to "true" where would that be?

Zeus
October 2nd, 2011, 00:25
I just checked the 4E ruleset templates (closebutton and all other variants) in the ruleset file templates_common.xml and the scriptblock for each control is set to:

function onButtonPress()
window.close();
end

So it looks like the template is set to only close the window for the user clicking the close button.

You could modify the template to support a Close All function by changing the onButtonPress() function to test for User input. This way we can detect a Control + Left mouse button click to execute the Close all function. e.g.


function onButtonPress()
if Input.isControlPressed() then
if User.isHost() then
window.close(true);
else
window.close();
end
else
window.close();
end
end

Its a simple enough change that maybe JPG can roll into the next 2.9 release, if not I can always make an extension. ;)

Desmodaeus
October 2nd, 2011, 00:55
Where is that file located where I would need to add in that code? I can't seem to find any file like the one you described. And where would it need to be pasted in? Thanks.

Moon Wizard
October 2nd, 2011, 08:52
Once you share the image with your players, it will have a small circled S symbol next to the image in the Campaign Images list. If you click the circled S symbol, it will unshare the record, so that the players can no longer access on their side, and it will close any windows containing that image.

Cheers,
JPG

Desmodaeus
October 2nd, 2011, 09:35
Thank you, that's good news!