Allow definition of settings in campaign's yaml file

Resolves #92
This commit is contained in:
Raffson
2023-04-08 19:34:24 +02:00
parent 5c4ab2578d
commit 5916ed43d2
11 changed files with 187 additions and 126 deletions

View File

@@ -56,6 +56,7 @@ class Campaign:
data: Dict[str, Any]
path: Path
advanced_iads: bool
settings: Dict[str, Any]
@classmethod
def from_file(cls, path: Path) -> Campaign:
@@ -108,6 +109,7 @@ class Campaign:
data,
path,
data.get("advanced_iads", False),
data.get("settings", {}),
)
def load_theater(self, advanced_iads: bool) -> ConflictTheater:

View File

@@ -658,7 +658,7 @@ class Settings:
@staticmethod
def plugin_settings_key(identifier: str) -> str:
return f"plugins.{identifier}"
return f"{identifier}"
def initialize_plugin_option(self, identifier: str, default_value: Any) -> None:
try:

View File

@@ -170,9 +170,10 @@ VERSION = _build_version_string()
#:
#: Version 10.5
#: * Support for scenery objectives defined by quad zones.
#: * Campaign designers can now define more settings:
#: `max_frontline_length: 25` (in km)
#: `culling_exclusion_radius: 35` (in km)
#: * Campaign designers can now define almost all settings:
#: `settings:`
#: ` max_frontline_length: 25` (in km)
#: ` perf_culling_distance: 35` (in km)
#:
#: Version 10.6
#: * Designated CTLD zones for ControlPoints (Airbases & FOBs/FARPs)