mapeditor/tiled

Bug: Deleting a property value inside a class doesn't reset it back to its default. #3409

UliAbo posted onGitHub

Describe the bug See GIF below. The default value is "UnexploredArea" (all in grey font color). But when I delete the entry the whole class content is gone. I then need to switch to another class ("!Layer_WholeMapSettings") and then back to the class I want ("!Layer_Meta") to get it to work.

To Reproduce TE_Bug_ResetClasses

Expected behavior When I select the entry and hit delete like in my GIF above, I expext the value to be resetted to its original default value ("UnexploredArea") in grey font color.

// Maybe I have used the wrong terms in the title and descriptions, just let me know and I correct it.

Specifications:

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

They're called Properties. The issue is that deleting a property inherited from a class deletes the property instead of resetting its value.

I was able to reproduce this. Deleting Object and Tile properties that are inherited from classes works like it used to and restores the default value, but on Layers, Maps, Terrain Sets, Terrains, and Tilesets, i.e. everything that has newly received support for classes/types in 1.9, it completely deletes the property. This affects Undoing the setting of the property too, not just deleting with the "-" button or with Del.

posted by eishiya almost 3 years ago

Okay, thanks for clarifying and testing, @eishiya !

posted by UliAbo almost 3 years ago

A similar problem occurs when I rename a class or when I change it's assigned class connections (Tile, Object, Layer, etc.). This doesn't get updated until I restart Tiled.

posted by UliAbo almost 3 years ago

Also another (I guess related issue) is this: When I have already placed some instances of an Object on the Map and when I then change the property values within a class by changing it in the Custom Types Editor, then it doesn't get updated correctly (I mean the bold formatting.

An example: Before the value of "OpState_Context" was everywhere on false. I have set it in the Tileset to true, like you can see it at B. This is all correct. At B it gets formatted bold because it deviates from the class value.

But when I then set it to true in the Custom Types Editor (A), then of course the instanced Objects should not change as they are instanced. But I guess the formatting should change to become non-bold anymore, because the chosen setting of the Instance is now in perfect line with the custom Class setting? Or am I wrong? image

posted by UliAbo almost 3 years ago

Another observation, also related to updates I think: When I collapse a class of a selected Object / Tile anywhere (e.g. in Map or Tileset), then it's unfolded immediately when I deselect and select it again. Is this on purpose? If yes, then at least for myself collapsing has only a very limited benefit. Why should I collapse something when I'm "within" an Object, maybe only when I have very long lists and then don't want to scroll?

image

I would prefer that the collapsed status is saved for each Class. Even accross classes, I mean when I collapse something in a class, it should be collapsed in all instances everywhere. For me collapsing has the purpose of hiding things until I explicitly want it to see. As you can see we are using classes extensively and therefore it would be a good benefit.

posted by UliAbo almost 3 years ago

And one other issue related to non-updating changes. Please see my screenshot: I have the property AgentID in a class and in the class and also in the instanced Object the value is blank, which is fine. The formatting of the word "AgentID" is also slim like it should be. But once I enter a value and then later remove the value by selecting the field and hitting delete or backspace, then the field is blank again, but the formatting of the word "AgentID" is still bold. image

It's a small detail, but very irritating for the level designer role.

posted by UliAbo almost 3 years ago

At B it gets formatted bold because it deviates from the class value.

But when I then set it to true in the Custom Types Editor (A), then of course the instanced Objects should not change as they are instanced. But I guess the formatting should change to become non-bold anymore, because the chosen setting of the Instance is now in perfect line with the custom Class setting? Or am I wrong?

@UliAbo Indeed this is a misunderstanding of the bold text. It's bold because the value is overridden, not because it is different from the default. The override stays, even if the default is changed to be the same value.

posted by bjorn over 2 years ago

But once I enter a value and then later remove the value by selecting the field and hitting delete or backspace, then the field is blank again, but the formatting of the word "AgentID" is still bold.

This is because simply clearing the value will also keep the empty string as override of the default. If you actually want to clear the override, you need to use the "Reset" button on the right:

image

I'll try to get the Delete button to also trigger this reset functionality, but currently it doesn't.

posted by bjorn over 2 years ago

Hmm, okay I see the reset buttons only for non-string values. But why is there not a reset-buttons for string values? :)

image

posted by UliAbo over 2 years ago

But why is there not a reset-buttons for string values? :)

It's a good question, probably a bug. :-S

posted by bjorn over 2 years ago

@UliAbo Alright, the ability to reset string properties has been fixed for the next patch release. :-)

posted by bjorn over 2 years ago

Fund this Issue

$0.00
Funded

Pull requests