fix issue where building stats don't update while the building is kept selected
This commit is contained in:
@@ -188,6 +188,11 @@ void SelectedBuildingPanel::buildSingle(EntityId id)
|
||||
m_clearBeltBtn->hide();
|
||||
}
|
||||
|
||||
refreshBuffers(b);
|
||||
}
|
||||
|
||||
void SelectedBuildingPanel::refreshBuffers(const Building* b)
|
||||
{
|
||||
QString bufText;
|
||||
if (!b->inputBuffer.counts.empty())
|
||||
{
|
||||
@@ -221,6 +226,18 @@ void SelectedBuildingPanel::buildSingle(EntityId id)
|
||||
m_buffersLabel->setText(bufText);
|
||||
}
|
||||
|
||||
void SelectedBuildingPanel::onStateUpdated(Tick /*tick*/, int /*blocks*/, double /*speed*/)
|
||||
{
|
||||
if (m_singleId == kInvalidEntityId) { return; }
|
||||
const Building* b = m_sim->buildings().findBuilding(m_singleId);
|
||||
if (!b)
|
||||
{
|
||||
buildEmpty();
|
||||
return;
|
||||
}
|
||||
refreshBuffers(b);
|
||||
}
|
||||
|
||||
void SelectedBuildingPanel::buildMulti(const std::vector<EntityId>& ids)
|
||||
{
|
||||
m_singleId = kInvalidEntityId;
|
||||
|
||||
Reference in New Issue
Block a user