implement blueprints
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include <QResizeEvent>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include "BlueprintPanel.h"
|
||||
#include "BuildButtonGrid.h"
|
||||
#include "ConfigLoader.h"
|
||||
#include "GameWorldView.h"
|
||||
@@ -36,9 +37,11 @@ MainWindow::MainWindow(Simulation* sim, const std::string& configDir, QWidget* p
|
||||
|
||||
m_selectedBuildingPanel = new SelectedBuildingPanel(sim, &sim->config(), m_bottomPanel);
|
||||
m_buildButtonGrid = new BuildButtonGrid(&sim->config(), m_bottomPanel);
|
||||
m_blueprintPanel = new BlueprintPanel(sim, &sim->config(), m_bottomPanel);
|
||||
|
||||
bottomLayout->addWidget(m_selectedBuildingPanel, 1);
|
||||
bottomLayout->addWidget(m_buildButtonGrid, 1);
|
||||
bottomLayout->addWidget(m_blueprintPanel, 1);
|
||||
|
||||
// Signals: game world → other panels
|
||||
connect(m_gameWorldView, &GameWorldView::selectionChanged,
|
||||
@@ -75,6 +78,22 @@ MainWindow::MainWindow(Simulation* sim, const std::string& configDir, QWidget* p
|
||||
connect(m_gameWorldView, &GameWorldView::demolishModeChanged,
|
||||
m_buildButtonGrid, &BuildButtonGrid::setDemolishModeActive);
|
||||
|
||||
// Signals: blueprint panel ↔ game world
|
||||
connect(m_gameWorldView, &GameWorldView::selectionChanged,
|
||||
m_blueprintPanel, &BlueprintPanel::onSelectionChanged);
|
||||
|
||||
connect(m_gameWorldView, &GameWorldView::stateUpdated,
|
||||
m_blueprintPanel, &BlueprintPanel::onStateUpdated);
|
||||
|
||||
connect(m_blueprintPanel, &BlueprintPanel::blueprintPlacementRequested,
|
||||
m_gameWorldView, &GameWorldView::enterBlueprintMode);
|
||||
|
||||
connect(m_blueprintPanel, &BlueprintPanel::exitBlueprintModeRequested,
|
||||
m_gameWorldView, &GameWorldView::exitBlueprintMode);
|
||||
|
||||
connect(m_gameWorldView, &GameWorldView::blueprintModeExited,
|
||||
m_blueprintPanel, &BlueprintPanel::clearActiveBlueprintButton);
|
||||
|
||||
// Signals: header bar → game world
|
||||
connect(m_headerBar, &HeaderBar::speedChanged,
|
||||
m_gameWorldView, &GameWorldView::setGameSpeed);
|
||||
|
||||
Reference in New Issue
Block a user