1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-10 13:00:37 +00:00

Mono/C#: Fix values not updated in remote inspector

This commit is contained in:
Ignacio Etcheverry
2020-05-22 00:58:34 +02:00
parent 9239412027
commit 51e1614d28
2 changed files with 47 additions and 17 deletions

View File

@@ -2419,8 +2419,10 @@ bool CSharpScript::_update_exports() {
StringName member_name = field->get_name(); StringName member_name = field->get_name();
member_info[member_name] = prop_info; member_info[member_name] = prop_info;
if (exported) {
#ifdef TOOLS_ENABLED #ifdef TOOLS_ENABLED
if (is_editor && exported) { if (is_editor) {
exported_members_cache.push_front(prop_info); exported_members_cache.push_front(prop_info);
if (tmp_object) { if (tmp_object) {
@@ -2428,6 +2430,11 @@ bool CSharpScript::_update_exports() {
} }
} }
#endif #endif
#if defined(TOOLS_ENABLED) || defined(DEBUG_ENABLED)
exported_members_names.insert(member_name);
#endif
}
} }
} }
@@ -2440,8 +2447,10 @@ bool CSharpScript::_update_exports() {
StringName member_name = property->get_name(); StringName member_name = property->get_name();
member_info[member_name] = prop_info; member_info[member_name] = prop_info;
if (exported) {
#ifdef TOOLS_ENABLED #ifdef TOOLS_ENABLED
if (is_editor && exported) { if (is_editor) {
exported_members_cache.push_front(prop_info); exported_members_cache.push_front(prop_info);
if (tmp_object) { if (tmp_object) {
MonoException *exc = nullptr; MonoException *exc = nullptr;
@@ -2455,6 +2464,11 @@ bool CSharpScript::_update_exports() {
} }
} }
#endif #endif
#if defined(TOOLS_ENABLED) || defined(DEBUG_ENABLED)
exported_members_names.insert(member_name);
#endif
}
} }
} }
@@ -3591,6 +3605,16 @@ CSharpScript::~CSharpScript() {
#endif #endif
} }
void CSharpScript::get_members(Set<StringName> *p_members) {
#if defined(TOOLS_ENABLED) || defined(DEBUG_ENABLED)
if (p_members) {
for (Set<StringName>::Element *E = exported_members_names.front(); E; E = E->next()) {
p_members->insert(E->get());
}
}
#endif
}
/*************** RESOURCE ***************/ /*************** RESOURCE ***************/
RES ResourceFormatLoaderCSharpScript::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress, bool p_no_cache) { RES ResourceFormatLoaderCSharpScript::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress, bool p_no_cache) {

View File

@@ -138,6 +138,10 @@ private:
virtual void _placeholder_erased(PlaceHolderScriptInstance *p_placeholder); virtual void _placeholder_erased(PlaceHolderScriptInstance *p_placeholder);
#endif #endif
#if defined(TOOLS_ENABLED) || defined(DEBUG_ENABLED)
Set<StringName> exported_members_names;
#endif
Map<StringName, PropertyInfo> member_info; Map<StringName, PropertyInfo> member_info;
void _clear(); void _clear();
@@ -191,6 +195,8 @@ public:
virtual void get_script_property_list(List<PropertyInfo> *p_list) const; virtual void get_script_property_list(List<PropertyInfo> *p_list) const;
virtual void update_exports(); virtual void update_exports();
void get_members(Set<StringName> *p_members) override;
virtual bool is_tool() const { return tool; } virtual bool is_tool() const { return tool; }
virtual bool is_valid() const { return valid; } virtual bool is_valid() const { return valid; }