Closed SomethingFawful closed 2 months ago
I looked at the provided MRP, and the class RichTextTest
is in a file named NewScript.cs
. This makes the script invalid, the name of the file must match the name of the class. So rename the file to RichTextTest.cs
or the class to NewScript
.
This and some other gotchas are documented in the C# basics documentation page.
For attached scripts, we would normally print an error in the console when trying to instantiate the invalid script. But since this script is not attached or instantiated anywhere, it won't show an error.
This is what I get for being lazy when making my MRP (although that doesn't explain why I could use it when running the project)... which does fix the issue (although now I'm wondering what I did wrong in my main project because I did have the name right there)... we can close this one, although I'll be making a documentation update PR later to add C# working examples.
Tested versions
System information
Godot v4.3.stable.mono - Ubuntu 22.04.4 LTS 22.04 - X11 - Vulkan (Forward+) - dedicated NVIDIA RTX A2000 Laptop GPU - 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz (16 Threads)
Issue description
Creating a Rich text effect by extending the RichTextEffect class, setting the bbcode string and overriding the _ProcesssCustomFX, and the [Tool] and [GlobalClass] annotations does not show up in the drop down in editor, while ones created in GDScript do. Using InstallEffect() in a C# script to add the effect works correctly.
Steps to reproduce
Minimal reproduction project (MRP)
RichTextEffectsBug.zip