Commit Graph

52 Commits

Author SHA1 Message Date
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
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
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
c0b009c548 place the selection panel beside what it describes 2026-08-09 20:36:58 +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
980fad272f show the available controls in a panel over the world 2026-08-07 18:48:01 +02:00
1f754de431 resolve keyboard shortcuts through one action table instead of a switch 2026-08-07 18:47:29 +02:00
2289277e12 split the selection panel into one card per kind of selection 2026-08-07 18:38:55 +02:00
603f8063e9 float the selection panel over the game world instead of a side column 2026-08-06 22:06:42 +02:00
18cfe238f6 move blueprints out of the sidebar into Ctrl+C / Ctrl+V dialogs 2026-08-06 19:03:59 +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
58b94223f7 migrate every factory query off BuildingSystem onto the free functions 2026-08-05 06:46:13 +02:00
7017f8b4dc route the win-path restart through ResetCommand 2026-08-03 21:13:43 +02:00
d5ba72d554 add ModalPauseScope for the pause-around-modal idiom 2026-08-03 21:11:52 +02:00
83177729e9 extract MainWindow::reloadConfig 2026-08-03 21:11:02 +02:00
e02e323cb2 share a single ItemIconCache across the UI 2026-08-03 21:08:19 +02:00
594c3b93c5 make HeaderBar read block stock and expansion cost from the simulation 2026-08-03 21:04:43 +02:00
79b79ab7c3 Show building_block icon in header stock, expand button and build costs 2026-07-23 21:13:37 +02:00
f766ae4a86 Allow to draw produced-item icons in recipe dialog and game world 2026-07-23 20:54:04 +02:00
7c1455b8a0 add icons for build buttons 2026-07-22 21:44:20 +02:00
c21af63e84 deselect build tool when it becomes unaffordable and fix stale enabled button 2026-07-19 21:20:59 +02:00
d412c69f82 Prefix all getters with "get" 2026-07-19 21:17:38 +02:00
4b149d97a7 dim the game behind dialogs and escape menu 2026-07-13 22:11:21 +02:00
698dd4d13d auto-open layout dialog on manual schematic change 2026-07-13 20:47:37 +02:00
ac4d56764c Draw a thin border around each right-sidebar panel 2026-07-13 20:44:47 +02:00
ad3e73fdd8 Add tooltip for building blocks in header bar 2026-07-12 21:24:11 +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
18e732ae99 Remove schematic upgrades and module and ship levels 2026-07-02 21:32:36 +02:00
0a7e9a34ef Add artifact win condition (#3)
Reviewed-on: #3
Co-authored-by: Malte Langkabel <malte.langkabel@gmail.com>
Co-committed-by: Malte Langkabel <malte.langkabel@gmail.com>
2026-07-01 20:27:29 +00: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
123c544423 move ui panels to the right 2026-06-14 13:07:25 +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
ed17664ef1 fix bug where game simulation continues while dialog is shown 2026-06-13 14:31:03 +02:00
49f7129bd5 schematic selection dialog 2026-06-13 14:19:51 +02:00
af96b95f61 allow to unlock modules when destroying defence stations 2026-06-10 22:37:38 +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
d397b9969a ship layout blueprints 2026-05-19 21:41:19 +02:00
d08bf5d37b implement ship modules 2026-05-18 08:54:26 +02:00
71677b806a implement blueprints 2026-04-26 21:57:09 +02:00
b21fc352b4 use new signals slots syntax 2026-04-24 22:29:13 +02:00
78f746d352 implement load config on game restart 2026-04-22 22:53:56 +02:00
6321e13a00 fix keyboard shortcuts don't work after pressing in some button in the lower view 2026-04-21 21:24:51 +02:00
4c7b2fdcee implement demolish button 2026-04-21 21:12:17 +02:00
31b3abf0c1 implement escape menu 2026-04-21 20:58:57 +02:00
b7f2005504 add restart button to game over screen 2026-04-21 20:38:18 +02:00