diff --git a/src/production_planner/cells/ingredient.py b/src/production_planner/cells/ingredient.py index 7f20552..22319f5 100644 --- a/src/production_planner/cells/ingredient.py +++ b/src/production_planner/cells/ingredient.py @@ -53,6 +53,7 @@ def get(self) -> CellValue: clamp_count = self.data.node_main.clamp.value.count if abs(abs(value) - abs(clamp_count)) > 0.01: # FIXME: DataTable doesn't seem to handle strikethrough very well (small part of the next row is shifted to this one) + # TODO: use rich.text.Text with strikethrough style to show the clamped value return CellValue(value, text=f"{value} !", clamped=True) else: return CellValue(value, clamped=True) diff --git a/src/production_planner/core/module.py b/src/production_planner/core/module.py index fb4cce8..683d9e5 100644 --- a/src/production_planner/core/module.py +++ b/src/production_planner/core/module.py @@ -80,7 +80,7 @@ def update_module(self, modulefile: ModuleFile) -> Optional: MODULE_PRODUCER = _ModuleProducer( "Module", - abstract=True, + is_abstract=True, is_miner=False, is_pow_gen=False, max_mk=0, diff --git a/src/production_planner/core/producer.py b/src/production_planner/core/producer.py index 602d07d..550001e 100644 --- a/src/production_planner/core/producer.py +++ b/src/production_planner/core/producer.py @@ -22,8 +22,9 @@ class Producer: - def __init__(self, name, *, is_miner, is_pow_gen, max_mk, base_power, recipes, description, abstract=False): - self.abstract = abstract + def __init__(self, name, *, is_miner, is_pow_gen, max_mk, base_power, recipes, description, is_abstract=False, is_primary=True): + self.is_abstract = is_abstract + self.is_primary = is_primary self.name = name self.is_miner = is_miner self.is_pow_gen = is_pow_gen @@ -45,10 +46,11 @@ def update_recipe_map(self): self.recipe_map = {} for recipe in self.recipes: self.recipe_map[recipe.name] = recipe - recipe.recipe_to_producer_map[recipe] = self + if self.is_primary: + recipe.recipe_to_producer_map[recipe] = self def __str__(self): - if self.abstract: + if self.is_abstract: return f"<{self.name}>" else: return self.name @@ -101,7 +103,7 @@ def add(self, k, v): EMPTY_PRODUCER = Producer( "", - abstract=False, + is_abstract=False, is_miner=False, is_pow_gen=False, max_mk=0, @@ -112,7 +114,7 @@ def add(self, k, v): SUMMARY_PRODUCER = Producer( "Summary", - abstract=False, + is_abstract=False, is_miner=False, is_pow_gen=False, max_mk=0, @@ -140,7 +142,8 @@ def all_recipes_producer(): prod = Producer( "", - abstract=True, + is_abstract=True, + is_primary=False, is_miner=False, is_pow_gen=False, max_mk=0, diff --git a/tests b/tests index b76309a..2364178 160000 --- a/tests +++ b/tests @@ -1 +1 @@ -Subproject commit b76309ab02a14cf9ea7b2f00df581e6e41d6f48d +Subproject commit 2364178a4b1fb749cc5fd64ba7f4d085f092da7b