Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property folding state within the element within EditorInspectorArray are linked together (and not indepenent) #78190

Open
coderbloke opened this issue Jun 13, 2023 · 0 comments

Comments

@coderbloke
Copy link

Godot version

v4.0.3.stable.official [5222a99]

System information

Windows 11

Issue description

See screen recording.

When I have grouped properties within the element of an EditorInspectorArray (grouped means, they grouped with 'any_group_name/' in their property name), the folding states of the grouped properties between the array elements, seems to be linked.
When I open/unfold a group in one element, and I move the cursor to the header of the same group in another array element -> That second group's control "thinks", it also opened. Icon changes. (Sorry I cannot recall the C class name for what I call "header" of control. See it on the screen recording.)
Same goes for folding.
Also: When inspector is closed, and reopened, only the last state of the last folded/unfolded group will be applied to all groups.

I observed this with my custom class, but not observed with the built in TileSet resource.
I tried to make array properties following, how TileSet does. But I only checked what it returns with its get_property_info.
One difference surely, that TileSet makes PROPERTY_USAGE_ARRAY with TYPE_NIL, while I am making it with TYPE_INT.
I expected same behavior as with TileSet.
There you can fold unfold the groups within elements, the group's 'header' control isn't doing strange thing + the folding states are recovered, when you close and open the TileSet's inspector.

In the example on the screen recording, in _get_property_list I return:

  • node_count (Nodes) with TYPE_INT and PROPERTY_USAGE_ARRAY, and prefix 'node_'
  • node_X/some_node_property properties for element of the array
    node_X = node_0, node_1, and so on.
    some_node_property = any property name
  • A some_node_property may consist of 2 parts, like 'visuals/title'. I use this to group properties.
    (In the example there is only one property without 'visuals/' prefix, which is the 'function' property)
    So a full property name can be 'node_0/visuals/title'

On the screen recording:

  • I folded the group of second element of array (node_1/visuals/..)
  • I move the cursor on the first element of array (node_0/...) -> The icon of that "Visuals" group changed, "thinking" it's folded
  • I clicked on the group of first element -> Icon changed back to unfolded.
    Then I repeated this with folding/unfolding the same groups again
  • I opened the "Function" property (which is another Resource), where the folding showed the same. That custom resource type also has some properties with an array element grouped by simply using "prefix/" in their property name

Godot_v4 0 3-stable_win64_kEMEQh0qCH

Steps to reproduce

Get project from attached ZIP.
Open res://addons/dataflow_engine/test_dataflow_graph.tres in Inspector
Do what you read/see in issue description.

Minimal reproduction project

Project.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants