remove the Shift copy-building-settings gesture

This commit is contained in:
2026-08-06 19:09:11 +02:00
parent fd6a7c5815
commit cd31af2611
12 changed files with 26 additions and 231 deletions

View File

@@ -14,7 +14,6 @@
#include "BeamFiredEvent.h"
#include "BuildModeController.h"
#include "BuildingConfig.h"
#include "BuildingId.h"
#include "BuildingType.h"
#include "Rotation.h"
@@ -36,31 +35,19 @@ struct ActiveBeam
QVector2D targetOffset;
};
// Brief outline flash shown on a building when settings are copied from it or
// pasted onto it (REQ-BLD-COPY-CONFIG-FEEDBACK). remainingMs counts down in
// wall-clock time so the flash plays at a fixed length regardless of game speed
// (and while paused).
struct CopyConfigFlash
{
BuildingId id;
qint64 remainingMs;
};
// Everything the renderer draws that the simulation does not know about: what the
// player has selected, which build mode is active, and the other transient bits of
// interaction state the view owns. Assembled fresh each frame and passed by
// reference, so the renderer holds no copy that could go stale.
struct WorldRenderFrame
{
const SelectionController& selection;
const BuildModeController& buildMode;
const std::vector<ActiveBeam>& beams;
const std::optional<BuildingConfig>& copiedConfig;
const std::vector<CopyConfigFlash>& copyConfigFlashes;
bool isBoxSelecting;
QPoint boxStartTile;
QPoint boxCurrentTile;
bool isDebugDrawEnabled;
const SelectionController& selection;
const BuildModeController& buildMode;
const std::vector<ActiveBeam>& beams;
bool isBoxSelecting;
QPoint boxStartTile;
QPoint boxCurrentTile;
bool isDebugDrawEnabled;
};
// Draws the game world: terrain, buildings, items, ships, effects and the build
@@ -94,8 +81,6 @@ private:
const WorldRenderFrame& frame);
void drawSelectionHighlights(QPainter& painter, const WorldCoordinates& coordinates,
const WorldRenderFrame& frame);
void drawCopyConfigFeedback(QPainter& painter, const WorldCoordinates& coordinates,
const WorldRenderFrame& frame);
void drawPortItems(QPainter& painter, const WorldCoordinates& coordinates,
const WorldRenderFrame& frame);
void drawStations(QPainter& painter, const WorldCoordinates& coordinates,
@@ -145,8 +130,7 @@ private:
const QColor& fill) const;
// Widget-space rectangle covering a building or construction site's footprint,
// or nullopt if the id resolves to neither. Shared by the selection highlight
// and the copy-settings feedback (REQ-BLD-COPY-CONFIG-FEEDBACK).
// or nullopt if the id resolves to neither. Used by the selection highlight.
std::optional<QRectF> footprintWidgetRect(const WorldCoordinates& coordinates,
BuildingId id) const;