implement demolish button
This commit is contained in:
@@ -82,6 +82,12 @@ BuildButtonGrid::BuildButtonGrid(const GameConfig* config, QWidget* parent)
|
||||
}
|
||||
}
|
||||
connect(mapper, SIGNAL(mapped(int)), this, SLOT(onBuildButton(int)));
|
||||
|
||||
m_demolishButton = new QPushButton("Demolish", this);
|
||||
m_demolishButton->setCheckable(true);
|
||||
m_demolishButton->setFixedHeight(48);
|
||||
layout->addWidget(m_demolishButton, row, col);
|
||||
connect(m_demolishButton, SIGNAL(clicked()), this, SIGNAL(demolishModeToggleRequested()));
|
||||
}
|
||||
|
||||
void BuildButtonGrid::updateAffordability(int buildingBlocks)
|
||||
@@ -95,6 +101,11 @@ void BuildButtonGrid::updateAffordability(int buildingBlocks)
|
||||
}
|
||||
}
|
||||
|
||||
void BuildButtonGrid::setDemolishModeActive(bool active)
|
||||
{
|
||||
m_demolishButton->setChecked(active);
|
||||
}
|
||||
|
||||
void BuildButtonGrid::clearActiveButton()
|
||||
{
|
||||
if (m_activeIndex >= 0 && m_activeIndex < static_cast<int>(m_buttons.size()))
|
||||
|
||||
Reference in New Issue
Block a user