What is being locked is the entire 'unevaluated' item (since we are using .selectOne
). Unfortunately, evaluating the tooltip-plugin
instances seems to remove the tooltip function. Which is why most of the time we are using the .evaluateItem
so that only the 'text' and 'evaluated' string is saved, no more randomization, no more perchance syntax, etc, but it doesn't work with the tooltip-plugin
.
Some explanations which might not explain really well.
For the first one:
- You are selecting one item from the
indirecttext
list withindirecttext.selectOne
. - If the item selected is the
[tooltip(...)]
it would lock properly. This is because the item to be saved is just that item. - If the item selected is the
[text.evaluateItem]
. It would save the[text.evaluateItem]
which would then 'evaluate' its text, meaning it would randomize again. Which is why it isn't locking, since what you have locked is[text.evaluateItem]
which resolves into random items from thetext
list. indirecttext.selectOne
-> then[text.evaluateItem]
, is selected, then, is locked. Upon randomizing -> locker gets the locked value, which is[text.evaluateItem]
-> evaluates to any of items in thetext
list -> shows that the item is not locked.
The item locked is only either [text.evaluateItem]
or [tooltip(...)]
, the lock doesn't propagate into its items.
For the second one:
- You are selecting the
[tooltip(...)]
. In which case the whole[tooltip(...)]
is locked. - It re-randomizes since you are re-calling the
[tooltip(...)]
which would re-evaluate it, or create the tooltip again, in which it re-randomizes the{1-5}
that you have to it. [tooltip("...{1-5}", "...")]
-> ... (random number 3) ... -> clicked randomize -> recreates the saved[tooltip(...)]
which means it re-selects the{1-5}
upon display, which results it in not being 'locked' while it is locked.
The item locked is:
[tooltip("this text (random number {1-5})", "This tooltip will not become inaccessible, but the field will not properly lock.")]
However, it doesn't appear locked since the tooltip has a 'randomization' with {1-5}
which are evaluated after.
Maybe the
locker-plugin
might be a better example. It essentially stores the 'locked' value, so whenupdate()
is used, it would only return the 'locked' value.