deselect build tool when it becomes unaffordable and fix stale enabled button
This commit is contained in:
@@ -14,7 +14,6 @@
|
||||
|
||||
#include "BlueprintPanel.h"
|
||||
#include "BuildButtonGrid.h"
|
||||
#include "BuildingBlocksChangedEvent.h"
|
||||
#include "BuildingSystem.h"
|
||||
#include "Command.h"
|
||||
#include "CommandRequestedEvent.h"
|
||||
@@ -53,7 +52,7 @@ MainWindow::MainWindow(Simulation* sim, const std::string& configDir,
|
||||
sideLayout->setSpacing(1);
|
||||
|
||||
m_selectedBuildingPanel = new SelectedBuildingPanel(sim, &sim->getConfig(), m_sidePanel);
|
||||
m_buildButtonGrid = new BuildButtonGrid(&sim->getConfig(), m_sidePanel);
|
||||
m_buildButtonGrid = new BuildButtonGrid(sim, &sim->getConfig(), m_sidePanel);
|
||||
m_blueprintPanel = new BlueprintPanel(sim, &sim->getConfig(), m_sidePanel);
|
||||
|
||||
sideLayout->addWidget(m_selectedBuildingPanel, 1);
|
||||
@@ -151,11 +150,6 @@ void MainWindow::layoutPanels()
|
||||
m_dimOverlay->setGeometry(0, 0, totalW, totalH);
|
||||
}
|
||||
|
||||
void MainWindow::handleEvent(std::shared_ptr<const BuildingBlocksChangedEvent> event)
|
||||
{
|
||||
m_buildButtonGrid->updateAffordability(event->blocks);
|
||||
}
|
||||
|
||||
void MainWindow::handleEvent(std::shared_ptr<const SchematicChoicesAvailableEvent> event)
|
||||
{
|
||||
const double prevSpeed = m_gameWorldView->getGameSpeed();
|
||||
|
||||
Reference in New Issue
Block a user