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

Method script_class_load_icon_paths

editor/editor_data.cpp:1074–1103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1072}
1073
1074void EditorData::script_class_load_icon_paths() {
1075 script_class_clear_icon_paths();
1076
1077#ifndef DISABLE_DEPRECATED
1078 if (ProjectSettings::get_singleton()->has_setting("_global_script_class_icons")) {
1079 Dictionary d = GLOBAL_GET("_global_script_class_icons");
1080
1081 for (const KeyValue<Variant, Variant> &kv : d) {
1082 String name = kv.key.operator String();
1083 _script_class_icon_paths[name] = kv.value;
1084
1085 String path = ScriptServer::get_global_class_path(name);
1086 script_class_set_name(path, name);
1087 }
1088 ProjectSettings::get_singleton()->clear("_global_script_class_icons");
1089 }
1090#endif
1091
1092 Array script_classes = ProjectSettings::get_singleton()->get_global_class_list();
1093 for (int i = 0; i < script_classes.size(); i++) {
1094 Dictionary d = script_classes[i];
1095 if (!d.has("class") || !d.has("path") || !d.has("icon")) {
1096 continue;
1097 }
1098
1099 String name = d["class"];
1100 _script_class_icon_paths[name] = d["icon"];
1101 script_class_set_name(d["path"], name);
1102 }
1103}
1104
1105Ref<Texture2D> EditorData::extension_class_get_icon(const String &p_class) const {
1106 if (GDExtensionManager::get_singleton()->class_has_icon_path(p_class)) {

Callers

nothing calls this directly

Calls 6

sizeMethod · 0.65
has_settingMethod · 0.45
StringMethod · 0.45
clearMethod · 0.45
get_global_class_listMethod · 0.45
hasMethod · 0.45

Tested by

no test coverage detected