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
27ada5c1
Commit
27ada5c1
authored
May 03, 2020
by
Eric M
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stopped trying to revert to default values when script implementation of property_can_revert exists
parent
f5cd33f3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
12 deletions
+14
-12
editor_inspector.cpp
editor/editor_inspector.cpp
+14
-12
No files found.
editor/editor_inspector.cpp
View file @
27ada5c1
...
...
@@ -501,18 +501,20 @@ bool EditorPropertyRevert::can_property_revert(Object *p_object, const StringNam
}
}
if
(
p_object
->
call
(
"property_can_revert"
,
p_property
).
operator
bool
())
{
has_revert
=
true
;
}
if
(
!
has_revert
&&
!
p_object
->
get_script
().
is_null
())
{
Ref
<
Script
>
scr
=
p_object
->
get_script
();
if
(
scr
.
is_valid
())
{
Variant
orig_value
;
if
(
scr
->
get_property_default_value
(
p_property
,
orig_value
))
{
if
(
orig_value
!=
p_object
->
get
(
p_property
))
{
has_revert
=
true
;
// If the object implements property_can_revert, rely on that completely
// (i.e. don't then try to revert to default value - the property_get_revert implementation
// can do that if so desired)
if
(
p_object
->
has_method
(
"property_can_revert"
))
{
has_revert
=
p_object
->
call
(
"property_can_revert"
,
p_property
).
operator
bool
();
}
else
{
if
(
!
has_revert
&&
!
p_object
->
get_script
().
is_null
())
{
Ref
<
Script
>
scr
=
p_object
->
get_script
();
if
(
scr
.
is_valid
())
{
Variant
orig_value
;
if
(
scr
->
get_property_default_value
(
p_property
,
orig_value
))
{
if
(
orig_value
!=
p_object
->
get
(
p_property
))
{
has_revert
=
true
;
}
}
}
}
...
...
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