Implement config-driven unlock groups so that multiple things can be unlocked at once (including buildings)
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include "DemolishModeChangedEvent.h"
|
||||
#include "EventHandler.h"
|
||||
#include "GameConfig.h"
|
||||
#include "UnlockedBuildingsChangedEvent.h"
|
||||
|
||||
class QPushButton;
|
||||
class Simulation;
|
||||
@@ -21,7 +22,8 @@ class BuildButtonGrid : public QWidget,
|
||||
public CombinedEventHandler<BuilderModeExitedEvent,
|
||||
DemolishModeChangedEvent,
|
||||
BuildHotkeyPressedEvent,
|
||||
BuildingBlocksChangedEvent>
|
||||
BuildingBlocksChangedEvent,
|
||||
UnlockedBuildingsChangedEvent>
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -37,10 +39,15 @@ private:
|
||||
// be afforded, it exits builder mode so the button does not stay selected.
|
||||
void updateAffordability();
|
||||
|
||||
// Re-evaluates which build buttons are visible from the current per-building
|
||||
// unlock state (REQ-LOCK-BUILDING); a locked building type's button is hidden.
|
||||
void updateVisibility();
|
||||
|
||||
void handleEvent(std::shared_ptr<const BuilderModeExitedEvent> event) override;
|
||||
void handleEvent(std::shared_ptr<const DemolishModeChangedEvent> event) override;
|
||||
void handleEvent(std::shared_ptr<const BuildHotkeyPressedEvent> event) override;
|
||||
void handleEvent(std::shared_ptr<const BuildingBlocksChangedEvent> event) override;
|
||||
void handleEvent(std::shared_ptr<const UnlockedBuildingsChangedEvent> event) override;
|
||||
|
||||
private slots:
|
||||
void onBuildButton(int index);
|
||||
|
||||
Reference in New Issue
Block a user