From 6a8370f3ba571be43d6f2aad16699e9f97b65e76 Mon Sep 17 00:00:00 2001 From: Dazed Date: Tue, 9 May 2023 15:46:51 -0500 Subject: [PATCH] fix: Fix wordwrap for armor and weapons --- src/rpgmakermvmz.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/rpgmakermvmz.py b/src/rpgmakermvmz.py index 4bb5135..c077b9c 100644 --- a/src/rpgmakermvmz.py +++ b/src/rpgmakermvmz.py @@ -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