summaryrefslogtreecommitdiffstats
path: root/editor/property_selector.cpp
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2022-02-08 16:06:57 +0100
committerkobewi <kobewi4e@gmail.com>2022-02-08 16:06:57 +0100
commitfb1fa2a3f74a0b5ff2562829a73c9b1b91a80706 (patch)
treece03911149c4fc2330dccf6907281e6132493ec2 /editor/property_selector.cpp
parent2a39a1c2217a1d31826cd68f03cfdd8a0be769f0 (diff)
downloadredot-engine-fb1fa2a3f74a0b5ff2562829a73c9b1b91a80706.tar.gz
Reload built-in scripts when picking methods
Diffstat (limited to 'editor/property_selector.cpp')
-rw-r--r--editor/property_selector.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/editor/property_selector.cpp b/editor/property_selector.cpp
index 406bcbe342..0862efb4ee 100644
--- a/editor/property_selector.cpp
+++ b/editor/property_selector.cpp
@@ -214,10 +214,13 @@ void PropertySelector::_update_search() {
Variant::construct(type, v, nullptr, 0, ce);
v.get_method_list(&methods);
} else {
- Object *obj = ObjectDB::get_instance(script);
- if (Object::cast_to<Script>(obj)) {
+ Ref<Script> script_ref = Object::cast_to<Script>(ObjectDB::get_instance(script));
+ if (script_ref.is_valid()) {
methods.push_back(MethodInfo("*Script Methods"));
- Object::cast_to<Script>(obj)->get_script_method_list(&methods);
+ if (script_ref->is_built_in()) {
+ script_ref->reload(true);
+ }
+ script_ref->get_script_method_list(&methods);
}
StringName base = base_type;