#Changes to properties not visible in the inspector

6 messages · Page 1 of 1 (latest)

flint basin
#

I've exported a property on a class that inherits from RefCounted and has the GlobalClass and Tool attributes applied to it. The property appears in the Inspector as expected. I can also edit it and the values are applied. However, when the value is changed from code, I don't see that reflected in the inspector (both at editor-time and when running the game and checking out the RefCounted object from the Remote tab). I've already attempted to force an Inspector refresh by emitting the PropertyListChanged signal whenever the value of the property changes; but no dice. Is there an obvious step I'm missing?

I've attached some code with a screenshot, as well as a screenshot of the running game. I'm constantly updating the Description property to contain the latest delta time in _Process, yet the text box is still empty.

flint basin
#

After looking into this some more, it seems to be an issue with GodotObjects, RefCounteds and Resources that are assigned to a Node at runtime.

#

As shown in the screenshots, HullProperties (a sub-class of ComponentProperties<TSource>) is created at runtime, after which it is initialized using HullSource (a Resource). The properties are intended to serve as the runtime stats of the player, which can be modified by all manner of factors. Whereas HullSource are the base, unaltered stats of the player ship's hull.
HullProperties is a GlobalClass with Exported properties. None of its properties update themselves in the Inspector after changes made to them from code. However, PlayerProperties' Description works fine, when running the scene, the Inspector correctly displays "Test".

#

Is it a bad idea to make anything but Nodes and Resources GlobalClasses?