PDA

View Full Version : Setting mask sensitive visibility



Ken L
June 12th, 2018, 04:32
How can I set mask sensitive visibility to a token element directly through a token-instance? There's only setVisible true/false.

Moon Wizard
June 12th, 2018, 17:07
This function actually takes three values: true, false or nil.
True and false indicate absolute visibility, whereas nil indicates undefined (or mask sensitive visibility).

Regards,
JPG

Ken L
June 12th, 2018, 23:18
Well that was unexpected of a binary value. Thanks moon.

Andraax
June 12th, 2018, 23:30
Well that was unexpected of a binary value. Thanks moon.

Pretty standard for databases. "True", "False", "Undetermined".

Moon Wizard
June 12th, 2018, 23:45
Yeah, some of the APIs use or allow nil, but most of them just imply false, zero or empty string.

The only other one that I can think of that has a unique nil value is for token orientation mode on image controls and token instances.

Regards,
JPG

Ken L
June 13th, 2018, 00:59
Nil normally is discouraged as a value absent of its use for 'false' or 'lack of value'. Using nil for the value of 'mask sensitive' is kind of an interesting design choice. It feels more like a hack to get a third value out by gaming the 'everything is an object reference'.

Either way, it's all in order now, the documentation might need an adjustment to show it accepts a nil value as a valid argument for both set/get.