tiled icon indicating copy to clipboard operation
tiled copied to clipboard

Bug: Chosen enum values are not saved when within a "2 level deep" (?) class.

Open UliAbo opened this issue 2 years ago • 2 comments

Describe the bug Inside the class B there's Class C. And in C there's the enum "Prop_Mobility" used. When I there select the value "2_slidable" from the list (A), then it gets chosen. But as soon as I restart Tiled, then the value has been jumped back to the first value "### Select ENUM value! ###".

image

Note: As you can see I try to make the overal UX easier for a level designer by using lots of prefixes, maybe that's an issue? Like using !, # and * ?

To Reproduce Create nested (?) classes and properties like I did in the screenshot and try to save the chosen values by closing Tiled.

Specifications:

  • OS: Win10 64bit
  • Tiled Version: v1.9

UliAbo avatar Jul 16 '22 15:07 UliAbo

Hmm, I can't reproduce this issue. I created a class B and C and an enum Prop_Mobility, and when I set B.C.Prop_Mobility to another value than the first I saw it was saved and loaded as expected.

Maybe you could export your Custom Types so I can try to reproduce it with the same setup?

bjorn avatar Aug 05 '22 14:08 bjorn

Ok, this is related to the order in which the custom classes are stored. For this to work, currently the nested class needs to be defined first. So if class A has class B as member, the enum (and probably also class) properties of the nested B instance will only get loaded correctly if class B is defined before class A. I'll try to fix this next week.

bjorn avatar Aug 06 '22 16:08 bjorn