@pkowal1982 said:
tool
extends Node2D
export(Dictionary) var dictionary = {"xp": 1, "level": 1} setget set_dictionary
func set_dictionary(d: Dictionary):
for key in d:
dictionary[key] = abs(d[key])
You can do it with the script above. Problem is that Godot 3.4.3 stable has a bug and to see the result of abs() applied to your dictionary entries you'll need to deselect your node, so it's not shown in the inspector and than select it again.
thanks, i'm beginning to see the difficulty with reference types and setgetters mixing. I believe, in my example, the setgetter doesn't trigger because the variable contained in the dictionary is a duplicate of the variable with the setgetter, so it doesn't trigger when changed. unfortunately the same problem means settgetters for dictionaries will only trigger when the dictionary reference itself is changed, and not when it's content(the variables) is changed.
since i can't control how the dictionary will be accessed and modified, due to the nature of the project i'm working on, I think i'll just have to forego this effort to organize the inspector. I just wish the inspector had more functionality to make it look neater when a node with a metric buttload of variables uses it.