Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
0bbbcc1d
Unverified
Commit
0bbbcc1d
authored
May 22, 2020
by
Rémi Verschelde
Committed by
GitHub
May 22, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #38940 from neikeq/issue-33896
Mono/C#: Fix values not updated in remote inspector
parents
36a0fe68
51e1614d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
16 deletions
+46
-16
csharp_script.cpp
modules/mono/csharp_script.cpp
+40
-16
csharp_script.h
modules/mono/csharp_script.h
+6
-0
No files found.
modules/mono/csharp_script.cpp
View file @
0bbbcc1d
...
...
@@ -2419,15 +2419,22 @@ bool CSharpScript::_update_exports() {
StringName
member_name
=
field
->
get_name
();
member_info
[
member_name
]
=
prop_info
;
if
(
exported
)
{
#ifdef TOOLS_ENABLED
if
(
is_editor
&&
exported
)
{
exported_members_cache
.
push_front
(
prop_info
);
if
(
is_editor
)
{
exported_members_cache
.
push_front
(
prop_info
);
if
(
tmp_object
)
{
exported_members_defval_cache
[
member_name
]
=
GDMonoMarshal
::
mono_object_to_variant
(
field
->
get_value
(
tmp_object
));
if
(
tmp_object
)
{
exported_members_defval_cache
[
member_name
]
=
GDMonoMarshal
::
mono_object_to_variant
(
field
->
get_value
(
tmp_object
));
}
}
}
#endif
#if defined(TOOLS_ENABLED) || defined(DEBUG_ENABLED)
exported_members_names
.
insert
(
member_name
);
#endif
}
}
}
...
...
@@ -2440,21 +2447,28 @@ bool CSharpScript::_update_exports() {
StringName
member_name
=
property
->
get_name
();
member_info
[
member_name
]
=
prop_info
;
if
(
exported
)
{
#ifdef TOOLS_ENABLED
if
(
is_editor
&&
exported
)
{
exported_members_cache
.
push_front
(
prop_info
);
if
(
tmp_object
)
{
MonoException
*
exc
=
nullptr
;
MonoObject
*
ret
=
property
->
get_value
(
tmp_object
,
&
exc
);
if
(
exc
)
{
exported_members_defval_cache
[
member_name
]
=
Variant
();
GDMonoUtils
::
debug_print_unhandled_exception
(
exc
);
}
else
{
exported_members_defval_cache
[
member_name
]
=
GDMonoMarshal
::
mono_object_to_variant
(
ret
);
if
(
is_editor
)
{
exported_members_cache
.
push_front
(
prop_info
);
if
(
tmp_object
)
{
MonoException
*
exc
=
nullptr
;
MonoObject
*
ret
=
property
->
get_value
(
tmp_object
,
&
exc
);
if
(
exc
)
{
exported_members_defval_cache
[
member_name
]
=
Variant
();
GDMonoUtils
::
debug_print_unhandled_exception
(
exc
);
}
else
{
exported_members_defval_cache
[
member_name
]
=
GDMonoMarshal
::
mono_object_to_variant
(
ret
);
}
}
}
}
#endif
#if defined(TOOLS_ENABLED) || defined(DEBUG_ENABLED)
exported_members_names
.
insert
(
member_name
);
#endif
}
}
}
...
...
@@ -3591,6 +3605,16 @@ CSharpScript::~CSharpScript() {
#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 ***************/
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
)
{
...
...
modules/mono/csharp_script.h
View file @
0bbbcc1d
...
...
@@ -138,6 +138,10 @@ private:
virtual
void
_placeholder_erased
(
PlaceHolderScriptInstance
*
p_placeholder
);
#endif
#if defined(TOOLS_ENABLED) || defined(DEBUG_ENABLED)
Set
<
StringName
>
exported_members_names
;
#endif
Map
<
StringName
,
PropertyInfo
>
member_info
;
void
_clear
();
...
...
@@ -191,6 +195,8 @@ public:
virtual
void
get_script_property_list
(
List
<
PropertyInfo
>
*
p_list
)
const
;
virtual
void
update_exports
();
void
get_members
(
Set
<
StringName
>
*
p_members
)
override
;
virtual
bool
is_tool
()
const
{
return
tool
;
}
virtual
bool
is_valid
()
const
{
return
valid
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment