replace combined stateUpdated signal with individual events
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include "BlueprintSerializer.h"
|
||||
#include "BuildingBlocksChangedEvent.h"
|
||||
|
||||
#include "Building.h"
|
||||
#include "BuildingSystem.h"
|
||||
@@ -60,6 +61,13 @@ BlueprintPanel::BlueprintPanel(Simulation* sim, const GameConfig* config, QWidge
|
||||
|
||||
connect(m_saveBtn, &QPushButton::clicked, this, &BlueprintPanel::onSaveClicked);
|
||||
connect(m_loadBtn, &QPushButton::clicked, this, &BlueprintPanel::onLoadClicked);
|
||||
|
||||
registerForEvent();
|
||||
}
|
||||
|
||||
BlueprintPanel::~BlueprintPanel()
|
||||
{
|
||||
unregisterForEvent();
|
||||
}
|
||||
|
||||
void BlueprintPanel::onSelectionChanged(const std::vector<BuildingId>& ids)
|
||||
@@ -68,9 +76,9 @@ void BlueprintPanel::onSelectionChanged(const std::vector<BuildingId>& ids)
|
||||
refreshButtonStates();
|
||||
}
|
||||
|
||||
void BlueprintPanel::onStateUpdated(Tick /*tick*/, int blocks, double /*speed*/)
|
||||
void BlueprintPanel::handleEvent(std::shared_ptr<const BuildingBlocksChangedEvent> event)
|
||||
{
|
||||
m_currentBlocks = blocks;
|
||||
m_currentBlocks = event->blocks;
|
||||
refreshButtonStates();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user