From 602c2966fc6574a5b455a59cce50b67dbaed8123 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Tue, 16 Jan 2024 17:23:18 +0100 Subject: [PATCH] LttP: move _hint_text to SubClasses (#2532) --- BaseClasses.py | 3 --- worlds/alttp/SubClasses.py | 7 +++++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/BaseClasses.py b/BaseClasses.py index 855e69c5d48c..38598d42d999 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -1056,9 +1056,6 @@ def native_item(self) -> bool: @property def hint_text(self) -> str: - hint_text = getattr(self, "_hint_text", None) - if hint_text: - return hint_text return "at " + self.name.replace("_", " ").replace("-", " ") diff --git a/worlds/alttp/SubClasses.py b/worlds/alttp/SubClasses.py index 64e4adaec9a2..22eeebe181e5 100644 --- a/worlds/alttp/SubClasses.py +++ b/worlds/alttp/SubClasses.py @@ -26,6 +26,13 @@ def __init__(self, player: int, name: str, address: Optional[int] = None, crysta self.player_address = player_address self._hint_text = hint_text + @property + def hint_text(self) -> str: + hint_text = getattr(self, "_hint_text", None) + if hint_text: + return hint_text + return "at " + self.name.replace("_", " ").replace("-", " ") + class ALttPItem(Item): game: str = "A Link to the Past"