From 0c22447ebe355e6fca81a7041bb6bd5c50ff6ba6 Mon Sep 17 00:00:00 2001 From: Nathan Warden Date: Sat, 2 Dec 2017 21:01:58 -0500 Subject: [PATCH] Exported variables now show in the correct order. --- modules/mono/csharp_script.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index dfa5e720aea..6fbc309fa3f 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -1332,7 +1332,7 @@ bool CSharpScript::_update_exports() { while (top && top != native) { const Vector &fields = top->get_all_fields(); - for (int i = 0; i < fields.size(); i++) { + for (int i = fields.size() - 1; i >= 0; i--) { GDMonoField *field = fields[i]; if (field->is_static()) { @@ -1382,7 +1382,7 @@ bool CSharpScript::_update_exports() { PropertyInfo prop_info = PropertyInfo(type, name, hint, hint_string, PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE); member_info[cname] = prop_info; - exported_members_cache.push_back(prop_info); + exported_members_cache.push_front(prop_info); if (tmp_object) { exported_members_defval_cache[cname] = GDMonoMarshal::mono_object_to_variant(field->get_value(tmp_object));