On 15.10.2012 10:57, Michael T. Pope wrote:
> BR#3577185 exposes a weakness in options processing.  In current games
> the difficulty levels contain the full option group hierarchy:
>
> <freecol-specification difficultyLevel="model.difficulty.medium" id="freecol">
>    ...
>    <optionGroup editable="false" id="difficultyLevels">
>      <optionGroup editable="false" id="model.difficulty.veryEasy">
>        <optionGroup editable="false" id="model.difficulty.immigration">
>          ...flat options...
>        </optionGroup>
>        ...more difficulty levels...
>
> however in older games the difficulty level does not contain optionGroups
> (and also seem to be editable, not sure if this is relevant):
>
> <freecol-specification difficultyLevel="model.difficulty.veryHard" 
> id="freecol">
>    ...
>    <optionGroup editable="true" id="difficultyLevels">
>      <optionGroup editable="true" id="model.difficulty.veryEasy">
>        ...flattened options...
>      </optionGroup>
>      ...more dificulty levels...
>
> This is not a problem until we define another option group.  Which is
> what I just did with the AI-Cheating options.  Whenever we add a new
> option we add fixup hacks in FreeColServer.fixGameOptions, which has
> been done including adding an option group.  This appears to work
> in-game, except for the "Show Difficulty Level" report (shift-F9).
> The hierarchical groups case works as expected but the flattened case
> only displays the new option group.  I believe this to be a quirk of
> the OptionGroupUI code, which (not unreasonably) assumes that the
> option group tree only contains Options/leaves at the bottom level of
> the tree, not at the same level as other OptionGroups.
>
> How best to fix this is unclear to me.  Any thoughts folks?
>
> Cheers,
> Mike Pope
>    

Even if we changed the OptionGroupUI, the result would still look 
strange in the case of older save games, since the cheating options 
would be the only option group in the difficulty level. Of course, in 
future, this might change, if further option groups are added. However, 
I think it would be better to check whether the difficulty levels 
contain further option groups, and to add the new options as a group, or 
singly, depending on the result of this check.

Regards

Michael



------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Freecol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freecol-developers

Reply via email to