From b9695d39de9c4c6a11c28787dda460748296be36 Mon Sep 17 00:00:00 2001 From: yusufipk Date: Tue, 28 Jul 2026 00:09:49 +0700 Subject: [PATCH] Show how many cards are in my hand The opponent row has had "hand N deck N" from the start, my own row only had the remaining deck count. The hand count now sits to its left, in the same order and the same dim colour, so both rows read the same way. Both numbers got a tooltip: on a narrow panel "hand 5 21" needs one. The refresh signature was missing my hand count, so a card leaving my hand without a draw did not repaint the panel on its own. --- ui/i18n.py | 3 +++ ui/window.py | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/ui/i18n.py b/ui/i18n.py index 5ad53f0..d87bd49 100644 --- a/ui/i18n.py +++ b/ui/i18n.py @@ -27,6 +27,9 @@ STRINGS: dict[str, dict[str, str]] = { "tr": "el {hand} deste {deck}", "en": "hand {hand} deck {deck}", }, + "hand_count": {"tr": "el {hand}", "en": "hand {hand}"}, + "hand_tooltip": {"tr": "Elindeki kart sayısı", "en": "Cards in your hand"}, + "deck_count_tooltip": {"tr": "Destende kalan kart", "en": "Cards left in your deck"}, "deck_auto": {"tr": "Otomatik", "en": "Automatic"}, "deck_tooltip": {"tr": "Takip edilen deste", "en": "Tracked deck"}, "menu_to_window": {"tr": "Pencere moduna geç", "en": "Switch to window mode"}, diff --git a/ui/window.py b/ui/window.py index d9f76ce..5f10872 100644 --- a/ui/window.py +++ b/ui/window.py @@ -157,8 +157,15 @@ class TrackerWindow(QWidget): lambda: self._popup(self.deck_button, self.deck_menu, align_right=False) ) deck_row.addWidget(self.deck_button, 1) + # Elimdeki kart sayısı destede kalanın solunda: rakip satırındaki + # "el N deste N" ile aynı sıra, aynı okuma yönü. + self.my_hand_label = QLabel("") + self.my_hand_label.setObjectName("dim") + self.my_hand_label.setToolTip(t("hand_tooltip")) + deck_row.addWidget(self.my_hand_label) self.deck_count_label = QLabel("") self.deck_count_label.setObjectName("count") + self.deck_count_label.setToolTip(t("deck_count_tooltip")) deck_row.addWidget(self.deck_count_label) top_layout.addLayout(deck_row) self._rebuild_deck_menu() @@ -294,6 +301,8 @@ class TrackerWindow(QWidget): self.menu = self._build_menu() self._fill_tray_menu() self.deck_button.setToolTip(t("deck_tooltip")) + self.my_hand_label.setToolTip(t("hand_tooltip")) + self.deck_count_label.setToolTip(t("deck_count_tooltip")) self.my_list.set_empty_text(t("deck_empty")) self.opponent_list.set_empty_text(t("opponent_empty")) self.opponent_title.setText(t("opponent_title")) @@ -546,6 +555,7 @@ class TrackerWindow(QWidget): self.opponent_dot.set_class("NEUTRAL") self.my_list.set_cards([]) self.opponent_list.set_cards([]) + self.my_hand_label.setText("") self.deck_count_label.setText("") self.opponent_counts.setText("") return @@ -560,6 +570,8 @@ class TrackerWindow(QWidget): ) self._set_turn_text(game) + self.my_hand_label.setText(t("hand_count", hand=game.my_hand_count)) + deck = self._selected_deck(game) if deck is not None: if not self.settings.get("selected_deck"): @@ -652,6 +664,7 @@ class TrackerWindow(QWidget): len(game.my_events), len(game.opponent_events), game.my_deck_count, + game.my_hand_count, game.opponent_hand_count, game.opponent_deck_count, )