1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Change ClassDB::get_class_list and related stuff.

This commit is contained in:
Yufeng Ying
2025-01-08 20:01:55 +08:00
parent 99a39ce6ea
commit a50fc5acd8
23 changed files with 155 additions and 150 deletions

View File

@@ -2158,12 +2158,12 @@ void VisualShaderEditor::_update_nodes() {
// Add GDScript classes.
{
List<StringName> class_list;
ScriptServer::get_global_class_list(&class_list);
LocalVector<StringName> class_list;
ScriptServer::get_global_class_list(class_list);
for (const StringName &E : class_list) {
if (ScriptServer::get_global_class_native_base(E) == "VisualShaderNodeCustom") {
String script_path = ScriptServer::get_global_class_path(E);
for (const StringName &class_name : class_list) {
if (ScriptServer::get_global_class_native_base(class_name) == "VisualShaderNodeCustom") {
String script_path = ScriptServer::get_global_class_path(class_name);
Ref<Resource> res = ResourceLoader::load(script_path);
ERR_CONTINUE(res.is_null());
ERR_CONTINUE(!res->is_class("Script"));
@@ -2188,19 +2188,19 @@ void VisualShaderEditor::_update_nodes() {
// Add GDExtension classes.
{
List<StringName> class_list;
ClassDB::get_class_list(&class_list);
LocalVector<StringName> class_list;
ClassDB::get_class_list(class_list);
for (const StringName &E : class_list) {
if (ClassDB::get_parent_class(E) == "VisualShaderNodeCustom") {
Object *instance = ClassDB::instantiate(E);
for (const StringName &class_name : class_list) {
if (ClassDB::get_parent_class(class_name) == "VisualShaderNodeCustom") {
Object *instance = ClassDB::instantiate(class_name);
Ref<VisualShaderNodeCustom> ref = Object::cast_to<VisualShaderNodeCustom>(instance);
ERR_CONTINUE(ref.is_null());
if (!ref->is_available(visual_shader->get_mode(), get_current_shader_type())) {
continue;
}
Dictionary dict = get_custom_node_data(ref);
dict["type"] = E;
dict["type"] = class_name;
dict["script"] = Ref<Script>();
String key;