From f728e43c8ed94a3b075a7a1d8b134993390a25db Mon Sep 17 00:00:00 2001 From: none Date: Sun, 28 Jan 2024 10:53:07 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20=D1=80=D0=B5=D1=86=D0=B5=D0=BF=D1=82=D1=8B?= =?UTF-8?q?,=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D1=8B=20?= =?UTF-8?q?=D0=BA=D0=B0=D1=82=D0=B5=D0=B3=D0=BE=D1=80=D0=B8=D0=B8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- update_db.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/update_db.py b/update_db.py index 56c8d8a..eba8ddd 100644 --- a/update_db.py +++ b/update_db.py @@ -39,8 +39,9 @@ BOTANY = "https://github.com/SerbiaStrong-220/space-station-14/raw/master/Resour BOTANY_LOCALISATION_URL = "https://github.com/SerbiaStrong-220/space-station-14/raw/master/Resources/Locale/ru-RU/reagents/meta/botany.ftl" # все съедобное и питьевое -FOOD = "https://github.com/SerbiaStrong-220/space-station-14/raw/dev/Resources/Prototypes/Reagents/Consumable/Food/food.yml" +FOOD = "https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/Resources/Prototypes/Recipes/Reactions/chemicals.yml" FOOD_R = "https://github.com/SerbiaStrong-220/space-station-14/raw/master/Resources/Prototypes/Reagents/Consumable/Food/condiments.yml" +FOOD_R_EX = "https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/Resources/Prototypes/Reagents/Consumable/Food/condiments.yml" INGREDIENTS_URL = "https://github.com/SerbiaStrong-220/space-station-14/raw/master/Resources/Prototypes/Reagents/Consumable/Food/ingredients.yml" DRINKS_URL = "https://github.com/SerbiaStrong-220/space-station-14/raw/master/Resources/Prototypes/Reagents/Consumable/Drink/drinks.yml" @@ -58,6 +59,7 @@ class Reagent: # self.__desc: str = init_data.get("desc") self.__recipe: dict = init_data.get("reactants") self.__product = init_data.get("products") + self.__category = init_data.get("category") # raw значения которые обработаны self.heat: bool = init_data.get("heat") @@ -80,11 +82,13 @@ class Reagent: if i.lower() == self.__name.replace('reagent-name-','',1).replace('-','',1): result.append(react_res[i]) + # Добавляем категорию + print(self.__category) + result.append(self.__category) + if not self.__recipe: return None for item in self.__recipe: - # "Бикаридин": [ [0, "Углерод", 1], [1, "Инапровалин", 1] ] -# result.append([self.__recipe[item]["reagent"], localise(item).capitalize(), self.__recipe[item]["amount"]]) # "Бикаридин": [ 2, ["Углерод", 1], ["Инапровалин", 1] ] result.append([localise(item).capitalize(), self.__recipe[item]['amount']]) #print(result) @@ -156,18 +160,21 @@ def load_recipes(url,name): element: {"amount": item["reactants"][element]["amount"], "reagent": element in content} for element in item["reactants"]} content[item["id"]]["products"] = item["products"] + content[item["id"]]["category"] = name load_reagents(BOTANY, 'botany') load_reagents(TOXINS, 'toxins') -load_reagents(MEDICINE_R, 'medecine') -load_recipes(MEDICINE, 'medecine') +load_reagents(MEDICINE_R, 'medicine') +load_recipes(MEDICINE, 'medicine') +# Не загружается? load_reagents(CHEMICALS_R, 'chemicals') load_recipes(CHEMICALS, 'chemicals') -load_reagents(FOOD_R, 'food') -load_recipes(FOOD, 'food') +#load_reagents(FOOD_R, 'food') +load_reagents(FOOD_R_EX, 'food') +load_recipes(FOOD, 'chemicals') # TODO: Включать ли токсины без крафта? (некоторые имеют крафт)