fix: Fix wordwrap for armor and weapons

This commit is contained in:
Dazed 2023-05-09 15:46:51 -05:00
parent ad9ca0b260
commit 6a8370f3ba

View file

@ -166,6 +166,12 @@ def parseMap(data, filename):
events = data['events']
global LOCK
# Translate displayName for Map files
if 'Map' in filename:
response = translateGPT(data['displayName'], 'Reply with only the english translated name', False)
totalTokens += response[1]
data['displayName'] = response[0].strip('.\"')
# Get total for progress bar
for event in events:
if event is not None:
@ -359,8 +365,8 @@ def searchNames(name, pbar, context):
# Set Data
name['name'] = responseList[0].strip('.\"')
if 'Armors' in context or 'Weapons' in context:
textwrap.fill(responseList[1], LISTWIDTH)
name['description'] = responseList[1].strip('\"')
translatedText = textwrap.fill(responseList[1], LISTWIDTH)
name['description'] = translatedText.strip('\"')
pbar.update(1)
return tokens