PDA

View Full Version : Cycle image on sheet depending on selections?



VenomousFiligree
January 13th, 2012, 15:01
I'm after some coding assistance. :)

I have a windowlist that has checkboxes associated with the entries. How would I go about having an image on the PC sheet change depending on the number of checkboxes selected?

Thanks in advance.

Zeus
January 13th, 2012, 19:08
It will depend on the ruleset you are using and the implementation of the checkbox control. Can you post up some code from the window classes your using.

Also, is the image on the PC sheet a regular image control, tokencontrol or icon?

In 4E, the 'checkbox' template control inherits the icon cycler template. The 'checkbox' control implements the getState() and setState(varState) methods for determining if a checkbox is checked and setting the state of the checkbox. However when instantiated as a windowcontrol, you could implement an onValueChanged() method within the control's script block to update the main window image.

VenomousFiligree
January 13th, 2012, 22:07
Thanks DrZ.

I was trying with onValueChanged() but it wasn't working. I changed window.getDatabaseNode to window.windowlist.getDatabaseNode and it's looking good :)

What would be good, would be if I understood why that worked... :D