This is the testing Godot forums! All forum posts unique to this forum will be deleted! Please use the main forums here for any posts you want to keep. All forum rules still apply.

[Never mind] LineEdit : special characters ?

siskasiska Posts: 36Member
edited January 2020 in GUI

I'm currently working on a 'save game' menu. I'm using a LineEdit node for user input (a short descriptive phrase that will later be shown in the 'load game' menu).

Problem : what if someone types something like this :


The user input is 'escaped' before it is written to file :
save_game_title.json_escape()


The problem is in displaying the text in the load menu screen :

Approach 1 : I don't really care what the user types
---> if I 'unescape' the text before display, it is interpretated (eg. \n becomes a newline character) :
---> if I display 'as is', it is still escaped (of course)

So, is there a way to just -display- the characters (without interpreting them, eg. convert \n into a newline) ?


Approach 2 : Of course, I could also limit input to Latin alphanumeric chars (regex) ... but I prefer not to if I can get the above working.

Any ideas ?

Answers

  • siskasiska Posts: 36Member

    Update : I must have a gremlin in my computer.
    This LineEdit thing has been bugging me for a week, and now, suddenly, without doing anything ... everything works as it should ?! :/

  • cyberealitycybereality Posts: 928Moderator

    Those are the worst kind of bugs. Hope it doesn't come back.

  • MegalomaniakMegalomaniak Posts: 2,580Admin

    If you are following best practices and using version control, you could perhaps check a diff to figure the difference out.

  • cyberealitycybereality Posts: 928Moderator

    Unless it's a heisenbug...

  • siskasiska Posts: 36Member

    =) Let's hope not !

    And yes, I'm using git. But the code just couldn't be simpler.
    Don't know what happened.
    Programming, eh ?!

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.