mirror of
https://github.com/yusufipk/deste-hearthstone-linux-tracker.git
synced 2026-09-11 10:46:12 +00:00
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.
This commit is contained in:
@@ -27,6 +27,9 @@ STRINGS: dict[str, dict[str, str]] = {
|
|||||||
"tr": "el {hand} deste {deck}",
|
"tr": "el {hand} deste {deck}",
|
||||||
"en": "hand {hand} deck {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_auto": {"tr": "Otomatik", "en": "Automatic"},
|
||||||
"deck_tooltip": {"tr": "Takip edilen deste", "en": "Tracked deck"},
|
"deck_tooltip": {"tr": "Takip edilen deste", "en": "Tracked deck"},
|
||||||
"menu_to_window": {"tr": "Pencere moduna geç", "en": "Switch to window mode"},
|
"menu_to_window": {"tr": "Pencere moduna geç", "en": "Switch to window mode"},
|
||||||
|
|||||||
@@ -157,8 +157,15 @@ class TrackerWindow(QWidget):
|
|||||||
lambda: self._popup(self.deck_button, self.deck_menu, align_right=False)
|
lambda: self._popup(self.deck_button, self.deck_menu, align_right=False)
|
||||||
)
|
)
|
||||||
deck_row.addWidget(self.deck_button, 1)
|
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 = QLabel("")
|
||||||
self.deck_count_label.setObjectName("count")
|
self.deck_count_label.setObjectName("count")
|
||||||
|
self.deck_count_label.setToolTip(t("deck_count_tooltip"))
|
||||||
deck_row.addWidget(self.deck_count_label)
|
deck_row.addWidget(self.deck_count_label)
|
||||||
top_layout.addLayout(deck_row)
|
top_layout.addLayout(deck_row)
|
||||||
self._rebuild_deck_menu()
|
self._rebuild_deck_menu()
|
||||||
@@ -294,6 +301,8 @@ class TrackerWindow(QWidget):
|
|||||||
self.menu = self._build_menu()
|
self.menu = self._build_menu()
|
||||||
self._fill_tray_menu()
|
self._fill_tray_menu()
|
||||||
self.deck_button.setToolTip(t("deck_tooltip"))
|
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.my_list.set_empty_text(t("deck_empty"))
|
||||||
self.opponent_list.set_empty_text(t("opponent_empty"))
|
self.opponent_list.set_empty_text(t("opponent_empty"))
|
||||||
self.opponent_title.setText(t("opponent_title"))
|
self.opponent_title.setText(t("opponent_title"))
|
||||||
@@ -546,6 +555,7 @@ class TrackerWindow(QWidget):
|
|||||||
self.opponent_dot.set_class("NEUTRAL")
|
self.opponent_dot.set_class("NEUTRAL")
|
||||||
self.my_list.set_cards([])
|
self.my_list.set_cards([])
|
||||||
self.opponent_list.set_cards([])
|
self.opponent_list.set_cards([])
|
||||||
|
self.my_hand_label.setText("")
|
||||||
self.deck_count_label.setText("")
|
self.deck_count_label.setText("")
|
||||||
self.opponent_counts.setText("")
|
self.opponent_counts.setText("")
|
||||||
return
|
return
|
||||||
@@ -560,6 +570,8 @@ class TrackerWindow(QWidget):
|
|||||||
)
|
)
|
||||||
self._set_turn_text(game)
|
self._set_turn_text(game)
|
||||||
|
|
||||||
|
self.my_hand_label.setText(t("hand_count", hand=game.my_hand_count))
|
||||||
|
|
||||||
deck = self._selected_deck(game)
|
deck = self._selected_deck(game)
|
||||||
if deck is not None:
|
if deck is not None:
|
||||||
if not self.settings.get("selected_deck"):
|
if not self.settings.get("selected_deck"):
|
||||||
@@ -652,6 +664,7 @@ class TrackerWindow(QWidget):
|
|||||||
len(game.my_events),
|
len(game.my_events),
|
||||||
len(game.opponent_events),
|
len(game.opponent_events),
|
||||||
game.my_deck_count,
|
game.my_deck_count,
|
||||||
|
game.my_hand_count,
|
||||||
game.opponent_hand_count,
|
game.opponent_hand_count,
|
||||||
game.opponent_deck_count,
|
game.opponent_deck_count,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user