From ab89d340c1fbecb206f1ccc388caad16b57a89b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20=20Sk=C3=B6ld?= Date: Wed, 7 Aug 2024 17:25:24 +0200 Subject: [PATCH] Add associated string if in custom_characters.json If the same character is in both normal and custom characters, add both the prompt and associated strings together. --- src/character_select.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/character_select.py b/src/character_select.py index 29ed3d9..6f34c16 100644 --- a/src/character_select.py +++ b/src/character_select.py @@ -69,13 +69,16 @@ class CharacterSelectNode: custom_json_path = os.path.join(dir_path, CUSTOM_CHARACTER_FILE_PATH) if not os.path.exists(custom_json_path): - cls.logger.log(f"Custom character file doesn't exist. Please create the json file at: {custom_json_path}", "WARNING") + cls.logger.log( + f"Custom character file doesn't exist. Please create the json file at: {custom_json_path}", "WARNING" + ) else: with open(custom_json_path, "r", encoding="utf-8") as file: custom_character_data = json.load(file) for custom_character in custom_character_data: for character in character_data: if custom_character["name"] == character["name"]: + character["associated_string"] += ", " + custom_character["associated_string"] character["prompt"] += ", " + custom_character["prompt"] break else: