diff --git a/BaseClasses.py b/BaseClasses.py index 2be9a9820d0..43d0e61b512 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -268,7 +268,7 @@ def set_options(self, args: Namespace) -> None: AutoWorld.AutoWorldRegister.world_types[self.game[player]].options_dataclass.type_hints} for option_key in all_keys: option = Utils.DeprecateDict(f"Getting options from multiworld is now deprecated. " - f"Please use `self.options.{option_key}` instead.") + f"Please use `self.options.{option_key}` instead.", True) option.update(getattr(args, option_key, {})) setattr(self, option_key, option) diff --git a/worlds/AutoWorld.py b/worlds/AutoWorld.py index dd0f46f6a6d..3f9ba6810df 100644 --- a/worlds/AutoWorld.py +++ b/worlds/AutoWorld.py @@ -12,6 +12,7 @@ from Options import PerGameCommonOptions from BaseClasses import CollectionState +from Utils import deprecate if TYPE_CHECKING: import random @@ -78,9 +79,8 @@ def __new__(mcs, name: str, bases: Tuple[type, ...], dct: Dict[str, Any]) -> Aut # TODO - remove this once all worlds use options dataclasses if "options_dataclass" not in dct and "option_definitions" in dct: # TODO - switch to deprecate after a version - if __debug__: - logging.warning(f"{name} Assigned options through option_definitions which is now deprecated. " - "Please use options_dataclass instead.") + deprecate(f"{name} Assigned options through option_definitions which is now deprecated. " + "Please use options_dataclass instead.") dct["options_dataclass"] = make_dataclass(f"{name}Options", dct["option_definitions"].items(), bases=(PerGameCommonOptions,))