Add support for custom resource types#2
Add support for custom resource types#2toasterofbread wants to merge 4 commits intonobuyukinyuu:masterfrom
Conversation
|
This is neat, and I should probably look into supporting custom resource types by class name and inspecting the script, but is there any reason why it should do pattern matching for a filename? Considering that this check is done before checking the resource's |
Forgot you could access source code from script resources, added that! Now it checks if the script is GDScript, then parses the source until it finds class_name and gets the name from that lie. Still uses the file name if no class_name is found or if the script isn't GDScript. |
|
Searching for a
Before potentially accepting the PR, I have to consider whether the specificity offered by this new feature should override the native class name or not. I can see the benefit to caching the resource type so this whole parsing function isn't repeated on future accesses, but I'm still not sure on the overall performance impact. |
Adds support for custom resource types by checking if the object has a script, then comparing the script filename to the type name stored in settings.
Example:
The type of a resource using the script
res://src/SaveFile.gdwould beSaveFile