| 1072 | } |
| 1073 | |
| 1074 | void 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 | |
| 1105 | Ref<Texture2D> EditorData::extension_class_get_icon(const String &p_class) const { |
| 1106 | if (GDExtensionManager::get_singleton()->class_has_icon_path(p_class)) { |
nothing calls this directly
no test coverage detected