feat: add total cost display to HUD
- Add show_total_cost config option (enabled by default) - Add total cost row between P/L and cost metrics - Add Total Cost checkbox to settings dialog - Update window size calculation for total cost row - Update _refresh_display to show total cost
This commit is contained in:
parent
4c084bd0cd
commit
5c4ce8f307
|
|
@ -38,6 +38,7 @@ class HUDConfig:
|
|||
show_session_time: bool = True
|
||||
show_profit_loss: bool = True
|
||||
show_return_pct: bool = True
|
||||
show_total_cost: bool = True # NEW: Total cost display
|
||||
show_cost_breakdown: bool = False # Weapon/Armor/Heal costs
|
||||
show_combat_stats: bool = False # Kills, Globals, DPP
|
||||
show_damage_stats: bool = False # Damage dealt/taken
|
||||
|
|
@ -52,6 +53,7 @@ class HUDConfig:
|
|||
'show_session_time': self.show_session_time,
|
||||
'show_profit_loss': self.show_profit_loss,
|
||||
'show_return_pct': self.show_return_pct,
|
||||
'show_total_cost': self.show_total_cost,
|
||||
'show_cost_breakdown': self.show_cost_breakdown,
|
||||
'show_combat_stats': self.show_combat_stats,
|
||||
'show_damage_stats': self.show_damage_stats,
|
||||
|
|
@ -67,6 +69,7 @@ class HUDConfig:
|
|||
show_session_time=data.get('show_session_time', True),
|
||||
show_profit_loss=data.get('show_profit_loss', True),
|
||||
show_return_pct=data.get('show_return_pct', True),
|
||||
show_total_cost=data.get('show_total_cost', True),
|
||||
show_cost_breakdown=data.get('show_cost_breakdown', False),
|
||||
show_combat_stats=data.get('show_combat_stats', False),
|
||||
show_damage_stats=data.get('show_damage_stats', False),
|
||||
|
|
@ -174,6 +177,10 @@ class HUDSettingsDialog(QDialog):
|
|||
self.cb_return.setChecked(self.config.show_return_pct)
|
||||
form.addRow(self.cb_return)
|
||||
|
||||
self.cb_total_cost = QCheckBox("Total Cost")
|
||||
self.cb_total_cost.setChecked(self.config.show_total_cost)
|
||||
form.addRow(self.cb_total_cost)
|
||||
|
||||
self.cb_cost_metrics = QCheckBox("Cost per Shot/Hit/Heal")
|
||||
self.cb_cost_metrics.setChecked(self.config.show_cost_metrics)
|
||||
form.addRow(self.cb_cost_metrics)
|
||||
|
|
@ -229,6 +236,7 @@ class HUDSettingsDialog(QDialog):
|
|||
self.config.show_session_time = self.cb_time.isChecked()
|
||||
self.config.show_profit_loss = self.cb_profit.isChecked()
|
||||
self.config.show_return_pct = self.cb_return.isChecked()
|
||||
self.config.show_total_cost = self.cb_total_cost.isChecked()
|
||||
self.config.show_cost_metrics = self.cb_cost_metrics.isChecked()
|
||||
self.config.show_gear_info = self.cb_gear.isChecked()
|
||||
self.config.show_cost_breakdown = self.cb_cost_breakdown.isChecked()
|
||||
|
|
@ -399,6 +407,19 @@ class HUDOverlay(QWidget):
|
|||
|
||||
layout.addWidget(core_frame)
|
||||
|
||||
# === TOTAL COST (if enabled) ===
|
||||
if self.hud_config.show_total_cost:
|
||||
total_cost_frame = QFrame()
|
||||
total_cost_layout = QHBoxLayout(total_cost_frame)
|
||||
total_cost_layout.setContentsMargins(0, 0, 0, 0)
|
||||
|
||||
self.total_cost_label = QLabel("Cost: 0.00 PED")
|
||||
self.total_cost_label.setStyleSheet("font-size: 14px; color: #FFAAAA;")
|
||||
total_cost_layout.addWidget(self.total_cost_label)
|
||||
total_cost_layout.addStretch()
|
||||
|
||||
layout.addWidget(total_cost_frame)
|
||||
|
||||
# === COST METRICS (if enabled) ===
|
||||
if self.hud_config.show_cost_metrics:
|
||||
metrics_frame = QFrame()
|
||||
|
|
@ -495,6 +516,8 @@ class HUDOverlay(QWidget):
|
|||
height += 70
|
||||
if self.hud_config.show_profit_loss or self.hud_config.show_return_pct:
|
||||
height += 40
|
||||
if self.hud_config.show_total_cost:
|
||||
height += 25
|
||||
if self.hud_config.show_cost_metrics:
|
||||
height += 30
|
||||
if self.hud_config.show_cost_breakdown:
|
||||
|
|
@ -613,6 +636,10 @@ class HUDOverlay(QWidget):
|
|||
self.return_label.setText(f"{ret:.1f}%")
|
||||
self.return_label.setStyleSheet(f"font-size: 16px; font-weight: bold; color: {color};")
|
||||
|
||||
# Total Cost
|
||||
if hasattr(self, 'total_cost_label'):
|
||||
self.total_cost_label.setText(f"Cost: {self._stats.cost_total:.2f} PED")
|
||||
|
||||
# Cost metrics
|
||||
if hasattr(self, 'cps_label'):
|
||||
self.cps_label.setText(f"Shot: {self._stats.cost_per_shot:.4f}")
|
||||
|
|
|
|||
Loading…
Reference in New Issue