split the selection panel into one card per kind of selection
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
|
||||
class QPushButton;
|
||||
class Simulation;
|
||||
class BuildingIconCache;
|
||||
class ItemIconCache;
|
||||
|
||||
// The build menu: one horizontal row of build buttons floating over the game world
|
||||
@@ -36,13 +37,11 @@ class BuildButtonBar : public QWidget,
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
// iconDir is the directory holding the per-building "<id>.svg" chip icons
|
||||
// (REQ-UI-BUILD-ICON), read from disk at runtime like the config files.
|
||||
// itemIcons is the window-wide per-item icon cache and supplies the
|
||||
// building_block icon shown in each button's cost (REQ-UI-BUILD-COST). Not
|
||||
// owned; must outlive this widget.
|
||||
// buildingIcons supplies each button's chip icon (REQ-UI-BUILD-ICON) and itemIcons
|
||||
// the building_block icon shown in each button's cost (REQ-UI-BUILD-COST). Both are
|
||||
// window-wide caches; neither is owned, and both must outlive this widget.
|
||||
BuildButtonBar(Simulation* sim, const GameConfig* config,
|
||||
const std::string& iconDir, ItemIconCache* itemIcons,
|
||||
BuildingIconCache* buildingIcons, ItemIconCache* itemIcons,
|
||||
QWidget* parent = nullptr);
|
||||
~BuildButtonBar() override;
|
||||
|
||||
@@ -85,8 +84,8 @@ private slots:
|
||||
private:
|
||||
Simulation* m_sim;
|
||||
const GameConfig* m_config;
|
||||
std::string m_iconDir;
|
||||
ItemIconCache* m_itemIcons; // Not owned; lives in MainWindow.
|
||||
BuildingIconCache* m_buildingIcons; // Not owned; lives in MainWindow.
|
||||
ItemIconCache* m_itemIcons; // Not owned; lives in MainWindow.
|
||||
std::vector<BuildingType> m_types;
|
||||
std::vector<QPushButton*> m_buttons;
|
||||
std::map<BuildingType, int> m_costs;
|
||||
|
||||
Reference in New Issue
Block a user