| 50 | } |
| 51 | |
| 52 | bool EditorDebuggerRemoteObjects::_set_impl(const StringName &p_name, const Variant &p_value, const String &p_field) { |
| 53 | String name = p_name; |
| 54 | if (!prop_values.has(name) || String(name).begins_with("Constants/")) { |
| 55 | return false; |
| 56 | } |
| 57 | |
| 58 | // Change it back to the real name when fetching. |
| 59 | if (name == "Script") { |
| 60 | name = "script"; |
| 61 | } else if (name.begins_with("Metadata/")) { |
| 62 | name = name.replace_first("Metadata/", "metadata/"); |
| 63 | } |
| 64 | |
| 65 | Dictionary &values = prop_values[p_name]; |
| 66 | Dictionary old_values = values.duplicate(); |
| 67 | for (const uint64_t key : values.keys()) { |
| 68 | values.set(key, p_value); |
| 69 | } |
| 70 | |
| 71 | EditorUndoRedoManager *ur = EditorUndoRedoManager::get_singleton(); |
| 72 | const int size = remote_object_ids.size(); |
| 73 | ur->create_action(size == 1 ? vformat(TTR("Set %s"), name) : vformat(TTR("Set %s on %d objects"), name, size), UndoRedo::MERGE_ENDS); |
| 74 | |
| 75 | ur->add_do_method(this, SNAME("emit_signal"), SNAME("values_edited"), name, values, p_field); |
| 76 | ur->add_undo_method(this, SNAME("emit_signal"), SNAME("values_edited"), name, old_values, p_field); |
| 77 | ur->commit_action(); |
| 78 | |
| 79 | return true; |
| 80 | } |
| 81 | |
| 82 | bool EditorDebuggerRemoteObjects::_get(const StringName &p_name, Variant &r_ret) const { |
| 83 | String name = p_name; |
nothing calls this directly
no test coverage detected