Persist some campaign creation options.

We should also persist mod options, but those will go in a separate file
because they aren't a part of Settings.

Plugins need some work before that can be saved here. They're not
configurable in the NGW currently, so that needs to be fixed first. It
also appears that it may not be safe to inject the settings object with
plugin options until the game is created, but that needs more
investigation (see the comment in Settings.save_player_settings).

Another obvious candidate would be the desired player mission duration,
but we need to implement custom serialization for that first.
This commit is contained in:
Dan Albert
2023-04-24 22:05:28 -07:00
parent 1c20bc3966
commit e2c6d6788c
11 changed files with 116 additions and 13 deletions

View File

@@ -21,6 +21,7 @@ def bounded_float_option(
divisor: int,
detail: Optional[str] = None,
tooltip: Optional[str] = None,
remember_player_choice: bool = False,
**kwargs: Any,
) -> float:
return field(
@@ -32,6 +33,7 @@ def bounded_float_option(
detail,
tooltip,
causes_expensive_game_update=False,
remember_player_choice=remember_player_choice,
min=min,
max=max,
divisor=divisor,