UFO: Alien Invasion Issue Tracker
UFO: Alien Invasion
Go to the previous open issue
Go to the previous issue (open or closed)
star_faded.png
Please log in to bookmark issues
icon_project.png UFO: Alien Invasion / Open Bug report #5106 Textboxes are still too smart...
Go to the next issue (open or closed)
Go to the next open issue
Issue basics
  • Type of issue
    Bug report
  • Category
    User interface
  • Targetted for
    Not determined
  • Status
    Open
  • Priority
    Not determined
User pain
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
Affected by this issue (0)
There are no items
People involved
Times and dates
  • Posted at
  • Last updated
  • Estimated time
    Not estimated
Issue details
  • Resolution
    Not determined
  • Reproducability
    Not determined
  • Severity
    Not determined
  • Complexity
    Not determined
  • Platform
    Not determined
  • Architecture
    Not determined
Attachments (3)
  • /bugs/files/show/162
    Screenshot-3-msgid.png uploaded Sep 01, 2013 by unknown user
  • /bugs/files/show/161
    Screenshot-2-translation-french.png uploaded Sep 01, 2013 by unknown user
  • /bugs/files/show/160
    Screenshot-1-missing-underscore.png uploaded Sep 01, 2013 by unknown user
Duplicate issues (0)
This issue does not have any duplicates
Description
Ten months ago, UFO:AI would crash when an underscore was the first character typed into any textbox. It was because text typed into a textbox was being passed to function CL_Translate on every keystroke, in combination with some buffer overflows and/or off-by-one errors. CL_Translate performs text translation and conversion of message ids to plain text.

Most of the issues were worked around in these patches and a few others:
https://github.com/ufoai/ufoai/compare/4c582613df5a...061523ffefb6

However, there remain some more issues, although the game probably won't crash because of them. Attached are some screenshots of the Employees screen.

'''Screenshot 1''': Leading underscores seem to get truncated, but it's really because of gettext lookup.

'''Screenshot 2''': Text with leading underscores CAN still get translated. This should only occur if a particularly short string is being translated by the game, or a user has a peculiar taste in names. In this screenshot, the text has been translated into French.

'''Screenshot 3''': Message IDs can get converted to text. Note how the multi-line text spills over into the area below the textbox. Admittedly, this can't be anything but deliberate, and anybody who does this deserves what they get.

(At one point, I thought that names that converted to text that was too long couldn't be changed, but they can. The cursor just isn't visible at first. Hit the backspace key to make the key invalid, and the cursor will reappear.)

I would suggest that editable textboxes not perform translation / conversion on their contents. The only time it should occur is when the textboxes are initialized with canned text. For example, the initial suggestion for the starting base's name is "Home" in English and "Base Principale" in French.
If this were done, a lone underscore could be considered a proper name again by the function Com_IsValidName, if desired.
Steps to reproduce this issue
Start a game. Go to any editable textbox -- first base name, employee name, already-created base name.

a) Type "_asdf" (without quotes). Hit enter. Note how the underscore disappears as more text is typed. If the entered text is displayed anywhere that's not a textbox (e.g. geoscape, soldier chooser), it will show the underscore.

b) Delete the text. Note that once the "asdf" is deleted, the underscore reappears. But hitting enter with just the underscore reverts the name, as it is not considered a proper name by the game (function Com_IsValidName).

c) Change the language to something other than English. Delete the text and type "_No pre research info available" (without quotes). Notice how the text displayed changes as the last character is typed. But deleting a character or typing another one undoes the change.

d) Delete the text and type "*msgid:medikit_txt" without quotes. Notice how the text displayed changes as the last character is typed. But deleting a character or typing another one undoes the change.
Todos (0 / 0)
Issue created
footer_logo.png The Bug Genie 4.3.1 | Support | Feedback spinning_16.gif