| 212 | } |
| 213 | |
| 214 | bool FakeScriptInstance::set(const StringName &p_name, const Variant &p_value) { |
| 215 | if (!owner) { |
| 216 | return false; |
| 217 | } |
| 218 | if (is_fake_embedded && script.is_valid() && script->is_instance_recording_properties()) { |
| 219 | MissingResource *mres = Object::cast_to<MissingResource>(owner); |
| 220 | if (mres && mres->is_recording_properties()) { |
| 221 | // let mres handle it |
| 222 | return false; |
| 223 | } |
| 224 | if (!properties.has(p_name)) { |
| 225 | // check if it's a property of the owning object |
| 226 | List<PropertyInfo> owner_properties; |
| 227 | owner->get_property_list(&owner_properties); |
| 228 | for (const PropertyInfo &pi : owner_properties) { |
| 229 | if (pi.name == p_name) { |
| 230 | return false; |
| 231 | } |
| 232 | } |
| 233 | } |
| 234 | properties[p_name] = p_value; |
| 235 | return true; |
| 236 | } // else |
| 237 | if (!has_cached_prop_name(p_name)) { |
| 238 | return false; |
| 239 | } |
| 240 | properties[p_name] = p_value; |
| 241 | return true; |
| 242 | } |
| 243 | |
| 244 | bool FakeScriptInstance::get(const StringName &p_name, Variant &r_ret) const { |
| 245 | if (!properties.has(p_name)) { |
no test coverage detected