Open DamienFremont opened 1 month ago
This is not wrong, see https://github.com/godotengine/godot-docs/pull/9399#issuecomment-2119334224, though it's one of two different ways of doing this, however neither is more or less correct
I ran into this and came to see if there was an issue, and there was =D. @AThousandShips What is it that's not wrong, though? This isn't about which way to implement, it's about the documentation, right?
The C# code example on the referenced documentation is wrong--outright won't build. I'm assuming the proposal is simply replace this:
public override Texture2D _GetPluginIcon() { return EditorInterface.GetEditorTheme().GetIcon("Node", "EditorIcons"); }
...with this:
public override Texture2D _GetPluginIcon() { return EditorInterface.Singleton.GetEditorTheme().GetIcon("Node", "EditorIcons"); }
It's in two spots on the docs page.
Your Godot version: 4.3, 4.2
Issue description:
Compile error using C# on godot-demo-projects:plugins:main_screen https://github.com/DamienFremont/godot-demo-projects/tree/master/plugins/addons/main_screen
Plugin script should be using
EditorInterface.singleton.
instead ofEditorInterface.
URL to the documentation page: https://docs.godotengine.org/en/latest/tutorials/plugins/editor/making_main_screen_plugins.html
Fix + PR: https://github.com/godotengine/godot-docs/pull/9627
Test project https://github.com/DamienFremont/godot-demo-projects/tree/fix-docs-dotnet-editorinterface-singleton-usage/plugins
Screenshots: