Skip to content
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

Plugins docs on Dotnet C# EditorInterface to get singleton is wrong and misleading #9626

Open
DamienFremont opened this issue Jul 20, 2024 · 2 comments · May be fixed by #9399
Open

Plugins docs on Dotnet C# EditorInterface to get singleton is wrong and misleading #9626

DamienFremont opened this issue Jul 20, 2024 · 2 comments · May be fixed by #9399

Comments

@DamienFremont
Copy link

DamienFremont commented Jul 20, 2024

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 of EditorInterface.

URL to the documentation page:
https://docs.godotengine.org/en/latest/tutorials/plugins/editor/making_main_screen_plugins.html

Fix + PR:
#9627

Test project
https://github.com/DamienFremont/godot-demo-projects/tree/fix-docs-dotnet-editorinterface-singleton-usage/plugins

Screenshots:

20240720_170834-Zoomit Zoom Window

20240720_170647-Window

20240720_170700-Window

DamienFremont added a commit to DamienFremont/godot-docs that referenced this issue Jul 20, 2024
@DamienFremont DamienFremont changed the title Plugins docs on EditorInterface to get singelton is wrong and misleading area:manual topic:dotnet Plugins docs on Dotnet C# EditorInterface to get singelton is wrong and misleading Jul 20, 2024
@DamienFremont DamienFremont changed the title Plugins docs on Dotnet C# EditorInterface to get singelton is wrong and misleading Plugins docs on Dotnet C# EditorInterface to get singleton is wrong and misleading Jul 20, 2024
@AThousandShips AThousandShips linked a pull request Jul 20, 2024 that will close this issue
@AThousandShips
Copy link
Member

This is not wrong, see #9399 (comment), though it's one of two different ways of doing this, however neither is more or less correct

@GeneralProtectionFault
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants