diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-01-10 18:02:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-10 18:02:57 +0100 |
commit | 658296856c3bd132df1844febca2ea4732ef4f43 (patch) | |
tree | 02d74024d3f85c41086990050f9220a3d4568119 /core/script_language.h | |
parent | 9eb93356086a67b84a79e3dbce9d53141f3df2a2 (diff) | |
parent | ea85ff0dc2a04e695d396f62ce5949f4e04254e4 (diff) |
Merge pull request #24877 from neikeq/issue-24280
Fix properties being lost when reloading placeholder GDScript instance
Diffstat (limited to 'core/script_language.h')
-rw-r--r-- | core/script_language.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/core/script_language.h b/core/script_language.h index b35e9987ea..b0f12dc291 100644 --- a/core/script_language.h +++ b/core/script_language.h @@ -146,6 +146,8 @@ public: virtual void get_constants(Map<StringName, Variant> *p_constants) {} virtual void get_members(Set<StringName> *p_constants) {} + virtual bool is_placeholder_fallback_enabled() const { return false; } + Script() {} }; @@ -334,8 +336,6 @@ class PlaceHolderScriptInstance : public ScriptInstance { ScriptLanguage *language; Ref<Script> script; - bool build_failed; - public: virtual bool set(const StringName &p_name, const Variant &p_value); virtual bool get(const StringName &p_name, Variant &r_ret) const; @@ -361,13 +361,10 @@ public: void update(const List<PropertyInfo> &p_properties, const Map<StringName, Variant> &p_values); //likely changed in editor - void set_build_failed(bool p_build_failed) { build_failed = p_build_failed; } - bool get_build_failed() const { return build_failed; } - virtual bool is_placeholder() const { return true; } - virtual void property_set_fallback(const StringName &p_name, const Variant &p_value, bool *r_valid); - virtual Variant property_get_fallback(const StringName &p_name, bool *r_valid); + virtual void property_set_fallback(const StringName &p_name, const Variant &p_value, bool *r_valid = NULL); + virtual Variant property_get_fallback(const StringName &p_name, bool *r_valid = NULL); virtual MultiplayerAPI::RPCMode get_rpc_mode(const StringName &p_method) const { return MultiplayerAPI::RPC_MODE_DISABLED; } virtual MultiplayerAPI::RPCMode get_rset_mode(const StringName &p_variable) const { return MultiplayerAPI::RPC_MODE_DISABLED; } |