Commit Graph

291 Commits

Author SHA1 Message Date
d70eb43dbb Reject items entering a transport tile through its output edge
Belts, splitters, and tunnels accepted items regardless of which edge
they arrived through, so a tile would take an item pushed into its own
output edge (e.g. two facing belts ping-ponged an item forever).

Add oppositeRotation() and an entersThroughOutputEdge() predicate, and
guard every acceptance site (tryPutItem, tryPushToTile, and the belt
transfer in moveItemsToNextTile) so an item entering through an output
edge is refused (REQ-MAT-ACCEPT-DIR). Building output-port deposits now
also refuse a belt that faces back into the building.

Update requirements (new REQ-MAT-ACCEPT-DIR; REQ-MAT-OUTPUT-PORT and
REQ-BLD-TUNNEL-ENTRY clarified) and tests (explicit feed direction on
direct deposits; new output-edge rejection cases per tile type).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DZR44tA8sn4dPqDzAVXyps
2026-07-14 10:36:39 +02:00
e04883a95f Implement REQ-UI-MODAL-DIM: dim game behind modals
Add a window-wide semi-transparent black scrim drawn over the entire
game window (header bar, game world view, side panel column) while any
auto-pausing modal or end-game screen is open, behind that modal.

- New ModalDimOverlay widget: a full-window, mouse-transparent child of
  MainWindow that paints the dim color. Visibility is reference-counted
  (pushModal/popModal) so nested or back-to-back modals show a single
  dim, not stacked layers; a ModalDimScope RAII guard drives it.
- Wire a guard around every modal opened from MainWindow: schematic
  choice, escape menu, layout dialog, recipe/schematic selection
  (spanning the auto-opened layout dialog), game-over, and win. The
  nested Create Blueprint dialog is covered by the layout-dialog dim.
- Config-driven color via visuals.toml [overlays].modal_dim, following
  the existing OverlayVisuals/parseColor pattern; refreshed on the
  Restart config-reload paths (REQ-CFG-RELOAD).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DZR44tA8sn4dPqDzAVXyps
2026-07-13 22:07:14 +02:00
d56125f737 Add REQ-UI-MODAL-DIM: dim overlay behind modals
Specify a transparent black scrim drawn over the entire game window
(header bar, game world view, side panel column) while any auto-pausing
modal is open — the escape menu, selection dialog, layout configuration
dialog, and schematic choice dialog — plus the game-over and win
screens. Nested modals show a single dim, not stacked layers. The
dim colour is config-driven via visuals.toml [overlays].

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DZR44tA8sn4dPqDzAVXyps
2026-07-13 21:54:15 +02:00
f1c77affae Tint not-yet-buildable asteroid area
Asteroid columns left of the buildable edge (x < -currentAsteroidWidth)
are reachable by the camera but not yet unlocked by expansion. Paint a
semi-transparent grey overlay over them so the locked area reads as
distinct from the buildable asteroid. The tint colour is config-driven
via overlays.locked_asteroid, matching the other overlay visuals.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DZR44tA8sn4dPqDzAVXyps
2026-07-13 21:38:37 +02:00
25cb23f66c Redefine camera scroll as view center
m_scrollXTiles now stores the world-X (tiles) at the center of the
viewport instead of its left edge. A new viewLeftTiles() helper derives
the left edge for the world<->widget conversions and tile culling, so
the half-viewport math lives in one place.

The view now opens centered on the asteroid/space edge and pans left
until the buildable edge is centered and right until the enemy stations
are centered (revealing a little space beyond them).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DZR44tA8sn4dPqDzAVXyps
2026-07-13 21:28:49 +02:00
7757bf4d48 Draw selection outline around selected scrap
Ring each selected scrap pile in the standard selection-outline color,
just outside its rendered circle, alongside the building outlines in
drawSelectionHighlights (REQ-UI-SCRAP-CLICK-SELECT).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DZR44tA8sn4dPqDzAVXyps
2026-07-13 21:04:22 +02:00
b97ab1edaa Implement scrap pile selection
Scrap piles become a third selection category: click to select (actors
win on overlap), box-drag / Ctrl+click multi-select, and the selected-
object panel shows the summed remaining amount, updating live and
dropping piles as they are collected or despawn.

- ScrapSystem: expose per-pile amount via ScrapInfo.
- EntityHitTest: add scrapAtWorldPos and scrapInBox (with tests).
- New header-only ScrapSelectionChangedEvent.
- GameWorldView: scrap selection member, click/box handling with the
  building-wins disambiguation, and per-frame pruning of gone piles.
- SelectedBuildingPanel: scrap event, "Scrap: N" label, live total;
  scrap and building/entity selections clear each other.

Implements REQ-UI-SCRAP-CLICK-SELECT, REQ-UI-SCRAP-MULTI-SELECT,
REQ-UI-SCRAP-PANEL.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DZR44tA8sn4dPqDzAVXyps
2026-07-13 20:58:28 +02:00
1c2f57e364 Add scrap selection requirements
Make scrap piles clickable as their own selection category, with
box-drag / Ctrl+click multi-select and a panel showing the total
remaining scrap amount. Add REQ-UI-SCRAP-CLICK-SELECT,
REQ-UI-SCRAP-MULTI-SELECT, REQ-UI-SCRAP-PANEL; update
REQ-UI-EMPTY-SELECTION, REQ-UI-MULTI-SELECT, and
REQ-UI-ENTITY-CLICK-SELECT accordingly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DZR44tA8sn4dPqDzAVXyps
2026-07-13 20:37:33 +02:00
ba0c10d54e Allow creating blueprints from construction sites
Blueprint capture and the Create Blueprint enable check previously
resolved each selected id via findBuilding() only, silently dropping
construction sites. Extract the capture logic into two testable lib/sim
helpers (captureBlueprintFromSelection, selectionHasPlaceableBuilding)
that resolve each id as an operational building or a construction site
alike, reusing readBuildingConfig for recipe/schematic/layout/splitter
config. BlueprintPanel now delegates to them.

Add regression tests covering site capture, site recipe capture, mixed
operational+site selection, and the placeable-selection predicate.

Implements REQ-UI-BLUEPRINT-CREATE / REQ-UI-BLUEPRINT-STORAGE.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DZR44tA8sn4dPqDzAVXyps
2026-07-13 19:35:17 +02:00
be8f95bd11 Allow creating blueprints from construction sites
Make explicit in REQ-UI-BLUEPRINT-CREATE and REQ-UI-BLUEPRINT-STORAGE
that a selected construction site is a valid blueprint source,
captured identically to an operational building.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DZR44tA8sn4dPqDzAVXyps
2026-07-13 18:47:10 +02:00
3476cebb9e Auto-open layout dialog when a new shipyard schematic is selected
Implement REQ-MOD-UI-AUTO-DIALOG: picking a new schematic for a shipyard
via the manual selection dialog now opens the layout configuration dialog
immediately. Only triggers on an actual schematic change; copy-settings
and blueprint placement are unaffected.

Extract the ShipLayoutDialog-opening logic into a reusable
MainWindow::openShipLayoutDialog helper. Because SetRecipeCommand is
queued and clears the layout, the auto-open passes the chosen schematic
and an empty layout explicitly rather than reading stale building state.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DZR44tA8sn4dPqDzAVXyps
2026-07-13 09:13:14 +02:00
2e657b63fe Add REQ-MOD-UI-AUTO-DIALOG: auto-open layout dialog on schematic change
Selecting a new schematic for a shipyard via the manual selection dialog
now auto-opens the layout configuration dialog. Excludes copy-settings
and blueprint placement; only triggers on an actual schematic change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DZR44tA8sn4dPqDzAVXyps
2026-07-13 08:05:21 +02:00
6dd8da4ff8 Always show shipyard layout preview and Configure button, disabled until schematic selected
The ship layout preview and Configure Layout button are now always shown
for a selected shipyard and disabled while no schematic is selected,
rather than being hidden. The preview shows an empty placeholder box in
that state. Update REQ-MOD-UI-PREVIEW to match.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DZR44tA8sn4dPqDzAVXyps
2026-07-13 07:40:21 +02:00
851eeff6f4 Draw a thin border around each right-sidebar panel
Enable WA_StyledBackground on the three side-panel sections and apply a
class-scoped stylesheet border so each panel gets a thin outline without
the rule cascading onto child widgets.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DZR44tA8sn4dPqDzAVXyps
2026-07-13 07:18:20 +02:00
eb1572cd80 Show total building block cost in multi-selection panel
Implement the REQ-UI-MULTI-SELECTION addition: the selected building
panel now shows the total placement cost of a multi-selection, counting
only player-placeable buildings (HQ and defence stations excluded).
Construction sites are charged their type's full cost.

Add a shared BuildingsConfig::findBuildingDef accessor and reuse it in
BlueprintPanel to remove the duplicated by-type lookup loops.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DZR44tA8sn4dPqDzAVXyps
2026-07-13 07:13:29 +02:00
9143cb1b40 Add total building block cost to multi-selection panel requirement
Extend REQ-UI-MULTI-SELECTION to show the sum of placement costs for
player-placeable buildings in the selection, excluding HQ/defence
stations, consistent with the blueprint total.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DZR44tA8sn4dPqDzAVXyps
2026-07-12 21:54:51 +02:00
2a4bd0b066 Auto-process smelter and reprocessing plant (no recipe selection)
Bring the code in line with REQ-BLD-SMELTER, REQ-BLD-REPROCESSING, and
REQ-UI-SELECT-BUTTON: the Smelter and Reprocessing Plant no longer require a
player-selected recipe.

Simulation: auto-recipe buildings init input caps from the union of their
type's recipe inputs, accept any matching item, and each idle tick run the
first recipe whose inputs are satisfied (reprocessing keeps its weighted roll).
setRecipe is a no-op for these types.

UI: the recipe-select button is hidden for auto-recipe buildings; the selected
building panel still shows buffers and production progress using the recipe
currently in production.

Tests: drop the obsolete setRecipe calls; add smelter auto-smelt coverage,
including the mixed-input case where a satisfiable recipe runs while an
incomplete batch of another input waits.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DZR44tA8sn4dPqDzAVXyps
2026-07-12 21:30:30 +02:00
3d4c0445d1 Add config-defined tooltip to header building blocks stock
Implement REQ-UI-BLOCKS-TOOLTIP: an optional world.toml
[world].building_blocks_tooltip, threaded into HeaderBar via a new
const GameConfig* parameter and shown as the building blocks stock label's
hover tooltip. Omitted when unset. Author the text in the app config and
extend ConfigLoaderTest to cover the field.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DZR44tA8sn4dPqDzAVXyps
2026-07-12 20:37:22 +02:00
cd8bf1a8b3 Add requirement for config-defined building blocks tooltip
Introduce REQ-UI-BLOCKS-TOOLTIP: an optional world.toml
[world].building_blocks_tooltip shown as the header bar's building blocks
stock hover tooltip. Note the optional field in the world.toml description.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DZR44tA8sn4dPqDzAVXyps
2026-07-12 18:23:51 +02:00
c4d696c79e Add config-defined tooltips to build and module buttons
Implement REQ-UI-BUILD-TOOLTIP and REQ-MOD-UI-MODULE-TOOLTIP: an optional
tooltip string on BuildingDef and ModuleDef, parsed from buildings.toml and
modules.toml and shown as the build/module button's hover tooltip. Omitted
when unset. Author descriptions for all buildings and modules in the app
config, and extend ConfigLoaderTest to cover the optional field.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DZR44tA8sn4dPqDzAVXyps
2026-07-12 17:56:09 +02:00
1add02eafa Add requirements for config-defined build/module button tooltips
Introduce REQ-UI-BUILD-TOOLTIP and REQ-MOD-UI-MODULE-TOOLTIP, and note
the optional tooltip fields in buildings.toml and modules.toml.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DZR44tA8sn4dPqDzAVXyps
2026-07-12 16:35:05 +02:00
129200ff4f Rename UI "Blocks" labels to "Building Blocks"
Make user-visible terminology consistent across the header bar, build
button grid, and blueprint panel.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DZR44tA8sn4dPqDzAVXyps
2026-07-12 15:15:41 +02:00
271855781c add tag based version info to exe 0.1.0 2026-07-12 09:16:49 +02:00
5f6ecbf6c8 implement visual feedback for copy building settings with shift + click gesture 2026-07-09 21:33:24 +02:00
cd966daba9 fix issue where shipyard produces ships with modules without requiring items for the modules if the ship's layout was never changed 2026-07-09 21:29:04 +02:00
88bc4f2170 fix bug where selecting the same ship again in a shipyard clears the layout and resets the progress 2026-07-09 21:05:01 +02:00
4986c1bac8 implement copy building settings with shift + click gesture 2026-07-09 20:29:20 +02:00
e110e7e413 Add T hotkey for temporary blueprint from selection 2026-07-09 20:25:15 +02:00
6274b5ce60 List unlocked recipes with tooltips in schematic choice dialog instead of unlocked item names 2026-07-09 20:22:17 +02:00
16ed6a5695 Show schematic id for all three types of drops in choice dialog 2026-07-09 20:18:38 +02:00
13dacab274 remove save and load buttons for factory blueprints to mirror the ship-layout blueprints 2026-07-09 20:15:30 +02:00
2ddf13238c Fix Salvage Bay drop-off not working by adding config-driven buffer capacity 2026-07-09 20:11:12 +02:00
cc38bf95fa make repair_tool less op 2026-07-09 07:20:06 +02:00
b58bcfe272 turn around salvage bay in config 2026-07-09 07:19:48 +02:00
de1ebb8a5f increase scroll speed across contest zone 2026-07-08 22:25:12 +02:00
24c18f8ac6 render HP bar below the HQ 2026-07-08 21:39:11 +02:00
2cedd5d433 fix issue where building selection outline is hidden by other buildings drawn later 2026-07-08 21:29:44 +02:00
f11db0c072 Add demolish box-drag interaction 2026-07-08 21:04:59 +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
cdf89ce0dd Restructure balancing docs into docs/balancing/ 2026-07-08 20:33:51 +02:00
e8786c3922 implement cost formula for asteroid expansion 2026-07-08 20:33:19 +02:00
fc622670d2 continue first full balancing round 2026-07-08 20:33:11 +02:00
e32d384c99 fix bug where balancing matches did not finish until enemy hq was destroyed 2026-07-08 20:31:33 +02:00
24e0999d8a show total time in balancing target arenas 2026-07-08 20:31:14 +02:00
fcaee000fa continue first full balancing round 2026-07-08 20:30:45 +02:00
751ef27a7b show team EHP in balancing target 2026-07-08 20:29:41 +02:00
3c1376828c implement logging of arena states 2026-07-08 20:29:33 +02:00
bd0675db66 continue first full balancing round 2026-07-08 20:29:23 +02:00