Commit Graph

339 Commits

Author SHA1 Message Date
a83dd33c5c Make railgun S/M/L distinct via barrel count (1/2/3)
Railgun M was a single barrel like S, so they read the same at 16px.
Reworked M to two barrels and L to three (was two), giving a clear
1/2/3-barrel tier ladder. viewBoxes tightened to fill the slot.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7N59FsLA5e2kuVdqe4Uhc
2026-07-23 21:28:08 +02:00
4461d17737 Tighten item icon viewBoxes so art fills the slot
Each icon's viewBox is set to a square box around its actual content
(with a stroke-width margin + small breathing room), leaving the path
data unchanged. Under-filled icons (ingots, plates, silicon, etc.) now
scale up and recenter to fill the half-tile item slot; already-full
icons are left as-is (clamped to only ever zoom in). Fixes items looking
too small in the game world.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7N59FsLA5e2kuVdqe4Uhc
2026-07-23 21:23:43 +02:00
b631de5ea3 Show building_block icon in header stock, expand button, build costs
Header stock reads "Stock: <n>" + block icon; the expand button and each
build button show the block icon in place of the "Blocks" word
(REQ-UI-BLOCKS-ICON, REQ-UI-EXPAND-BUTTON, REQ-UI-BUILD-COST).

New IconCaption::renderCaptionWithIcon composes "text + trailing icon"
into one pixmap (Qt buttons/labels can't place an icon after text). The
header label uses it as a pixmap; the expand button as its QIcon (Normal
+ greyed Disabled). Build buttons need both the building chip and the
block icon, so a custom-painted BuildButton draws the whole face,
adaptive to width and greying when unaffordable. All paths fall back to
text when no building_block icon exists. Item icon dir threaded through
MainWindow to HeaderBar and BuildButtonGrid.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7N59FsLA5e2kuVdqe4Uhc
2026-07-23 21:11:14 +02:00
b9b812e264 Show building_block icon in header stock, expand button, and build costs
Header stock reads "Stock: <n>" + block icon (REQ-UI-BLOCKS-ICON); the
expand button (REQ-UI-EXPAND-BUTTON) and build-button costs (REQ-UI-BUILD-COST)
show the icon in place of the "Blocks" word. All fall back to text when the
icon file is missing (REQ-UI-ITEM-ICON).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7N59FsLA5e2kuVdqe4Uhc
2026-07-23 20:47:49 +02:00
c909920ac9 Give building_block icon a paneled cube (more structure)
Recessed panel inset per face on the isometric cube, replacing the flat
faces, per Malte's request for more structure.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7N59FsLA5e2kuVdqe4Uhc
2026-07-23 20:04:25 +02:00
09e7e6b2e8 Add item icon art for all 41 item types
Self-contained full-color SVGs in data/icons/items/, one per item id, read
by the recipe-selection dialog (REQ-UI-RECIPE-ICON) and belt/port rendering
(REQ-UI-ITEM-ICON). Bold silhouette + dark outline, authored to stay legible
at ~16px belt size: rocky ore chunks, isometric ingots, riveted plates,
copper coil/wire, pictorial module devices, and dart hull silhouettes tinted
per fleet color. No config changes needed — each recipe's icon resolves to
its first output.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7N59FsLA5e2kuVdqe4Uhc
2026-07-23 19:29:33 +02:00
6a317a52b1 Render produced-item icons in recipe dialog and game world
Implements REQ-UI-ITEM-ICON and REQ-UI-RECIPE-ICON. Adds an optional
recipes.toml `icon` field (an item id; defaults to the recipe's first
output). New ItemIconCache loads per-item SVGs from icons/items and
caches pixmaps per target pixel size, shared by:
- the Miner/Assembler recipe-selection dialog, which now shows icon-only
  option buttons (name-caption fallback when no icon file exists), and
- GameWorldView belt/port item rendering via a shared drawWorldItem
  helper (colored-square fallback preserved).

Shipyard schematic dialog is unchanged. No icon art is shipped; every
path falls back cleanly when an item has no SVG.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7N59FsLA5e2kuVdqe4Uhc
2026-07-23 14:43:51 +02:00
1cc4175071 Add item-icon requirements for recipe dialog and world rendering
Introduce REQ-UI-ITEM-ICON (item icons on belts/ports, colored-square
fallback, per-pixel-size raster cache) and REQ-UI-RECIPE-ICON (icon-only
recipe options in the Miner/Assembler selection dialog). Document the
optional recipes.toml `icon` field and cross-reference from
REQ-GW-TILE-SIZE and the visuals.toml config description.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7N59FsLA5e2kuVdqe4Uhc
2026-07-23 14:10:58 +02:00
51e45e10a1 Rename scrap-drop entity to "debris" in code and config
Implements the requirements rename in the codebase. The salvageable object
dropped by destroyed ships and defence stations is now the "debris" entity;
the scrap resource it yields (cargo, delivery, smelting, threat,
scrap_drop_formula, scrap_per_threat) is unchanged.

Entity renames: ScrapDataComponent->DebrisComponent, ScrapSystem->DebrisSystem,
ScrapInfo->DebrisInfo, ScrapSelectionChangedEvent->DebrisSelectionChangedEvent
(member scrap->debris), spawnScrap->spawnDebris, getScraps->getDebrisSystem,
getAllScrapInfo->getAllDebrisInfo, scrapAtWorldPos/scrapInBox->debris*,
SalvageScrapBehavior::scrapTarget->debrisTarget, PendingCollection::scrap->debris,
ScrapTest.cpp->DebrisTest.cpp. Config key scrap_despawn_seconds->
debris_despawn_seconds (WorldConfig.scrapDespawnSeconds->debrisDespawnSeconds).
The salvage/deliver behavior classes keep their names (they act on the scrap
resource).

Also implements the new REQ-UI-DEBRIS-PANEL behavior in SelectedBuildingPanel:
a single selected piece of debris shows a "Debris" heading plus a "Scrap" stat
row; a multi/mixed field selection appends "Debris x N" and "Scrap x N" lines.

Updates the four renamed REQ-ID references in comments/docs, plus architecture.md
and derived.md. All 449 test cases pass; app, tests, and balancing targets build.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7N59FsLA5e2kuVdqe4Uhc
2026-07-23 13:10:04 +02:00
cccc464b43 Rename ship/station scrap drops to "debris" in requirements
The salvageable object dropped by destroyed ships and defence stations is
now named "debris" (it carries a scrap amount), resolving the overload
where "scrap" meant both the resource and the dropped object. Renames the
REQ-*-SCRAP-* selection/drop requirement IDs to REQ-*-DEBRIS-*, adds a
single-debris stats panel and mixed field-selection summary, and renames
the scrap_despawn_seconds config key to debris_despawn_seconds. The scrap
resource, scrap_drop_formula, and scrap_per_threat are unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7N59FsLA5e2kuVdqe4Uhc
2026-07-23 12:29:20 +02:00
9915c2ade4 Show refund-percentage tooltip on Deconstruct button
The build grid's Deconstruct button now sets a hover tooltip composed
from world.refund_percentage (REQ-UI-DECONSTRUCT-BUTTON,
REQ-BLD-DECONSTRUCT): it states the partial refund for finished
buildings and the full refund for construction sites, collapsing to a
single-case wording when the percentage is 100%.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7N59FsLA5e2kuVdqe4Uhc
2026-07-23 11:33:31 +02:00
a7636cd1ba Add refund-percentage tooltip to Deconstruct button requirement
REQ-UI-DECONSTRUCT-BUTTON now specifies a hover tooltip stating both
deconstruction refund cases (partial for built buildings, full for
construction sites), collapsing to one case when refund_percentage is
100%. REQ-UI-BUILD-TOOLTIP reconciled to point at it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7N59FsLA5e2kuVdqe4Uhc
2026-07-23 11:24:43 +02:00
3d27213997 Make world building icons uniform size and crisp
Draw every world building icon at a fixed size (1.25x tile, centered on the
footprint) so all buildings' icons read at the same size regardless of
footprint, and a little larger than before. Render the icon as vector via a
cached QSvgRenderer at the view scale each draw instead of downscaling a
pre-rasterized pixmap, which was blurry. Center the construction-site icon on
the footprint with the progress percentage bottom-aligned.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7N59FsLA5e2kuVdqe4Uhc
2026-07-23 07:15:05 +02:00
4baab16794 Render building icons in the game world
Draw each building's icon glyph over its footprint fill in place of the text
identity glyph (REQ-UI-WORLD-ICON): production buildings, HQ, and defence
stations. GameWorldView pre-renders each type's icon (chip background stripped)
in a white and a dark variant and picks the contrasting one by fill luminance;
belts, splitters, and tunnels are excluded and keep their tile/text rendering.
Wired into operational buildings, construction sites (icon + progress), stations
(previously letterless), and the builder/blueprint ghost. Update the requirement
wording from "white glyph" to a contrasting ink.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7N59FsLA5e2kuVdqe4Uhc
2026-07-22 22:36:56 +02:00
ef0191132b Exclude belts/splitters/tunnels from world icons
Update REQ-UI-WORLD-ICON: in-world building icons apply to the production
buildings, HQ, and defence stations only. Belts, splitters, and tunnels keep
their existing tile rendering so orientation/flow stays readable; their build
buttons still use icons, and tunnel_entry.svg is a build-button icon only.
Adjust the visuals.toml glyph note accordingly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7N59FsLA5e2kuVdqe4Uhc
2026-07-22 22:13:26 +02:00
3a25de6c22 Add HQ and station icons; redesign tunnel build-button icon
Add hq.svg (flag-base command building) and station.svg (shield, rendered
glyph-only over each side's fill) for in-world building icons. Redraw
tunnel_entry.svg as the shared Tunnel build button: the belt runs on the
surface at both ends and drops straight into/out of the ground, with rounded
corners and a single exit tip. No belt/splitter/tunnel world icons.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7N59FsLA5e2kuVdqe4Uhc
2026-07-22 22:11:36 +02:00
d563f5d658 Require building icons in the game world
Add REQ-UI-WORLD-ICON: buildings render their icon's glyph symbol centered on
the footprint (over the existing fill), replacing the letter identity glyph,
with a text-glyph fallback for types without an icon file. Update
REQ-UI-CONSTRUCTION-PROGRESS and the visuals.toml config summary accordingly;
port glyphs are unaffected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7N59FsLA5e2kuVdqe4Uhc
2026-07-22 20:36:50 +02:00
2e8ed40841 Document build button grid icons in requirements
Add REQ-UI-BUILD-ICON (per-building SVG chip icons loaded from
data/icons/buildings/) and extend REQ-UI-BUILD-DISABLED to cover the greyed
icon variant shown for unaffordable buildings.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7N59FsLA5e2kuVdqe4Uhc
2026-07-22 20:06:59 +02:00
c479291c1b Reapply build button grid icons
Revert of "Undo build button grid icons" (614dda8): restore the per-building
SVG icons, the QtSvg-based icon loading in BuildButtonGrid, the icon dir
plumbing in MainWindow, and the Qt5::Svg dependency.

This returns the unlock-groups branch to having the icons. The preceding
undo commit exists only so the Demolish -> Deconstruct rename can be
cherry-picked on its own (rename+icons commit together with the undo).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7N59FsLA5e2kuVdqe4Uhc
2026-07-22 19:48:15 +02:00
614dda8daf Undo build button grid icons
Remove the per-building SVG icons and all their wiring (the icon assets,
the QtSvg-based icon loading in BuildButtonGrid, the icon dir plumbing in
MainWindow, and the Qt5::Svg dependency), leaving only the Demolish ->
Deconstruct rename from the previous commit.

This is the inverse of the icon half of the previous commit, paired with a
following revert that re-adds the icons. Cherry-picking the previous
"rename + icons" commit together with this undo reconstructs the rename on
its own.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7N59FsLA5e2kuVdqe4Uhc
2026-07-22 19:47:58 +02:00
ae41f677e6 Rename Demolish to Deconstruct; add build button grid icons
Rename the Demolish* terminology to Deconstruct* across the simulation,
events, UI, tests, and docs (DemolishCommand and the DemolishMode* events
become their Deconstruct* equivalents), aligning with the deconstruction
queue at HEAD.

Add per-building SVG icons for the build button grid (REQ-UI-BUILD-GRID):
one color-chip icon per placeable building under data/icons/buildings,
loaded from disk at runtime and rendered with QtSvg onto each build button.
An unaffordable building's button shows a grey-recolored variant via a
QIcon Disabled-mode pixmap (REQ-UI-BUILD-DISABLED). Adds the Qt5::Svg
dependency and deploys Qt5Svg.dll.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7N59FsLA5e2kuVdqe4Uhc
2026-07-22 18:38:18 +02:00
1914705ab9 Implement the deconstruction queue
Demolishing a fully-built building now queues it for timed deconstruction
(world.toml deconstruction_time_seconds, default 0.1) running in parallel
with the construction queue, instead of removing it instantly. The partial
refund is credited on completion. A queued building stops operating at once
(belt/tunnel/splitter tiles unregister from the belt subsystem, re-pairing
tunnels) but keeps occupying its tiles. Construction sites are still removed
instantly with the full refund.

Clicking a queued building un-queues it (new CancelDeconstructionCommand);
a demolish drag-box un-queues all covered built buildings when they are all
already queued, otherwise queues the rest. Queued buildings render with the
demolish tint. Implements REQ-BLD-DECON-QUEUE and the updated
REQ-BLD-DEMOLISH / REQ-BLD-DEMOLISH-CLICK / REQ-BLD-DEMOLISH-BOX /
REQ-BLD-TUNNEL-PAIR.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7N59FsLA5e2kuVdqe4Uhc
2026-07-22 12:59:27 +02:00
aec65446d5 Add deconstruction queue to demolition requirements
Demolishing a fully-built building now queues it for timed
deconstruction (parallel to the construction queue) rather than
removing it instantly; construction sites are still removed
instantly. Adds REQ-BLD-DECON-QUEUE and updates REQ-BLD-DEMOLISH,
REQ-BLD-DEMOLISH-CLICK, REQ-BLD-DEMOLISH-BOX, and REQ-BLD-TUNNEL-PAIR.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7N59FsLA5e2kuVdqe4Uhc
2026-07-22 11:22:59 +02:00
1f339bd8d7 Implement config-driven unlock groups
Lift unlocking into first-class unlock groups defined in unlocks.toml, so
one defence-station drop can grant a bundle of ships/modules/buildings/
recipes at once (e.g. the salvager module + salvage bay), and buildings
can now be locked at game start and unlocked via a drop.

Config:
- New UnlocksConfig + ConfigLoader::loadUnlocks + validateUnlocks (unknown/
  duplicate/non-assembler grants, unknown requires, empty group all fail load).
- Drop unlock_at_station_level/unlock_requires from ship/module/recipe defs;
  add unlocked_at_start bool to recipes for graph-unreachable base recipes.

Simulation:
- Track awarded groups + per-building unlock state; an item starts unlocked
  iff no group grants it. Rework generateSchematicChoices/applySchematicChoice
  to operate on groups (grant all members at once). Extend state checksum.
- isBuildingUnlocked query; tryPlaceBuilding rejects locked types.

UI:
- Build-menu buttons for locked buildings start hidden, revealed via a new
  UnlockedBuildingsChangedEvent (emitted from GameWorldView's poll loop).
- Schematic choice dialog lists a group's granted items.
- Blueprint placement excludes locked building types (REQ-LOCK-UI-BLUEPRINT).

Data: unlocks.toml (app + test) reproduces the prior per-item gates as
singleton groups and adds salvage_operations (salvager + salvage_bay, lvl 1)
and reprocessing (reprocessing_plant, lvl 2).

Tests: rewrote unlock/config/recipe-schematic/artifact/wave/shipyard tests
for the group model; added UnlockGroupTest. All 443 cases pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7N59FsLA5e2kuVdqe4Uhc
2026-07-21 22:38:38 +02:00
8dc76284e6 Spec unlock groups: config-driven grouped unlocks
Replace the per-config unlock fields (unlock_at_station_level,
unlock_requires) with a first-class unlock-group concept defined in a
new unlocks.toml. An unlock group is now the unit of loot: awarding one
grants all its members (ships, modules, buildings, assembler recipes) at
once, so a building and a module can be unlocked together.

- Buildings become lockable (REQ-LOCK-BUILDING); locked types are hidden
  from the build grid and skipped in blueprint placement.
- Items absent from every unlock group start unlocked (replaces -1).
- New unlocked_at_start flag on assembler recipes for graph-unreachable
  base recipes (e.g. building blocks).
- Group display name derived from id for now; no display_name field yet.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7N59FsLA5e2kuVdqe4Uhc
2026-07-21 21:53:45 +02:00
a8a6a04f1e Highlight tunnel connections in green when selected 2026-07-21 21:16:21 +02:00
a75222f111 Never rotate tunnels in place 2026-07-21 21:14:27 +02:00
9b63af6ccb Unify tunnel build mode into a single Tunnel button 2026-07-21 21:12:06 +02:00
4ca5b332cd Snap belt-drag end tile to a building's input edge 2026-07-21 21:09:07 +02:00
0c4eb480be Update belt drag L-path immediately on rotate 2026-07-21 21:06:54 +02:00
b2c1ea34fd Implement deferred L-shaped belt drag placement 2026-07-21 21:05:31 +02:00
1cbc695bc5 Add building status light 2026-07-20 22:19:58 +02:00
c7ecce6ac4 make empty layout cells pulse while module is selected 2026-07-20 22:15:26 +02:00
be475e2836 allow multi-select for ships/stations, mixable with scrap 2026-07-20 21:03:11 +02:00
9622fa4345 Use std::optional instead of sentinel values for absent data 2026-07-20 20:27:20 +02:00
1cdafb7bcd draw glyph for output port at the target tile during build mode 2026-07-19 22:30:03 +02:00
f205136e21 show tooltip for artifacts in the header bar 2026-07-19 22:16:04 +02:00
b708e1b29d Add demolish-mode vignette 2026-07-19 21:51:12 +02:00
c76ba07bc7 Correct top game speed step to 10x in requirements 2026-07-19 21:37:47 +02:00
b2e7e4897a Add paused-state vignette border to game world view 2026-07-19 21:34:56 +02:00
c21af63e84 deselect build tool when it becomes unaffordable and fix stale enabled button 2026-07-19 21:20:59 +02:00
a4267a4760 Fix bug where restart fast-forwarded the new run by the time spent in a modal dialog 2026-07-19 21:19:36 +02:00
d412c69f82 Prefix all getters with "get" 2026-07-19 21:17:38 +02:00
08752aeced fix building blocks tooltip 2026-07-19 21:14:31 +02:00
d465671cfc draw beam wider at the source than at the target 0.1.1 2026-07-14 21:52:05 +02:00
76812ba0c5 show "+ installed modules" in ship selection dialog tooltip 2026-07-14 21:23:05 +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
876b344b20 fix issue where splitters were draggable during placement like belts 2026-07-14 20:35:47 +02:00