Public repository: timo / schach

Reader

Ein aufgeräumtes Schach-Programm für GNOME

fix(hint): restart hint after switching helper in duo games

public

fix(hint): restart hint after switching helper in duo games

Reset applied to Maia games only. Keep a shown threat when the
hint is reset.

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

modified schach/app.py +5 −2

@@ -1425,8 +1425,11 @@ class Window(OnlineMixin, PuzzleMixin, O
14251425
             self._refresh_chrome()
14261426
         if key == "hint_helper":
14271427
             self._action("hint-helper").set_state(GLib.Variant.new_string(value))
1428
-            if self.mode == "maia" and self._human_to_move():
1429
-                self._changed()  # Hinweis mit dem neuen Helfer neu vorbereiten
1428
+            if self.mode in ("maia", "duo") and self._human_to_move():
1429
+                # Hinweis mit dem neuen Helfer von vorn; eine gezeigte Drohung bleibt stehen
1430
+                threat = (self.threat_move, self.threat_level)
1431
+                self._changed()
1432
+                self.threat_move, self.threat_level = threat
14301433
                 self._refresh()
14311434
             else:
14321435
                 self._refresh_chrome()