Mission Screen Choice Order

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Nemoricus
---- E L I T E ----
---- E L I T E ----
Posts: 388
Joined: Mon May 18, 2009 8:51 pm

Mission Screen Choice Order

Post by Nemoricus »

It seems that in 1.74, choices on the mission screen are now ordered alphabetically based on the key in missiontext.plist rather than how they're ordered in the .plist.

This is rather odd, and quite unexpected. Are there any other OXPs affected by this?
Dream as if you'll live forever
Live as if you'll die tomorrow
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Mission Screen Choice Order

Post by Eric Walch »

Nemoricus wrote:
It seems that in 1.74, choices on the mission screen are now ordered alphabetically based on the key in missiontext.plist rather than how they're ordered in the .plist.
Are you sure that started with 1.74? In my memory it was changed this way long ago. A search in the change log of Oolite 1.71 gave

Code: Select all

* Mission choices are now sorted.
I remember that when not sorting keys, the order was undefined. At least on the mac the display order could change by adding oxp's. By explicit sorting them alphabetical on key, they became fixed in display order.
User avatar
Nemoricus
---- E L I T E ----
---- E L I T E ----
Posts: 388
Joined: Mon May 18, 2009 8:51 pm

Post by Nemoricus »

Given that the missions choices in the missiontext.plist for Galactic Navy are sorted in the order they should appear on the screen, this seems to have been introduced some time between 1.72 and 1.74.

Of course, I could be misremembering things and they were sorted that way back then, too.
Dream as if you'll live forever
Live as if you'll die tomorrow
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

As I said in my response to the bug report, plist dictionaries are unordered. “The order they appear in the plist” is conceptually meaningless. The only way to work around this without writing two new plist parsers would be to allow something like ( { key = "FOO"; label = "Foo"; }, { key = "BAR"; label = "Bar"; } ). I’m not sure this would actually be more helpful.

Prior to the sorting, they could indeed change order if you added or removed OXPs, and on GNUstep systems could even move around randomly if you ran the same mission screen more than once in a session.
User avatar
Nemoricus
---- E L I T E ----
---- E L I T E ----
Posts: 388
Joined: Mon May 18, 2009 8:51 pm

Post by Nemoricus »

Understood.

So, I'll just have to take some time to update the keys for the choices to reflect this.

Thank you.
Dream as if you'll live forever
Live as if you'll die tomorrow
Post Reply