How can I be notified when a variable is set? In any of the languages. (Preferably Harlowe, but if I have to switch language I could)
I dug into the Harlowe code, and found that VarRef contains exactly what I want, because there's a hook that lets you do like:
VarRef.on('set', (obj, name, value) => {
if (obj === State.variables) {
// You know that variable $name has just been set to $value
}
})
But I can't find a way to get access to this VarRef object. Any ideas?
Thanks
I dug into the Harlowe code, and found that VarRef contains exactly what I want, because there's a hook that lets you do like:
VarRef.on('set', (obj, name, value) => {
if (obj === State.variables) {
// You know that variable $name has just been set to $value
}
})
But I can't find a way to get access to this VarRef object. Any ideas?
Thanks