View Issue Details

IDProjectCategoryView StatusLast Update
0002920FSSCPPilot datapublic2014-06-14 09:41
ReporterGoober5000 Assigned Toniffiwan  
PriorityhighSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.7.1 
Target Version3.7.2 
Summary0002920: Pilot file code can't handle localization for intel entries
DescriptionI 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? :)
TagsNo tags attached.

Relationships

related to 0002919 resolvedGoober5000 Tech-add-intel can't handle localization for intel entries 

Activities

niffiwan

2013-09-27 01:57

developer   ~0015294

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.

niffiwan

2014-05-15 08:38

developer   ~0015748

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!

https://github.com/niffiwan/fs2open.github.com/commit/e0377cd7ec454ea7438f5b9819f090d01cc60380

Echelon9

2014-06-14 07:36

developer   ~0015864

Have commented (to the extent I can) on the Github issue.

niffiwan

2014-06-14 09:41

developer   ~0015867

Thanks to Echelon9, MageKing17 & Zacam for their reviews. Added commend explaining the reason for the PLR version bump.

niffiwan

2014-06-14 09:41

developer   ~0015868

Fix committed to trunk@10817.

Related Changesets

fs2open: trunk r10817

2014-06-14 05:59

niffiwan


Ported: N/A

Details Diff
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
barracks.
Also fixes issue with PLR version being ignored in pilotfile::verify()
Affected Issues
0002920
mod - /trunk/fs2_open/code/menuui/playermenu.h Diff File
mod - /trunk/fs2_open/code/playerman/managepilot.cpp Diff File
mod - /trunk/fs2_open/code/playerman/player.h Diff File
mod - /trunk/fs2_open/code/localization/localize.cpp Diff File
mod - /trunk/fs2_open/code/menuui/barracks.cpp Diff File
mod - /trunk/fs2_open/code/menuui/playermenu.cpp Diff File
mod - /trunk/fs2_open/code/pilotfile/pilotfile.h Diff File
mod - /trunk/fs2_open/code/pilotfile/pilotfile_convert.h Diff File
mod - /trunk/fs2_open/code/pilotfile/plr.cpp Diff File
mod - /trunk/fs2_open/code/pilotfile/plr_convert.cpp Diff File

Issue History

Date Modified Username Field Change
2013-09-19 06:41 Goober5000 New Issue
2013-09-19 06:41 Goober5000 Status new => assigned
2013-09-19 06:41 Goober5000 Assigned To => niffiwan
2013-09-19 06:41 Goober5000 Relationship added related to 0002919
2013-09-27 01:57 niffiwan Note Added: 0015294
2014-05-15 08:38 niffiwan Note Added: 0015748
2014-05-15 08:38 niffiwan Status assigned => code review
2014-06-14 07:36 Echelon9 Note Added: 0015864
2014-06-14 09:41 niffiwan Note Added: 0015867
2014-06-14 09:41 niffiwan Changeset attached => fs2open trunk r10817
2014-06-14 09:41 niffiwan Note Added: 0015868
2014-06-14 09:41 niffiwan Status code review => resolved
2014-06-14 09:41 niffiwan Resolution open => fixed