-
-
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
Control.LayoutMode
enum needs to be exposed for the layout_mode
property
#87374
Comments
I don't want to see the warning messages, and I need to know where you have hidden its enumeration? |
It seems like we forgot to bind the |
Control.LayoutMode
enum needs to be exposed for the layout_mode
property
No, we have not. You are not supposed to use these properties and these enums from scripting. They are internal. |
Users keep trying to use those internal properties though, so I think we need to ask ourselves "why". Just telling them they're not supposed to use them doesn't seem sufficient.
I thought this was an oversight because the also internal |
The problem here is that the property is exposed with It was exposed, but the intention was likely to prevent this exposure |
If this enumeration is not suitable for public disclosure, then there shouldn't be any warning messages. I always prefer my programs to be cleaner. I have spent an entire afternoon dealing with and searching for an answer to this warning message. |
It has an enum type because it's still stored, the proper solution is to not expose it at all as it is internal and doesn't work as a property, it only works when loading a scene in the editor |
Personally, I was in favor of removing the |
Then how should I deal with the layout issue? This belongs to the category where if not set, the layout becomes disorganized.
|
It's internal and undocumented so not covered by compatibility, it's not part of the public API, except by how it is in the editor interface, and that can be changed too if it's not too disruptive |
@geekros see the linked issue above for the topic of how this works and doesn't work This property doesn't work and you need to handle these things in other ways, mainly with anchors |
This can be correctly laid out, but a warning message will appear in the debugger:
I don't want to see warning messages! |
@geekros It's not enumerations which aren't supposed to be public. It's the properties themselves. There is no use in setting them or using them in any way from scripting. They are only hints for the editor and the inspector dock. They were created as properties because there was no other way to influence the flow of the inspector, but they have no meaning for you as a user when writing scripts. You can just set the anchors to anything you want. PS. Also instead of |
The property doesn't actually work except in the position mode, it's just for the editor: Lines 889 to 906 in 7827c8e
|
@akien-mga Yes, they do keep finding them and try to use them. I know, I reply to every issue related to that 🙁 This issue permanently occupies my mind at this point.
I cannot speak for every internal property. The reality is, the internal hint is barely implemented, and we didn't really use it consistently in the past. The only logic associated with the internal hint that was ever implemented is hiding them from the docs. That's it. However, this was the only way for me to implement the inspector flow that we designed. There is just no other way to influence the inspector to add a widget at an arbitrary place without creating a property. At least no straightforward way. So this is how I've implemented it, hoping we can resolve all the missing parts of internal properties. But in reality, these have no purpose existing as properties. They were never meant to be properties. They have no logic associated with them which would be useful to users as properties. They are only hints for the inspector and they don't limit the API usage in any way. They only limit the look of the inspector.
That's a good question. They are not documented, but they do come up in auto-completion. They also have a tooltip just like any other property in the inspector, which suggests you can use them by their name. This last part can be easily fixed though.
As mentioned above, we don't want to prevent people using them. We just don't really want to expose them as properties, that was not the intention of them. And they have no practical use. You can set and get all layout properties at any time regardless of
It's the other way around, The main issue is we cannot hide them from scripting at this point. It's a convoluted task, we discussed it a lot with core team members. Basically, we still need those properties to be settable and gettable, just not from scripting. Which is hard to implement, because how would you differentiate the two cases when both of them go through the same We could still improve the inspector tooltip. And we could still adjust the code completion tools to hide them. It would probably not help C# users, though. So the best solution at this point is for me to hack the inspector in a way that would remove the need to have properties. I don't know how yet. |
I switched methods and used rectangles and position positioning to solve it, the warning messages are gone, thank you for your help.
|
I'll tell you why, as a new user, I chose to use For beginners, it's challenging to distinguish which properties are meant for GDScript or the Inspector, as they are all presented together. Now, can I assume that when I hover the mouse over a property and the documentation tooltip shows "No description available," that property or configuration should not be used in GDScript? |
No, you shouldn't assume that. We don't have 100% documentation completion, so a missing description can just be that, a missing description. But I think I can fix the tooltip and make sure that for internal properties we show a special message. |
Mm-hmm, doing so would be more user-friendly. Thank you for your efforts; my problem has been solved. Next, when setting properties, I will first check whether the attribute is included in the documentation. If it's not, I won't consider using it. |
Resolved by #87381. |
Tested versions
v4.2.1.stable.official [b09f793]
System information
Window 11 v4.2.1.stable.official [b09f793]
Issue description
When using item_label.layout_mode = 1, a warning message appears:
but I can't find the corresponding available enumeration, such as LAYOUT_MODE_POSITION.
Steps to reproduce
Minimal reproduction project (MRP)
The text was updated successfully, but these errors were encountered: