Gleed2D icon indicating copy to clipboard operation
Gleed2D copied to clipboard

CustomProperty LinkedItem breaks after re-loading a level

Open AlexDiede opened this issue 13 years ago • 1 comments

Steps to recreate issue: 0) Create a level with two rectangle shapes in them (just use default names)

  1. Add a custom property to 'Rectangle_1' of type 'Linked item' with any name
  2. Choose 'Rectangle_2' for the value of the custom property you just created
  3. Save the level
  4. Restart Gleed2D
  5. Load the level you just saved
  6. Click on 'Rectangle_1'
  7. Click on the dropdown box for the custom property (as if you were going to edit the value)
  8. An error will pop up saying, "Unable to cast object of type 'System.String' to type 'Gleed2D.InGame.LinkedItem'."

If you save the level after doing these steps the custom property's value will be changed from 'Rectangle_2' to '$null$'.

I dug around in the code and tracked the cast that fails to line 24 of LinkedItemUiTypeEditor.cs in Gleed2D.Core.CustomUITypeEditors.

AlexDiede avatar Sep 04 '12 19:09 AlexDiede

Thanks for reporting the issue. I'll take a look and let you know.

SteveDunn avatar Sep 20 '12 19:09 SteveDunn