You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Level editor, but this goes for any project that needs the user input through Text/LineEdit to be more restricted
Describe the problem or limitation you are having in your project
Right now there is no property in the text editing control nodes that restricts the user from typing certain characters.
I need that because in my level editor you can add enemy pools that will determine what enemies can be spawned in the level using a TextEdit, and I want the user to not be able to type in the space character, since the pools are separated by "," (example "BIG_ENEMY,SMALL_ENEMY", but I can't do that currently - not without some more extra coding (see the workaround at the end of the issue)
Describe the feature / enhancement and how it helps to overcome the problem or limitation
The restricted_characters property for Text/LineEdit would be able to easily restrict the user from typing the space character on my enemy pools TextEdit
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
The restricted_characters would be a PackedStringArray, with each element being a character (if you were to add something more than one character to an element it would give a node warning and it just wouldn't count that element when restricting the characters). The user then wouldn't be able to add any of the characters in that list to the Text/LineEdit.
If this enhancement will not be used often, can it be worked around with a few lines of script?
Describe the project you are working on
Level editor, but this goes for any project that needs the user input through Text/LineEdit to be more restricted
Describe the problem or limitation you are having in your project
Right now there is no property in the text editing control nodes that restricts the user from typing certain characters.
I need that because in my level editor you can add enemy pools that will determine what enemies can be spawned in the level using a TextEdit, and I want the user to not be able to type in the space character, since the pools are separated by "," (example "BIG_ENEMY,SMALL_ENEMY", but I can't do that currently - not without some more extra coding (see the workaround at the end of the issue)
Describe the feature / enhancement and how it helps to overcome the problem or limitation
The
restricted_characters
property for Text/LineEdit would be able to easily restrict the user from typing the space character on my enemy pools TextEditDescribe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
The
restricted_characters
would be a PackedStringArray, with each element being a character (if you were to add something more than one character to an element it would give a node warning and it just wouldn't count that element when restricting the characters). The user then wouldn't be able to add any of the characters in that list to the Text/LineEdit.If this enhancement will not be used often, can it be worked around with a few lines of script?
It can be worked around, as seen in this forum post https://forum.godotengine.org/t/how-to-make-a-restriction-on-the-characters-entered-on-lineedit/25965/2
but it's going to take some lines of code, so a simple property to stop that would be good to have.
Is there a reason why this should be core and not an add-on in the asset library?
Text/LineEdit are core
The text was updated successfully, but these errors were encountered: