Commit Graph

38 Commits

Author SHA1 Message Date
db1b7b617f Rename EntitySelectedEvent to EntitySelectionChangedEvent
The event also fires on deselection and now carries a set of entities
rather than a single one, so the "SelectionChanged" name (matching
SelectionChangedEvent and ScrapSelectionChangedEvent) is more accurate.
Pure rename: header + include guard, CMake entry, and all usages.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7N59FsLA5e2kuVdqe4Uhc
2026-07-20 20:32:35 +02:00
4044846d6a Multi-select ships/stations, mixable with scrap
Reshape game-world selection into two categories: buildings (exclusive,
win all ties) and field objects (ships, defence stations, scrap) that
coexist. Ships/stations are now multi-selectable via Ctrl+click and
box-drag and can be selected together with scrap; the Selected panel
shows a single-actor stats panel or a multi-actor summary plus the scrap
total.

- Widen EntitySelectedEvent to std::vector<entt::entity>
- Add actorsInBox() ECS query (+ Catch2 test)
- GameWorldView: vector actor selection, building>actor>scrap hit-test,
  actor Ctrl-toggle/box-select, membership highlights, per-frame prune
- SelectedBuildingPanel: buildFieldSelection composition, buildEntitySummary
- ArenaView/InspectWindow: adapt to vector payload (single-select)

Implements REQ-UI-SELECTION-CATEGORIES, REQ-UI-FIELD-MULTI-SELECTION and
the updated entity/scrap selection requirements.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7N59FsLA5e2kuVdqe4Uhc
2026-07-20 20:23:09 +02:00
388d354e51 Use std::optional instead of sentinel values for absent data
Replace sentinel values that signalled "no value" with std::optional
across simulation, UI, and balancing code:

- BuildingId references: DeliverScrapBehavior::deliveryBay,
  Simulation::m_hqBuildingId, the return types of BuildingSystem::place
  and Simulation::tryPlaceBuilding (previously kInvalidBuildingId on
  failure), GameWorldView building/site-at-tile lookups and demolish
  hover, SelectedBuildingPanel::m_singleBuildingId.
- Command id fields: the five id-carrying commands now hold
  optional<BuildingId>; CommandSerializer and Simulation::apply updated.
  The serialized replay format is unchanged.
- Index sentinels: BlueprintPanel::m_activeIndex,
  BalancingWindow::m_inspectedArenaIndex, ArenaSimulation winnerTeam,
  and the moduleIndex grid cells in ShipLayoutDialog/ShipLayoutPreview.
  ShipLayoutDialog::m_activeModuleIndex was a tri-state, so it is
  modelled as bool m_removeMode + optional<int>.

Building/ConstructionSite id defaults keep kInvalidBuildingId (identity,
not an absent reference); entt::null and config -1 domain values are
left as-is.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7N59FsLA5e2kuVdqe4Uhc
2026-07-20 07:36:34 +02:00
d412c69f82 Prefix all getters with "get" 2026-07-19 21:17:38 +02:00
9c1e948ab4 show selected ship's current behavior in sidebar panel 2026-07-14 21:19:14 +02:00
23ff406101 display faction in selected object name for hq and defence stations 2026-07-14 21:00:02 +02:00
2ea0cb815d fix issue where items on building's output port were not counted to output display in building panel 2026-07-14 20:50:43 +02:00
535d4f8f24 allow to (multi) select scrap 2026-07-13 21:09:01 +02:00
9d28175b17 Always show shipyard layout preview and Configure button, disabled until schematic selected 2026-07-13 20:45:03 +02:00
69fe607157 Show total building block cost in multi-selection panel (relevant for temporary blueprint) 2026-07-13 20:31:40 +02:00
dd7c997816 Auto-process smelter and reprocessing plant (no recipe selection) 2026-07-12 21:35:23 +02:00
808e0c6a7b Fix recipe button unclickable on construction site during play 2026-07-08 20:46:26 +02:00
e4ea4ca4b4 Refresh selected-building panel when paused player commands drain 2026-07-08 20:45:41 +02:00
fef22b9f86 Fix shipyard layout preview/button not showing until re-selection 2026-07-08 20:45:25 +02:00
18e732ae99 Remove schematic upgrades and module and ship levels 2026-07-02 21:32:36 +02:00
d74ba5bfad Replay: deterministic record & playback (#4)
Add deterministic record/playback for a run.

Recording captures `(seed, config hash, ordered tick-tagged commands)` and re-simulates on playback — no state snapshots. `DotaFactory.exe --replay <file>` re-plays a recorded run view-only with manual speed/pause.

Reviewed-on: #4
Co-authored-by: Malte Langkabel <malte.langkabel@gmail.com>
Co-committed-by: Malte Langkabel <malte.langkabel@gmail.com>
2026-07-01 19:20:08 +00:00
d271d65678 allow to set the recipe already for construction sites 2026-06-22 22:15:56 +02:00
c7218c7c1e Replace recipe/schematic dropdowns with button and selection dialog 2026-06-22 21:07:36 +02:00
3d577a11db fix bug where recipe combo stayed visible when construction site was selected 2026-06-21 21:54:15 +02:00
10c5ad678f derive threat cost dynamically 2026-06-13 22:47:46 +02:00
5317f35198 switch to using own event system 2026-06-13 17:52:22 +02:00
54a6056b77 implicit item locking 2026-06-12 16:14:21 +02:00
f097e9a25f add live ship stats panel 2026-06-07 22:06:37 +02:00
4e3e3ac715 replace combined stateUpdated signal with individual events 2026-06-05 18:27:46 +02:00
17e9913c98 wrap UI strings with tr() 2026-06-05 16:31:54 +02:00
b57299fd2a rename EntityId to BuildingId 2026-05-23 07:53:56 +02:00
d08bf5d37b implement ship modules 2026-05-18 08:54:26 +02:00
d64a7a5dd9 fix issue where construction sites could not be selected 2026-04-27 22:06:44 +02:00
fb83db98ab rename blueprint to schematic 2026-04-26 21:00:55 +02:00
89005d6bb7 implement tunnels 2026-04-26 17:15:50 +02:00
134f23d69b add splitter filters to ui 2026-04-25 21:27:39 +02:00
b21fc352b4 use new signals slots syntax 2026-04-24 22:29:13 +02:00
36d6842f71 show production progress 2026-04-22 20:40:08 +02:00
5e4d0aacc8 fix output display 2026-04-21 20:27:27 +02:00
c9c5c30b0d change input/output buffer item count display 2026-04-20 22:19:43 +02:00
507b5d1e3a fix issue where building stats don't update while the building is kept selected 2026-04-20 21:52:39 +02:00
a0de7a9f56 coordinate system fix and build fix 2026-04-20 21:06:06 +02:00
94123e93d6 implement ui 2026-04-20 20:33:37 +02:00