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

Add More Secret Capabilities to LineEdit #10033

Open
iiMidknightii opened this issue Jun 24, 2024 · 0 comments
Open

Add More Secret Capabilities to LineEdit #10033

iiMidknightii opened this issue Jun 24, 2024 · 0 comments

Comments

@iiMidknightii
Copy link

iiMidknightii commented Jun 24, 2024

Describe the project you are working on

A multiplayer game where I want passwords, IP address input, etc. to be hidden during input using a line edit.

Describe the problem or limitation you are having in your project

As it is implemented right now, all characters input into LineEdit are replaced with the secret_character, and there aren't many QOL settings to make it easier on the user to input information.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

I suggest a couple of additions to make it more tweak-able:

  1. Allow showing the last input character without replacing it with the secret_character. This would allow someone to see if they typo'd while they input. This might be controversial, and is my least favorite feature to add.
  2. Add a property for a secret_show_shortcut. If a Shortcut(s) is added to this property, when the appropriate shortcut context has focus, pressing that shortcut will temporarily show the raw text.
  3. Alternatively to above, could add a boolean property to show a button on the right side to toggle viewing the raw text. This would probably also need an icon added to the theme type. It could also be combined with option 2 above to press the toggle via Shortcut.
  4. Allow excluding characters from the secret replacement. For example, in my game I'd like to allow the user to join a multiplayer match using the host's IP address, but that could be dicey if on a livestream. I want to use the secret setting to block out the IP, but I think it would be good for usability's sake to keep the . in the IP address so the user can keep track of them. I'd suggest adding something like secret_excluded_characters, and any characters inside that string would not be replaced with the actual secret_character.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

  1. Add a property called secret_show_last_character. Input fields would look more like this image.
  2. Add a property called secret_show_shortcut. When pressed, the visual text in the LineEdit is temporarily replaced with the raw text. This could either be done in a "press-and-hold" or "press-to-toggle" pattern.
  3. image
  4. image if "." is added to a new property called secret_excluded_characters.

If this enhancement will not be used often, can it be worked around with a few lines of script?

I think the shortcut to toggle visibility can be added using script. The ability to exclude characters from the secret replacement would be really cumbersome to set up via scripting. As for the button, I guess that could be done by adding a Button manually using code, but again it would be a bit cumbersome to get everything lined up, and internally it would be pretty easy to share the same logic from the clear input button.

Is there a reason why this should be core and not an add-on in the asset library?

This is about improving the usability of LineEdit out of the box in situations where secret information needs to be input.

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

2 participants