LADX: Swap out invalid characters in item names (#4495)
This commit is contained in:
parent
3a5a4b89ee
commit
4b8f990960
|
@ -2,6 +2,10 @@ import typing
|
||||||
from ..checkMetadata import checkMetadataTable
|
from ..checkMetadata import checkMetadataTable
|
||||||
from .constants import *
|
from .constants import *
|
||||||
|
|
||||||
|
custom_name_replacements = {
|
||||||
|
'"':"'",
|
||||||
|
'_':' ',
|
||||||
|
}
|
||||||
|
|
||||||
class ItemInfo:
|
class ItemInfo:
|
||||||
MULTIWORLD = True
|
MULTIWORLD = True
|
||||||
|
@ -23,6 +27,11 @@ class ItemInfo:
|
||||||
def setLocation(self, location):
|
def setLocation(self, location):
|
||||||
self._location = 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):
|
def getOptions(self):
|
||||||
return self.OPTIONS
|
return self.OPTIONS
|
||||||
|
|
||||||
|
|
|
@ -439,7 +439,7 @@ class LinksAwakeningWorld(World):
|
||||||
# Otherwise, use a cute letter as the icon
|
# Otherwise, use a cute letter as the icon
|
||||||
elif self.options.foreign_item_icons == 'guess_by_name':
|
elif self.options.foreign_item_icons == 'guess_by_name':
|
||||||
loc.ladxr_item.item = self.guess_icon_for_other_world(loc.item)
|
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:
|
else:
|
||||||
if loc.item.advancement:
|
if loc.item.advancement:
|
||||||
|
|
Loading…
Reference in New Issue