feat: add highest single loot tracking to HUD

- Add highest_loot field to HUDStats
- Display 🏆 Best: X.XX in loot summary section
- Track highest loot value in update_loot()
- Add to to_dict for persistence
- Gold color with trophy emoji for visibility
This commit is contained in:
LemonNexus 2026-02-09 23:03:16 +00:00
parent 6204b82c88
commit ad3003b808
1 changed files with 18 additions and 2 deletions

View File

@ -112,6 +112,9 @@ class HUDStats:
shrapnel_total: Decimal = Decimal('0.0')
loot_other: Decimal = Decimal('0.0') # Non-shrapnel loot
# Session records
highest_loot: Decimal = Decimal('0.0') # Highest single loot
# Cost metrics (core)
cost_per_shot: Decimal = Decimal('0.0')
cost_per_hit: Decimal = Decimal('0.0')
@ -150,6 +153,7 @@ class HUDStats:
'damage_taken': str(self.damage_taken),
'shrapnel_total': str(self.shrapnel_total),
'loot_other': str(self.loot_other),
'highest_loot': str(self.highest_loot),
'cost_per_shot': str(self.cost_per_shot),
'cost_per_hit': str(self.cost_per_hit),
'cost_per_heal': str(self.cost_per_heal),
@ -459,6 +463,14 @@ class HUDOverlay(QWidget):
summary_layout.addLayout(loot_layout)
# Highest loot row
highest_layout = QHBoxLayout()
self.highest_loot_label = QLabel("🏆 Best: 0.00")
self.highest_loot_label.setStyleSheet("font-size: 11px; color: #FFD700; font-weight: bold;")
highest_layout.addWidget(self.highest_loot_label)
highest_layout.addStretch()
summary_layout.addLayout(highest_layout)
layout.addWidget(summary_frame)
# === COST METRICS (if enabled) ===
@ -585,7 +597,7 @@ class HUDOverlay(QWidget):
if self.hud_config.show_profit_loss or self.hud_config.show_return_pct:
height += 40
if self.hud_config.show_total_cost:
height += 50 # Two rows now: cost + loot breakdown
height += 70 # Three rows now: cost + loot breakdown + highest
if self.hud_config.show_cost_metrics:
height += 30
if self.hud_config.show_cost_breakdown:
@ -724,11 +736,12 @@ class HUDOverlay(QWidget):
except RuntimeError:
pass
# Total Cost + Loot breakdown
# Total Cost + Loot breakdown + Highest
self._safe_set_text('total_cost_label', f"Cost: {self._stats.cost_total:.2f}")
self._safe_set_text('total_loot_label', f"Total: {self._stats.loot_total:.2f}")
self._safe_set_text('shrapnel_value_label', f"💎 {self._stats.shrapnel_total:.2f}")
self._safe_set_text('regular_loot_label', f"📦 {self._stats.loot_other:.2f}")
self._safe_set_text('highest_loot_label', f"🏆 Best: {self._stats.highest_loot:.2f}")
# Cost metrics
self._safe_set_text('cps_label', f"Shot: {self._stats.cost_per_shot:.4f}")
@ -765,6 +778,9 @@ class HUDOverlay(QWidget):
self._stats.shrapnel_total += value_ped
else:
self._stats.loot_other += value_ped
# Track highest single loot
if value_ped > self._stats.highest_loot:
self._stats.highest_loot = value_ped
self._stats.recalculate()
self._refresh_display()