From 4b8f990960f405e9a1d42b25f0ea4699f029b8f1 Mon Sep 17 00:00:00 2001 From: threeandthreee Date: Thu, 16 Jan 2025 21:59:19 -0500 Subject: [PATCH] LADX: Swap out invalid characters in item names (#4495) --- worlds/ladx/LADXR/locations/itemInfo.py | 9 +++++++++ worlds/ladx/__init__.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/worlds/ladx/LADXR/locations/itemInfo.py b/worlds/ladx/LADXR/locations/itemInfo.py index dcd4205f..cd0f3551 100644 --- a/worlds/ladx/LADXR/locations/itemInfo.py +++ b/worlds/ladx/LADXR/locations/itemInfo.py @@ -2,6 +2,10 @@ import typing from ..checkMetadata import checkMetadataTable from .constants import * +custom_name_replacements = { + '"':"'", + '_':' ', +} class ItemInfo: MULTIWORLD = True @@ -23,6 +27,11 @@ class ItemInfo: def setLocation(self, location): self._location = location + def setCustomItemName(self, name): + for key, val in custom_name_replacements.items(): + name = name.replace(key, val) + self.custom_item_name = name + def getOptions(self): return self.OPTIONS diff --git a/worlds/ladx/__init__.py b/worlds/ladx/__init__.py index f20b7f80..7b1a3566 100644 --- a/worlds/ladx/__init__.py +++ b/worlds/ladx/__init__.py @@ -439,7 +439,7 @@ class LinksAwakeningWorld(World): # Otherwise, use a cute letter as the icon elif self.options.foreign_item_icons == 'guess_by_name': loc.ladxr_item.item = self.guess_icon_for_other_world(loc.item) - loc.ladxr_item.custom_item_name = loc.item.name + loc.ladxr_item.setCustomItemName(loc.item.name) else: if loc.item.advancement: