MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / set_editor_plugin_states

Method set_editor_plugin_states

editor/editor_data.cpp:339–362  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

337}
338
339void EditorData::set_editor_plugin_states(const Dictionary &p_states) {
340 if (p_states.is_empty()) {
341 for (EditorPlugin *ep : editor_plugins) {
342 ep->clear();
343 }
344 return;
345 }
346
347 for (const KeyValue<Variant, Variant> &kv : p_states) {
348 String name = kv.key;
349 int idx = -1;
350 for (int i = 0; i < editor_plugins.size(); i++) {
351 if (editor_plugins[i]->get_plugin_name() == name) {
352 idx = i;
353 break;
354 }
355 }
356
357 if (idx == -1) {
358 continue;
359 }
360 editor_plugins[idx]->set_state(kv.value);
361 }
362}
363
364void EditorData::notify_edited_scene_changed() {
365 for (int i = 0; i < editor_plugins.size(); i++) {

Calls 5

sizeMethod · 0.65
is_emptyMethod · 0.45
clearMethod · 0.45
get_plugin_nameMethod · 0.45
set_stateMethod · 0.45

Tested by

no test coverage detected