tie-break for narrative points

This commit is contained in:
Maxime Réaux 2026-03-03 11:52:07 +01:00
parent d72c9902d4
commit 53b1fc916c
8 changed files with 194 additions and 17 deletions

View file

@ -26,6 +26,7 @@ class TieDialog(QDialog):
counters: List[int],
context_type: ContextType,
context_id: str,
context_name: str | None = None,
) -> None:
super().__init__(parent)
self._context_id = context_id
@ -33,7 +34,7 @@ class TieDialog(QDialog):
self.ui: Ui_tieDialog = Ui_tieDialog()
self.ui.setupUi(self) # type: ignore
self.setWindowIcon(Icons.get(IconName.WARCHRONICO))
self.ui.tieContext.setText(self._get_context_title(context_type))
self.ui.tieContext.setText(self._get_context_title(context_type, context_name))
grid = self.ui.playersGridLayout
icon_path = (RESOURCES_DIR / Icons._paths[IconName.TOKENS]).as_posix()
token_html = (
@ -72,11 +73,14 @@ class TieDialog(QDialog):
return {pid: checkbox.isChecked() for pid, checkbox in self._checkboxes.items()}
@staticmethod
def _get_context_title(context_type: ContextType) -> str:
def _get_context_title(
context_type: ContextType, context_name: str | None = None
) -> str:
titles = {
ContextType.BATTLE: "Battle tie",
ContextType.CAMPAIGN: "Campaign tie",
ContextType.WAR: "War tie",
ContextType.CHOICE: "Choice tie",
ContextType.OBJECTIVE: f"Objective tie: {context_name}",
}
return titles.get(context_type, "Tie")