allow multi-select for ships/stations, mixable with scrap
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
#include "Building.h"
|
||||
#include "BuildingSystem.h"
|
||||
#include "EntityHitTest.h"
|
||||
#include "EntitySelectedEvent.h"
|
||||
#include "EntitySelectionChangedEvent.h"
|
||||
#include "EventManager.h"
|
||||
#include "FacingComponent.h"
|
||||
#include "FactionComponent.h"
|
||||
@@ -259,8 +259,14 @@ void ArenaView::mousePressEvent(QMouseEvent* event)
|
||||
m_selectedEntity = std::nullopt;
|
||||
}
|
||||
|
||||
// The arena is strictly single-select; emit a vector of size 0 or 1.
|
||||
std::vector<entt::entity> selection;
|
||||
if (m_selectedEntity.has_value())
|
||||
{
|
||||
selection.push_back(*m_selectedEntity);
|
||||
}
|
||||
EventManager::getInstance()->sendEventImmediately(
|
||||
std::make_shared<EntitySelectedEvent>(m_selectedEntity));
|
||||
std::make_shared<EntitySelectionChangedEvent>(selection));
|
||||
}
|
||||
|
||||
QOpenGLWidget::mousePressEvent(event);
|
||||
|
||||
Reference in New Issue
Block a user