Public repository: timo / schach

Reader

Ein aufgeräumtes Schach-Programm für GNOME

feat(board): show player names in all game modes

public

feat(board): show player names in all game modes

Name strips existed only for Lichess games; local games now show
Maia strength vs Du, reviews show the stored opponent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Changesetec708f031861d7fb705e408d109b5f44d902de7e
Author (claimed)Timo Stolz <timo.stolz@nullachtvierzehn.de>,
Parents32c4e917b89c
Children65c63618cf62
Pushlog
by timo via ssh
by timo via ssh

modified schach/app.py +14 −0

@@ -402,6 +402,7 @@ class Window(OnlineMixin, PuzzleMixin, A
402402
             self.title.set_subtitle(f"Maia {self.elo} · du spielst {side}")
403403
         default_title = {"puzzle": "Rätsel", "online": "Lichess"}.get(self.mode, "Schach")
404404
         self.title.set_title(self.save_name or default_title)
405
+        self._refresh_players()
405406
 
406407
         hints = self.mode in ("maia", "puzzle")
407408
         can_hint = (
@@ -446,6 +447,19 @@ class Window(OnlineMixin, PuzzleMixin, A
446447
             self.movelist.update(self.board, self.evals, self.symbols, self.browse_ply)
447448
             self._request_missing_evals()
448449
 
450
+    def _refresh_players(self):
451
+        """Spieler-Zeilen über und unter dem Brett: wer spielt hier gegen wen?"""
452
+        if self.mode == "online":
453
+            return  # Namen und Uhren setzt die Lichess-Verbindung
454
+        if self.mode == "maia":
455
+            other = f"Maia-3 · {self.elo}"
456
+        elif self.mode == "review" and self.opponent:
457
+            other = self.opponent
458
+        else:
459
+            self.view.names = None
460
+            return
461
+        self.view.names = {self.human: "Du", not self.human: other}
462
+
449463
     def _human_has_moved(self):
450464
         n = len(self.board.move_stack)
451465
         return n >= 1 if self.human == chess.WHITE else n >= 2