|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0002920||FSSCP||Pilot data||public||2013-09-19 02:41||2014-06-14 05:41|
|Target Version||3.7.2||Fixed in Version|
|Summary||0002920: Pilot file code can't handle localization for intel entries|
|Description||I made the same error when coding up tech-add-intel, but the problem created for pilot files is much more complicated.|
The problem is that intel entry names are translatable strings, whereas normally names that serve as lookup keys aren't. This is because if you translate the key, obviously it's not going to be good anymore as a lookup entry.
Since the intel names are always going to be translated, the solution is to also translate the lookup keys so that what you look up is the same as what is in the table. The preloader for tech-add-intel-xstr does this. The pilot file code should handle this the same way.
...Actually, the pilot code may already do this. All it does is save keys that are visible in the tech db, right? So that means it saves translated keys. As long as the pilot doesn't switch languages, it may not be a problem.
What about adding in a safeguard to prevent the pilot from switching languages? :)
|Tags||No tags attached.|
I'm thinking of:
a) storing the pilots language in the .plr
b) when leaving the start screen or the barracks; generate an error if the pilots language doesn't match the current FSO language, and don't let the player proceed
Changing the techroom intel entries to work like ships (i.e. change the lookup keys to an array/vector index) would probably be a fair bit of work. I may have a look just to see how much work anyway.
This seems to do the job in my testing. A pilot created with the language set to German can no longer be selected in the initial selection screen. Nor will the barracks allow this pilot to be selected when exiting the barracks.
Review and comments welcome!
|Have commented (to the extent I can) on the Github issue.|
|Thanks to Echelon9, MageKing17 & Zacam for their reviews. Added commend explaining the reason for the PLR version bump.|
|Fix committed to trunk@10817.|
fs2open: trunk r10817
Timestamp: 2014-06-14 05:59:39
|Fix mantis 2920: prevent pilots switching languages
In other words, a pilot can only be used in the same language it was
created with. Checks both the initial selection screen and in the
Also fixes issue with PLR version being ignored in pilotfile::verify()
|mod - /trunk/fs2_open/code/menuui/playermenu.h|
|mod - /trunk/fs2_open/code/playerman/managepilot.cpp|
|mod - /trunk/fs2_open/code/playerman/player.h|
|mod - /trunk/fs2_open/code/localization/localize.cpp|
|mod - /trunk/fs2_open/code/menuui/barracks.cpp|
|mod - /trunk/fs2_open/code/menuui/playermenu.cpp|
|mod - /trunk/fs2_open/code/pilotfile/pilotfile.h|
|mod - /trunk/fs2_open/code/pilotfile/pilotfile_convert.h|
|mod - /trunk/fs2_open/code/pilotfile/plr.cpp|
|mod - /trunk/fs2_open/code/pilotfile/plr_convert.cpp|
|2013-09-19 02:41||Goober5000||New Issue|
|2013-09-19 02:41||Goober5000||Status||new => assigned|
|2013-09-19 02:41||Goober5000||Assigned To||=> niffiwan|
|2013-09-19 02:41||Goober5000||Relationship added||related to 0002919|
|2013-09-26 21:57||niffiwan||Note Added: 0015294|
|2014-05-15 04:38||niffiwan||Note Added: 0015748|
|2014-05-15 04:38||niffiwan||Status||assigned => code review|
|2014-06-14 03:36||Echelon9||Note Added: 0015864|
|2014-06-14 05:41||niffiwan||Note Added: 0015867|
|2014-06-14 05:41||niffiwan||Changeset attached||=> fs2open trunk r10817|
|2014-06-14 05:41||niffiwan||Note Added: 0015868|
|2014-06-14 05:41||niffiwan||Status||code review => resolved|
|2014-06-14 05:41||niffiwan||Resolution||open => fixed|