-
-
Notifications
You must be signed in to change notification settings - Fork 20.8k
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
Add custom icons to script classes. #20560
Conversation
b955bca
to
826b4a9
Compare
Hopefully, we might get an equivalent feature in future, using a class level attribute? Anyway, looks really cool. Great work! |
If you mean with C#, then yes, that should be very doable I would think. The only thing one has to do to make this stuff work is implement a pair of ScriptLanguage methods. Something like...
:-) |
Thats a great news! Usually, more than half of my scenes are generic |
826b4a9
to
25b0f6c
Compare
Needs a rebase, otherwise should be good to merge as per today's PR meeting. |
25b0f6c
to
6d9cc03
Compare
It would be helpful if this was available for c# too. |
@Flavelius when script class support comes for C#, the icons will too. Draft PR is in the works, but I haven't had time to work on it lately. |
Is there any news of this for C#? |
This builds on #20233 by adding custom icon support. It lets you supply a string constant following the class name in order to define a custom icon. It does not support other data types (e.g. singleton.ICON or something). However, I've tested it for running, closing, and re-opening the editor, showing in the CreateDialog, showing in the SceneTreeDock, clearing the script (to revert back to base class icon), and then loading the script from the ScriptCreateDIalog (to bring the custom icon back). All of that is working, so I think it should be good to go. I also added a few custom error reports to the parser.
Edit: Also, the "correct usage" works with both absolute and relative file paths.
Correct Usage:
Bad Filepath:
Bad data type:
CreateDialog Display:
SceneTreeDock Display, after creating the node:
SceneTreeDock Display, after clearing the script:
SceneTreeDock Display, after re-adding the script: