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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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