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

Trying to "get_plugin_name" triggers an error #25795

Open
henriiquecampos opened this issue Feb 11, 2019 · 6 comments
Open

Trying to "get_plugin_name" triggers an error #25795

henriiquecampos opened this issue Feb 11, 2019 · 6 comments

Comments

@henriiquecampos
Copy link
Contributor

Godot version: 3.1.beta3.official

OS/device including version: Solus 3.9999

Issue description:

image

In the documentation there is a method EditorPlugin.get_plugin_name() -> String but trying to call said method returns:

image

Invalid call. Nonexistent function 'get_plugin_name' in base 'EditorPlugin (plugin.gd)'

Steps to reproduce:

  • Create an EditorPlugin
  • In the plugin script call get_plugin_name

Minimal reproduction project:

@vnen
Copy link
Member

vnen commented Feb 11, 2019

It's a virtual method, it means you have to implement it in the script.

@henriiquecampos
Copy link
Contributor Author

Ohh, my bad, sorry.

But isn't that weird? I think this method should always return the String with the plugin's folder name, no?

@Zylann
Copy link
Contributor

Zylann commented Feb 11, 2019

That's quite confusing... how can get_plugin_name be expected to have a script implementation when you need that same name even before activating the plugin, to show it in the list? It's even one of the fields in plugin.cfg, surely Godot knows that name without requiring to write it again in code?

@henriiquecampos
Copy link
Contributor Author

Yeah I really don't see a reason for it to be virtual. What would be the use case for a script implementation, i.e. override, of this method?

@Overblob
Copy link
Contributor

I know a use case: when you want your plugin to be added with the "main editors" ie:
image
the return of get_plugin_name is used to display a custom name into the ToolButton.
I don't know if there's another one.

@Zylann
Copy link
Contributor

Zylann commented Feb 16, 2019

@Overblob if that's the case, it adds to the inconsistency in the way things are named^^" (also that means a plugin cannot have two main screens which sounds quite an arbitrary design decision, hard to guess that from the API)

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

No branches or pull requests

5 participants