forked from Hay1tsme/artemis
chuni: added login bonus (+importer), fixed config strings
This commit is contained in:
@ -32,19 +32,29 @@ class ChuniTeamConfig:
|
||||
)
|
||||
|
||||
|
||||
class ChuniModsConfig:
|
||||
def __init__(self, parent_config: "ChuniConfig") -> None:
|
||||
self.__config = parent_config
|
||||
|
||||
@property
|
||||
def use_login_bonus(self) -> bool:
|
||||
return CoreConfig.get_config_field(
|
||||
self.__config, "chuni", "mods", "use_login_bonus", default=True
|
||||
)
|
||||
|
||||
|
||||
class ChuniVersionConfig:
|
||||
def __init__(self, parent_config: "ChuniConfig") -> None:
|
||||
self.__config = parent_config
|
||||
|
||||
def version_rom(self, version: int) -> str:
|
||||
def version(self, version: int) -> Dict:
|
||||
"""
|
||||
in the form of:
|
||||
11: {"rom": 2.00.00, "data": 2.00.00}
|
||||
"""
|
||||
return CoreConfig.get_config_field(
|
||||
self.__config, "chuni", "version", f"{version}", "rom", default="2.00.00"
|
||||
)
|
||||
|
||||
def version_data(self, version: int) -> str:
|
||||
return CoreConfig.get_config_field(
|
||||
self.__config, "chuni", "version", f"{version}", "data", default="2.00.00"
|
||||
)
|
||||
self.__config, "chuni", "version", default={}
|
||||
)[version]
|
||||
|
||||
|
||||
class ChuniCryptoConfig:
|
||||
@ -73,5 +83,6 @@ class ChuniConfig(dict):
|
||||
def __init__(self) -> None:
|
||||
self.server = ChuniServerConfig(self)
|
||||
self.team = ChuniTeamConfig(self)
|
||||
self.mods = ChuniModsConfig(self)
|
||||
self.version = ChuniVersionConfig(self)
|
||||
self.crypto = ChuniCryptoConfig(self)
|
||||
|
Reference in New Issue
Block a user