don-tnowe / godot-dictionary-inspector

An inspector editor for Dictionaries. But better than the built-in one.
MIT License
79 stars 4 forks source link

C#: dictionaries are displayed in reverse #9

Open ice-ko opened 11 months ago

ice-ko commented 11 months ago

微信截图_20231012173858 The picture above is the export when the plug-in is not enabled.

The picture below is the export when the plug-in is enabled 微信截图_20231012174135

ice-ko commented 11 months ago

When exporting using Dictionary, the order is reversed and is not displayed in the order of enumeration. QQ截图20231012174436

don-tnowe commented 11 months ago

How did you get the dictionary on the last screenshot? Fine for me if I view the same dict with and without the plugin.

ice-ko commented 11 months ago

How did you get the dictionary on the last screenshot? Fine for me if I view the same dict with and without the plugin.

I use c# and initialize the Dictionary with an enumeration in the constructor. Test code has been uploaded TestDemo.zip

don-tnowe commented 11 months ago

Ah, C#. I initially assumed it's because enums/dictionaries are unordered, but research proves GetValues() is ordered by value and it seems you use Godot's dictionaries (no Collections.Generic import).

It is the correct order for you after you disable the plugin? If still not, its an issue with Godot C# or with C# itself.

ice-ko commented 11 months ago

Normal after disabling plug-in

don-tnowe commented 11 months ago

Strange. Would need more investigation.

The enum issue is "fixed", but this one's still under question.

ice-ko commented 11 months ago

That's great, thank you