mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Port the campaign management page to auto.
Also fixes the oversight in the previous commit where float options were not saved when changed.
This commit is contained in:
@@ -6,17 +6,22 @@ from .optiondescription import OptionDescription, SETTING_DESCRIPTION_KEY
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class BooleanOption(OptionDescription):
|
||||
pass
|
||||
invert: bool
|
||||
|
||||
|
||||
def boolean_option(
|
||||
text: str,
|
||||
page: str,
|
||||
section: str,
|
||||
default: bool,
|
||||
invert: bool = False,
|
||||
detail: Optional[str] = None,
|
||||
**kwargs: Any,
|
||||
) -> bool:
|
||||
return field(
|
||||
metadata={SETTING_DESCRIPTION_KEY: BooleanOption(page, section, text, detail)},
|
||||
metadata={
|
||||
SETTING_DESCRIPTION_KEY: BooleanOption(page, section, text, detail, invert)
|
||||
},
|
||||
default=default,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user