-
-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose property info 'usage' in C# Export Attribute #2957
Comments
I'll add this as separate attributes. Like |
@neikeq That works. I think those mirror the proposed GDScript attributes, which would be good. See #2539 (comment) |
Just curious, does adding If Sorry, that was a lot. Just trying to figure out the cleanest way to proceed with my project and still embrace those changes when they come. |
This PR: Add C# resource export could be relevant |
Describe the project you are working on
A platformer with some custom Resources.
Describe the problem or limitation you are having in your project
I have several fields I would like to export without the
storage
usage flag. The Export attribute hashint
andhintString
exposed, but notusage
.Describe the feature / enhancement and how it helps to overcome the problem or limitation
It would be nice to have
usage
as a field, even if it isn't in the constructor. If it were there, I could extend the attribute to make attributes like a[ExportNoStorage]
or[EditorOnly]
or something. The property list aggregation glue could then use theusage
field to build the PropertyInfo dictionaries.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
As stated above, it doen't necessarily need to be added to the constructor. A bare minimum version would be:
As for where this field would be parsed out, looks like the code in question can be found here:
https://github.com/godotengine/godot/blob/4fcc5891450a7dca9c8ebae6ff3765f5f060c442/modules/mono/csharp_script.cpp#L2734-L2769
and would involve grabbing the attributes value, ensuring the usual bits like
PROPERTY_USAGE_SCRIPT_VARIABLE
, then setting it on line 2768.If this enhancement will not be used often, can it be worked around with a few lines of script?
Yes. A workaround is to override the
_GetPropertyList
function and export stuff the long way.Is there a reason why this should be core and not an add-on in the asset library?
It would involve changing the
csharp_script.cpp
core file.The text was updated successfully, but these errors were encountered: