diff --git a/ammo/fomod_controller.py b/ammo/fomod_controller.py index 8ca51f9..7756a03 100755 --- a/ammo/fomod_controller.py +++ b/ammo/fomod_controller.py @@ -36,6 +36,7 @@ class Page: """ name: str + step_name: str archtype: str selections: list[Selection] visibility_conditions: field(default_factory=dict[str, bool]) @@ -73,7 +74,7 @@ def __init__(self, mod: Mod): def __str__(self) -> str: num_pages = len(self.visible_pages) - result = f"{self.module_name}\n" + result = f"{self.module_name} {self.page.step_name}\n" result += "--------------------------------\n" result += f"Page {self.page_index + 1} / {num_pages}: {self.visible_pages[self.page_index].name}\n" result += "--------------------------------\n\n" @@ -143,6 +144,9 @@ def _get_pages(self) -> list[Page]: steps = [] # Find all the install steps for step in self.xml_root_node.find("installSteps"): + install_step_name = step.get("name", "") + if install_step_name: + install_step_name = f"- {install_step_name}" for optional_file_groups in step: for group in optional_file_groups: if not (group_of_plugins := group.find("plugins")): @@ -162,12 +166,13 @@ def _get_pages(self) -> list[Page]: dep_op = dep_op.lower() visibility_conditions["operator"] = dep_op for xml_flag in dependencies: - visibility_conditions[ - xml_flag.get("flag") - ] = xml_flag.get("value") in ["On", "1"] + visibility_conditions[xml_flag.get("flag")] = ( + xml_flag.get("value") in ["On", "1"] + ) page = Page( name=group.get("name"), + step_name=install_step_name, archtype=group.get("type"), selections=[], visibility_conditions=visibility_conditions,