Closed git-moss closed 7 years ago
enumSetting = host.getPreferences().getEnumSetting("test", "category", ["one", "two", "three"], "one"); enumSetting.addValueObserver(function(value) { println ("category/test = " + value); });
I added this to a debug script and it fires one initially as expected. If I change the setting in prefs and then restart the script it also fires the new value. So I can't seem to reproduce this...
I've stepped through the code and we seem to notify the observer correctly. I wonder if there is a bug in your code somewhere? Perhaps using string1 == string2 instead of string1.equals(string2)? Haven't ruled out that this is a bug on our side but so far it does not appear to be...
So this turns out that you are calling some things before the init method is called. The Host.getPreferences() should only be called during init(). I'm updating so you get a notification that you did something wrong in this case...
E.g. check with "Display crossfader" setting of P4B script.