mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
This really shouldn't need to happen but I don't feel like rewriting the culling code right now. There's no reason for these to be persisted to the Game at all, we should be generating these once they're needed.
41 lines
881 B
Python
41 lines
881 B
Python
from dataclasses import dataclass, field
|
|
from datetime import timedelta
|
|
from typing import Any, Optional
|
|
|
|
from .optiondescription import OptionDescription, SETTING_DESCRIPTION_KEY
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class MinutesOption(OptionDescription):
|
|
min: int
|
|
max: int
|
|
|
|
|
|
def minutes_option(
|
|
text: str,
|
|
page: str,
|
|
section: str,
|
|
default: timedelta,
|
|
min: int,
|
|
max: int,
|
|
detail: Optional[str] = None,
|
|
tooltip: Optional[str] = None,
|
|
**kwargs: Any,
|
|
) -> timedelta:
|
|
return field(
|
|
metadata={
|
|
SETTING_DESCRIPTION_KEY: MinutesOption(
|
|
page,
|
|
section,
|
|
text,
|
|
detail,
|
|
tooltip,
|
|
causes_expensive_game_update=False,
|
|
min=min,
|
|
max=max,
|
|
)
|
|
},
|
|
default=default,
|
|
**kwargs,
|
|
)
|