make HeaderBar read block stock and expansion cost from the simulation
HeaderBar was the only panel caching event payloads as truth. It now holds a const Simulation* and re-reads getBuildingBlocksStock() / getCurrentExpansionCost() in the handlers, per the "events are refresh signals" rule. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GH8ZMRY3vhxxXcaUxBqxkk
This commit is contained in:
@@ -47,7 +47,7 @@ MainWindow::MainWindow(Simulation* sim, const std::string& configDir,
|
||||
const std::string itemsIconDir = QDir::cleanPath(
|
||||
QString::fromStdString(m_configDir) + "/../icons/items").toStdString();
|
||||
|
||||
m_headerBar = new HeaderBar(&sim->getConfig(), itemsIconDir, this);
|
||||
m_headerBar = new HeaderBar(sim, &sim->getConfig(), itemsIconDir, this);
|
||||
|
||||
m_gameWorldView = new GameWorldView(sim, &sim->getConfig(), &m_visuals, m_configDir,
|
||||
m_replay.get(), this);
|
||||
|
||||
Reference in New Issue
Block a user