-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Rework global class hiding in addons #91337
Conversation
This is compat breaking for nested plugins you should go from bottom up as previous PR was doing or else it will check the wrong plugin. |
Well it checks the top-most plugin. If it's inside another plugin, the parent plugin is ignored. Isn't it expected behavior? |
No expected behaviour is that nested plugins are ignored and considered part of the parent plugin. At least this how it is treated right now meaning you can't enable them at all. |
You can, using |
I'm using it when I use another person add-ons and I just add it as a submodule meaning I get everything but I don't care about the plugin in itself and just want some of the global classes. |
But is the plugin nested? Can you show how does your folder structure look? |
Was Test2 originally in Test1, or you put it there as a sub-module like you said? I assume the latter, but not sure why would you do that, other than maybe hiding the plugin from project settings list. |
In general Test2 is a plugin I didn't make myself that I'm adding as submodule so that it does not appear in the list and class from it are added whenever the parent addon is enabled |
Changed to check base folder first, though I think the check is more expensive this way (probably shouldn't matter). |
Thanks! |
This code only looks at the outermost plugin. If that one is enabled then all global classes inside it are shown even if they're inside a disabled nested plugin. My earlier PR (#86325) hides a global class if any plugin in it's path is disabled. Doesn't that make more sense conceptually? If one wants the inner global classes but not the plugin they're in then I would argue they shouldn't be in a disabled plugin. Just delete the plugin.cfg in that case? And if the global classes should be shown even when they're in a disabled plugin (nested), then why not show them even if the outermost one is disabled as well? I.e. either respect the disabled status of plugins fully or not at all. Just a thought, doesn't matter for my usage. |
That's how it was originally implemented, no? See the above discussion. |
True. That still seems like quirky, unintuitive mechanics to me that's better off changed, but I can see the case for not disturbing existing workflows as well. |
I'm not sure what I'm doing wrong, but it seems that a C# Resource class, that is inside a subfolder, still gets hidden. It is only shown on the "New Dialog" window if its placed on the root "addons" folder. I'm on 4.3 RC3 |
I cant get mine to show at all in the new resource dialog. not sure if i am missing some setup, but i am trying to learn c# while creating a simple game, but i need custom nodes and resources. so how can i make them available in the editor dialogs? i am using
|
Fixes #78400
Supersedes #86325
Currently when global class scrip is inside addons folder, the editor will check whether the middle directory is an enabled addon. This is a legacy code; now addons are enabled by their full path to
plugin.cfg
, which can be inside a sub-folder. With this PR it is taken into account by scanning script's parent directories for plugin config. I also added extra check for the config existence - if a script is inside addons subfolder that isn't actually an addon, the class will always be visible. This allows creating custom class addons without making a plugin. CC @Calinou I remember you requested it once.