| 794 | } |
| 795 | |
| 796 | void PlaceHolderScriptInstance::update(const List<PropertyInfo> &p_properties, const HashMap<StringName, Variant> &p_values) { |
| 797 | HashSet<StringName> new_values; |
| 798 | for (const PropertyInfo &E : p_properties) { |
| 799 | if (E.usage & (PROPERTY_USAGE_GROUP | PROPERTY_USAGE_SUBGROUP | PROPERTY_USAGE_CATEGORY)) { |
| 800 | continue; |
| 801 | } |
| 802 | |
| 803 | StringName n = E.name; |
| 804 | new_values.insert(n); |
| 805 | |
| 806 | if (!values.has(n) || (E.type != Variant::NIL && values[n].get_type() != E.type)) { |
| 807 | if (p_values.has(n)) { |
| 808 | values[n] = p_values[n]; |
| 809 | } |
| 810 | } |
| 811 | } |
| 812 | |
| 813 | properties = p_properties; |
| 814 | List<StringName> to_remove; |
| 815 | |
| 816 | for (KeyValue<StringName, Variant> &E : values) { |
| 817 | if (!new_values.has(E.key)) { |
| 818 | to_remove.push_back(E.key); |
| 819 | } |
| 820 | |
| 821 | Variant defval; |
| 822 | if (script->get_property_default_value(E.key, defval)) { |
| 823 | //remove because it's the same as the default value |
| 824 | if (defval == E.value) { |
| 825 | to_remove.push_back(E.key); |
| 826 | } |
| 827 | } |
| 828 | } |
| 829 | |
| 830 | while (to_remove.size()) { |
| 831 | values.erase(to_remove.front()->get()); |
| 832 | to_remove.pop_front(); |
| 833 | } |
| 834 | |
| 835 | if (owner && owner->get_script_instance() == this) { |
| 836 | owner->notify_property_list_changed(); |
| 837 | } |
| 838 | //change notify |
| 839 | |
| 840 | constants.clear(); |
| 841 | script->get_constants(&constants); |
| 842 | } |
| 843 | |
| 844 | void PlaceHolderScriptInstance::property_set_fallback(const StringName &p_name, const Variant &p_value, bool *r_valid) { |
| 845 | if (script->is_placeholder_fallback_enabled()) { |
nothing calls this directly
no test coverage detected