Files
dota_factory/src/ui/ShipStatsPanel.h

60 lines
1.3 KiB
C++

#pragma once
#include <map>
#include <string>
#include <vector>
#include <QWidget>
#include "ShipLayout.h"
#include "ShipStatsCalculator.h"
struct GameConfig;
class QLabel;
class ShipStatsPanel : public QWidget
{
Q_OBJECT
public:
explicit ShipStatsPanel(const GameConfig* config, QWidget* parent = nullptr);
void refresh(const std::string& shipId,
int level,
const std::vector<PlacedModule>& modules,
const std::map<std::string, int>& moduleLevelOverrides = {});
void refreshFromLive(const ShipStats& stats, float currentHp);
void setThreatCost(double cost);
void setDebugDrawEnabled(bool enabled);
private:
void applyStats(const ShipStats& stats, const QString& hpText);
const GameConfig* m_config;
bool m_debugDraw = false;
QLabel* m_hpLabel;
QLabel* m_speedLabel;
QLabel* m_sensorRangeLabel;
QLabel* m_mainAccelLabel;
QLabel* m_maneuveringAccelLabel;
QLabel* m_angularAccelLabel;
QLabel* m_maxRotSpeedLabel;
QWidget* m_weaponSection;
QLabel* m_weaponDpsLabel;
QLabel* m_weaponRangeLabel;
QWidget* m_salvageSection;
QLabel* m_salvageRateLabel;
QLabel* m_salvageRangeLabel;
QWidget* m_repairSection;
QLabel* m_repairRateLabel;
QLabel* m_repairRangeLabel;
QLabel* m_threatCostLabel;
};