Catch pickit config errors and reduce to print (#372)

This commit is contained in:
aeon0
2022-01-01 20:24:16 +01:00
committed by GitHub
parent 7266468d85
commit 36d5f2a532
+7 -3
View File
@@ -165,9 +165,13 @@ class Config:
self.items = {}
for key in self._pickit_config["items"]:
self.items[key] = self.parse_item_config_string(key)
if self.items[key].pickit_type and not os.path.exists(f"./assets/items/{key}.png") and self._print_warnings:
print(f"Warning: You activated {key} in pickit, but there is no img available in assets/items")
try:
self.items[key] = self.parse_item_config_string(key)
if self.items[key].pickit_type and not os.path.exists(f"./assets/items/{key}.png") and self._print_warnings:
print(f"Warning: You activated {key} in pickit, but there is no img available in assets/items")
except ValueError as e:
if self._print_warnings:
print(f"Error with pickit config: {key} ({e})")
self.colors = {}
for key in self._game_config["colors"]: