allow to (multi) select scrap

This commit is contained in:
2026-07-13 21:09:01 +02:00
parent 8c4fb78fc9
commit 535d4f8f24
11 changed files with 403 additions and 19 deletions

View File

@@ -18,6 +18,7 @@
#include "GameConfig.h"
#include "PlayerCommandsAppliedEvent.h"
#include "RecipesConfig.h"
#include "ScrapSelectionChangedEvent.h"
#include "SelectionChangedEvent.h"
#include "ShipLayout.h"
#include "ShipsConfig.h"
@@ -37,6 +38,7 @@ class SelectedBuildingPanel : public QWidget,
PlayerCommandsAppliedEvent,
EntitySelectedEvent,
SelectionChangedEvent,
ScrapSelectionChangedEvent,
DebugDrawToggledEvent>
{
Q_OBJECT
@@ -51,6 +53,7 @@ private:
void handleEvent(std::shared_ptr<const PlayerCommandsAppliedEvent> event) override;
void handleEvent(std::shared_ptr<const EntitySelectedEvent> event) override;
void handleEvent(std::shared_ptr<const SelectionChangedEvent> event) override;
void handleEvent(std::shared_ptr<const ScrapSelectionChangedEvent> event) override;
void handleEvent(std::shared_ptr<const DebugDrawToggledEvent> event) override;
private slots:
@@ -77,6 +80,8 @@ private:
void buildEmpty();
void buildSingle(BuildingId id);
void buildMulti(const std::vector<BuildingId>& ids);
void buildScrap();
void refreshScrapTotal();
void refreshBuffers(const Building* b);
void refreshSiteProgress(const ConstructionSite* s);
void updateShipyardLayoutWidgets(BuildingType type,
@@ -115,6 +120,9 @@ private:
QLabel* m_entityTitleLabel;
QLabel* m_stationStatsLabel;
std::vector<entt::entity> m_selectedScrap;
QLabel* m_scrapLabel;
void buildEntityShip(entt::entity entity);
void buildEntityStation(entt::entity entity);
void refreshEntityStats();