From 5466a88c2dd2df22a2a5bebf76fb8497e9d620c7 Mon Sep 17 00:00:00 2001 From: Faraphel Date: Mon, 25 Jul 2022 18:48:45 +0200 Subject: [PATCH] moved bmg_color_text in safe_eval to ModConfig --- source/mkw/ModConfig.py | 3 ++- source/mkw/Track.py | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/mkw/ModConfig.py b/source/mkw/ModConfig.py index 6fa7d84..33d4a7e 100644 --- a/source/mkw/ModConfig.py +++ b/source/mkw/ModConfig.py @@ -7,6 +7,7 @@ from PIL import Image from source import threaded from source.mkw import Tag from source.mkw.Cup import Cup +from source.mkw.MKWColor import bmg_color_text from source.mkw.Track import Track import json @@ -116,7 +117,7 @@ class ModConfig: """ return (multiple_safe_eval if multiple else safe_eval)( template, - env={"mod_config": self} | (env if env is not None else {}), + env={"mod_config": self, "bmg_color_text": bmg_color_text} | (env if env is not None else {}), macros=self.macros, ) diff --git a/source/mkw/Track.py b/source/mkw/Track.py index 3dfe18e..27d3596 100644 --- a/source/mkw/Track.py +++ b/source/mkw/Track.py @@ -1,7 +1,6 @@ from typing import Generator from source.mkw import Tag, Slot -from source.mkw.MKWColor import bmg_color_text ModConfig: any @@ -72,7 +71,7 @@ class Track: """ for tag in filter(lambda tag: tag in templates, self.tags): template: str = templates[tag] - return mod_config.safe_eval(template, env={"TAG": tag, "bmg_color_text": bmg_color_text}, multiple=True) + return mod_config.safe_eval(template, env={"TAG": tag}, multiple=True) return default def get_prefix(self, mod_config: "ModConfig", default: any = None) -> any: