Commit Graph

429 Commits

Author SHA1 Message Date
e6f4b66232 drop the glyph from the module button name
The glyph identifies a module on the layout grid, where it is drawn in the
cells the module occupies. On the selection button beside the module's name
it says nothing the name does not, so it goes -- and REQ-MOD-UI-DIALOG,
which asked for it, with it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ne3mejABZoLWKLh8fgpM3x
2026-08-11 21:37:34 +02:00
5998f9f190 size option buttons to the face they carry
QPushButton derives its size hint from its text and icon and ignores a
layout set on it, so the recipe options, the shipyard schematic options and
the layout dialog's module buttons all measured themselves as empty and
clipped the name and recipe line drawn on them.

OptionButton takes the hint from its layout instead and lets the style add
what the button frame needs, so the padding stays the platform's rather
than a number picked here. It falls back to QPushButton's own hint when
there is no layout, which is what the "(None)" option uses. The module
buttons drop their fixed height with it and take what their cost line
needs.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ne3mejABZoLWKLh8fgpM3x
2026-08-11 21:30:52 +02:00
b7b5a92dbb draw recipes wherever the UI states what something makes
Implements the requirements of 0bf24a7. Recipes were explained in prose:
the recipe dialog was a grid of icon-only buttons with a text tooltip
listing name, inputs, time and output, the unlock-choice dialog listed
recipe names with the same tooltip, an item chip said nothing about where
its item came from, and a module button never showed its cost.

RecipeLineRow is the one widget that draws a recipe -- optional building
chip and name, inputs, arrow, outputs, time -- and every place that states
what something makes now goes through it: the panel's recipe summary (which
it replaces RecipeSummaryRow for), the selection dialog's option buttons,
the item production tooltip, the unlock-choice dialog's recipe lines, the
module buttons' cost lines, and the layout dialog's build cost. Its arrow
is drawn only where there are outputs, so a shipyard summary no longer
points at nothing.

ItemProducers answers where an item comes from, filtering by unlock state
per building type, and ItemTooltip draws it as a window of its own -- Qt's
tooltips are text, this one has item squares and building chips in it.
ItemChip pops it after a hover delay.

The selection dialog becomes one scrolling vertical column of buttons, each
showing its name over its recipe line, and no dialog carries a tooltip any
more. RecipeTooltip and recipes.toml's unused "icon" field go with the
behavior they served.

Two requirement amendments the implementation forced, both in this commit:
the option column scrolls when taller than the window allows, and a Smelter
or Reprocessing recipe is listed once its building is unlocked, those
recipes carrying no unlock of their own. The layout dialog's build cost
also moved out of the shared ShipStatsPanel, which the balancing tool
compiles directly and is deliberately kept free of the icon caches.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ne3mejABZoLWKLh8fgpM3x
2026-08-11 21:20:40 +02:00
0bf24a7c62 show recipes visually instead of describing them in text
Recipes were explained in prose: the recipe selection dialog was a grid of
icon-only buttons whose hover tooltip listed the recipe name, its inputs,
its time and its output, and the unlock-choice dialog listed recipe names
with the same tooltip. The player had to hover every option to learn what
it made, and an item in a buffer said nothing about where it came from.

Retires REQ-UI-RECIPE-ICON and REQ-UI-SELECT-TOOLTIP, whose behavior is
gone, and adds:

* REQ-UI-SELECT-OPTIONS -- the selection dialog is a vertical column of
  buttons, each showing the recipe name (or ship display name) over that
  recipe drawn as the recipe summary line draws it. No tooltips: the
  button face is the whole description.
* REQ-UI-ITEM-TOOLTIP -- hovering an item chip in the selection panel
  shows the item's name, "Produced by", and one line per unlocked recipe
  producing it, each with the running building's icon, the recipe name and
  its summary. Scrap reads "Salvaged from debris"; an item whose every
  recipe is locked reads "Undiscovered".

The unlock-choice dialog's "Unlocks recipes" list uses the same recipe
line and loses its tooltip too (REQ-DEF-SCHEMATIC-DROP), and the layout
configuration dialog gains the same treatment for modules: a module button
states its material cost and added production time, and the stats panel
shows the configured layout's running total (REQ-MOD-UI-DIALOG,
REQ-MOD-UI-STATS-PANEL).

Drops recipes.toml's optional "icon" field, whose only consumer was the
icon-only option button and which no shipped recipe sets.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ne3mejABZoLWKLh8fgpM3x
2026-08-11 15:51:53 +02:00
97531ed217 open the panel's modals on the panel
Implements REQ-UI-PANEL-MODAL. The recipe/schematic selection dialog and
the ship layout configuration dialog are both opened from controls inside
the selection panel, but Qt centered them on the game window, sending the
cursor back across the view and then back again.

MainWindow::placeOnSelectionPanel() centers a dialog on the panel's live
global rectangle -- so a dragged panel carries the modal with it -- and
clamps it into the window without resizing it, clamping the far edge
before the near one so a dialog too large for the window lands on the
window's top-left corner. It is called on the constructed dialog before
exec(), which also stops QDialog from re-centering it on show.

Placement is all that changes: modality, the auto-pause, the modal dim and
dismissal are untouched, as are the modals not opened from the panel.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ne3mejABZoLWKLh8fgpM3x
2026-08-11 12:22:00 +02:00
11de38cf1f open selection panel modals on the panel
Adds REQ-UI-PANEL-MODAL: a modal opened from a control inside the
selection panel is centered on the panel's current rectangle instead of
on the game window, so the cursor does not have to travel back across
the view and return. Covers the two modals the panel opens -- the
recipe/schematic selection dialog and the layout configuration dialog,
including its auto-open after a schematic change.

Fixes the placement to the panel's rectangle as it currently stands, so
a dragged panel carries the modal with it; clamps the modal inside the
game window without resizing it; leaves modality, auto-pause, the modal
dim and dismissal untouched; and excludes every modal not opened from
the panel, including one opened from another modal.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ne3mejABZoLWKLh8fgpM3x
2026-08-11 11:54:31 +02:00
9dd61b6e64 draw item icons on their colored square in the UI
Item icons were drawn bare in the panels and dialogs while only the game
world composed them onto the item's visuals.toml square, so the same item
read differently on a belt than in a panel.

Move the composition into ItemIconCache, which now holds the visuals and
offers it in two forms: paintItem() for the world's fractional geometry
and getSquarePixmap() for widgets. WorldRenderer::drawWorldItem collapses
onto the former, and the recipe-selection dialog, the selection panel's
item chips and the recipe summary onto the latter. The inset fraction
that shapes the composition now has one definition instead of two.

An item with no icon file now shows its square alone rather than falling
back to text, so callers gate on the composed pixmap being null -- the
case of an item with neither square nor icon -- instead of on hasIcon().
The inline building_block icon beside a number keeps using the bare
getPixmap() and takes no square.

The chip and summary squares are drawn a few pixels larger than the icons
were, so the artwork keeps its size once the square insets it. Reloading
the visuals on a restart drops the composed pixmaps, which carry the
colors they were painted with (REQ-CFG-RELOAD).

REQ-UI-ITEM-ICON, REQ-UI-RECIPE-ICON, REQ-UI-SINGLE-SELECTION,
REQ-UI-RECIPE-SUMMARY, REQ-UI-HQ-PANEL

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ne3mejABZoLWKLh8fgpM3x
2026-08-11 09:33:19 +02:00
c15f09855c color item icon backgrounds in the UI from visuals.toml
Item icons shown in the UI panels and dialogs were drawn bare; only the
game world composed them onto the item colored square. Extend the square
to every place the UI displays an item as an item: the recipe-selection
dialog option buttons, the selection panel item chips, and the recipe
summary. The inline building_block icon standing in for the word "Blocks"
beside a number stays bare, being a text decoration rather than an item
display.

REQ-UI-ITEM-ICON, REQ-UI-RECIPE-ICON, REQ-UI-SINGLE-SELECTION,
REQ-UI-RECIPE-SUMMARY, REQ-UI-HQ-PANEL

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ne3mejABZoLWKLh8fgpM3x
2026-08-11 08:54:10 +02:00
37378e3c1b allow to move the selection panel via mouse drag 2026-08-09 22:09:41 +02:00
37a7a7499a update item box color to yield better contrast 2026-08-09 21:34:31 +02:00
5794a51c9a draw boxes around item icons 2026-08-09 21:20:47 +02:00
09858f4b62 keep an auto-recipe building's summary between its cycles 2026-08-09 20:41:48 +02:00
ca49b9dbec let the world renderer hold the simulation by const reference 2026-08-09 20:37:15 +02:00
79650ae211 make EntityAdmin::hasAll const 2026-08-09 20:37:09 +02:00
c0b009c548 place the selection panel beside what it describes 2026-08-09 20:36:58 +02:00
7ae5f8c4dc fix selection panel contents 2026-08-07 22:01:10 +02:00
9f574fa05e fix issue where the selection panel sometimes collapses to very small size 2026-08-07 21:17:53 +02:00
e5d689c8d8 document the player-input design in architecture.md 2026-08-07 20:43:12 +02:00
0b8f5eccd6 scroll the controls panel's rows instead of clipping them 2026-08-07 20:42:56 +02:00
40415e663b put the controls panel in the corner and let it step around the build bar 2026-08-07 20:42:41 +02:00
7a098edf72 mark the exit row of the controls panel red on its chips instead of its label 2026-08-07 19:52:51 +02:00
365641feb7 size the controls panel to the rows it is actually showing 2026-08-07 19:38:10 +02:00
4b5e288632 record that additive selection is offered only once something is selected 2026-08-07 19:10:26 +02:00
cab7244b00 divide the always-available rows in the General context too 2026-08-07 19:10:04 +02:00
980fad272f show the available controls in a panel over the world 2026-08-07 18:48:01 +02:00
68a43a7d98 resolve mouse gestures through the action table too 2026-08-07 18:47:43 +02:00
1f754de431 resolve keyboard shortcuts through one action table instead of a switch 2026-08-07 18:47:29 +02:00
f61f0bf761 add requirements for a context-sensitive controls panel floating over the game world 2026-08-07 18:47:15 +02:00
075e44d295 give the selection cards their own parts instead of label blobs 2026-08-07 18:43:23 +02:00
2289277e12 split the selection panel into one card per kind of selection 2026-08-07 18:38:55 +02:00
cc0ef856e3 make asteroid smaller 2026-08-06 22:14:02 +02:00
603f8063e9 float the selection panel over the game world instead of a side column 2026-08-06 22:06:42 +02:00
3b37b0ecf8 target single-building transfers by hovering, not by footprint coincidence 2026-08-06 20:31:51 +02:00
98deab932a let any blueprint transfer configuration, not just single-building ones (if the orientation matches) 2026-08-06 20:29:20 +02:00
08d8b0dd90 re-cover copy-settings through single-building blueprints 2026-08-06 19:44:55 +02:00
9a3b6c10d6 fix bug where selecting the same layout for a shipyard discarded the current progress and buffers 2026-08-06 19:18:45 +02:00
cd31af2611 remove the Shift copy-building-settings gesture 2026-08-06 19:09:11 +02:00
fd6a7c5815 rekey the temporary blueprint to C, add V to re-place it 2026-08-06 19:07:13 +02:00
18cfe238f6 move blueprints out of the sidebar into Ctrl+C / Ctrl+V dialogs 2026-08-06 19:03:59 +02:00
2cbcf1554f add the ASCII-only source rule and the visual-verification note to CLAUDE.md 2026-08-06 08:28:57 +02:00
c1af58d80c float the build buttons as a horizontal bar over the game world and show key bindings inside build buttons 2026-08-06 08:28:40 +02:00
f39fe9a118 move the debug stats panel out of the renderer 2026-08-05 22:14:55 +02:00
e5dcb9de5f extract WorldRenderer 2026-08-05 22:14:55 +02:00
dc83add5c6 move two placement queries out of the view into PlacementRules 2026-08-05 22:14:54 +02:00
3a1951559d share the world shapes both views (game and balancing) draw identically 2026-08-05 22:14:54 +02:00
26d7448492 extract BuildModeController, fixing a silent blueprint exit 2026-08-05 22:14:54 +02:00
202f583067 extract SelectionController 2026-08-05 22:14:54 +02:00
d5ab44b9bf move the remaining hotkeys into the InputMapper 2026-08-05 22:14:53 +02:00
bb1ffab8fc fix a bug where view continues to pan when window lost focus while panning 2026-08-05 22:14:53 +02:00
e1445fe508 move the already-event-driven hotkeys into the InputMapper 2026-08-05 22:14:53 +02:00