split the selection panel into one card per kind of selection
This commit is contained in:
34
src/ui/selection/MultiBuildingContent.h
Normal file
34
src/ui/selection/MultiBuildingContent.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "BuildingId.h"
|
||||
#include "SelectionContent.h"
|
||||
#include "SelectionContentFactory.h"
|
||||
|
||||
class QLabel;
|
||||
|
||||
// The count summary for several selected buildings that do not aggregate
|
||||
// (REQ-UI-MULTI-SELECTION, REQ-UI-SELECTION-AGGREGATE): how many of each type, and the
|
||||
// total building block cost of the selection. No per-building detail is shown.
|
||||
class MultiBuildingContent : public SelectionContent
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MultiBuildingContent(const SelectionContext& context,
|
||||
const SelectionRequest& request, QWidget* parent = nullptr);
|
||||
|
||||
protected:
|
||||
// The summary is fixed for a given selection -- how many of each type were selected,
|
||||
// and what they cost -- so it is built once and has nothing to keep current. A
|
||||
// building leaving the selection re-publishes it and rebuilds this card.
|
||||
void refreshRuntime() override {}
|
||||
|
||||
private:
|
||||
void buildSummary();
|
||||
|
||||
std::vector<BuildingId> m_ids;
|
||||
QLabel* m_countsLabel;
|
||||
QLabel* m_totalCostLabel;
|
||||
};
|
||||
Reference in New Issue
Block a user