diff --git a/ui/hud_overlay_clean.py b/ui/hud_overlay_clean.py index b6b41ae..443996d 100644 --- a/ui/hud_overlay_clean.py +++ b/ui/hud_overlay_clean.py @@ -854,6 +854,7 @@ class HUDOverlay(QWidget): logger.debug(f"[HUD] update_loot called: value={value_ped}, is_shrapnel={is_shrapnel}, session_active={self.session_active}") if self.session_active: now = datetime.now() + is_new_kill = False # Check if this is a new kill (gap of >2 seconds since last loot) if self._stats._last_loot_time is not None: @@ -864,15 +865,22 @@ class HUDOverlay(QWidget): self._stats.highest_loot = self._stats._current_kill_loot # Start new kill self._stats._current_kill_loot = value_ped + is_new_kill = True else: # Same kill, add to current self._stats._current_kill_loot += value_ped else: - # First loot of session + # First loot of session - this is a new kill self._stats._current_kill_loot = value_ped + is_new_kill = True self._stats._last_loot_time = now + # Only count kill if it's a new mob + if is_new_kill: + self._stats.kills += 1 + logger.debug(f"[HUD] New kill counted! Total kills: {self._stats.kills}") + # Add to totals if is_shrapnel: self._stats.shrapnel_total += value_ped @@ -880,8 +888,8 @@ class HUDOverlay(QWidget): self._stats.loot_other += value_ped self._stats.recalculate() - # Emit signal to refresh on main thread instead of calling directly self._request_refresh() + logger.debug(f"[HUD] update_loot complete: kills={self._stats.kills}, shrapnel={self._stats.shrapnel_total}, other={self._stats.loot_other}") logger.debug(f"[HUD] update_loot complete: shrapnel={self._stats.shrapnel_total}, other={self._stats.loot_other}") def update_shrapnel(self, amount: Decimal): diff --git a/ui/main_window.py b/ui/main_window.py index 8f0bd90..81b0141 100644 --- a/ui/main_window.py +++ b/ui/main_window.py @@ -1075,11 +1075,7 @@ class MainWindow(QMainWindow): return try: - # Update kill count (each loot event = 1 kill) - logger.debug(f"[HUD] update_kills(1)") - self.hud.update_kills(1) - - # Update loot value + # Update loot value - this also handles kill counting internally is_shrapnel = 'shrapnel' in item_name.lower() logger.debug(f"[HUD] update_loot({value_ped}, is_shrapnel={is_shrapnel})") self.hud.update_loot(value_ped, is_shrapnel=is_shrapnel)