The simple economy is now the default and the old simulation is frozen as the hard model, selectable per game. A nation keeps one resource pool available in every region, fed by public production works rather than private per-region stores, and construction and training begin at once, paced by the region's spare power instead of gathering materials over days. Money is euro only: a per-inhabitant daily tax funds a treasury spent in a global market, where buy and sell lots trade against the world stock and move its price. The hard economy keeps its per-nation currencies, central banks and exchange rates. Simple games skip the price-settling warmup and economic migration; the snapshot carries the economy model, the market and the pool figures the client draws. Added the matching test suites and the design briefs under docs/simple_economy.
4.4 KiB
4.4 KiB
09 — UI changes (approval gate)
Depends on: all simulation modules. No UI change may be committed until the user has seen and approved a preview.
Process (mandatory)
Per AGENTS.md:
- Build a minimal standalone HTML example of the change first — the isolated element and each of its states, not a whole mocked-up screen. Keep it small and self-contained: link the stylesheet and copy in only the assets it needs. A short gallery of one example per visual change is the right size.
- Open it in the user's Firefox directly:
firefox <path>. Never render a screenshot and never just print the path. - Wait for approval. Only then wire it into the real client and commit.
- Do not add the examples to the repository.
Submit the UI work in small pieces (one element per preview) so each can be approved independently.
Changes to make
All changes are conditional on the snapshot's economyModel === "simple"; the
hard economy keeps its current UI.
1. National Resources tab → global market (client/js/modals/nation.js)
- Replace the read-only "Stores & trade" / "Major traders" content with a
market table: per resource, the player's pool amount, the market stock, the
current price, and Buy / Sell controls offering the lots
100,2 000,50 000. - Keep the resource icons/protos so it matches the existing look
(
RESOURCES,.resource-icon). - Wire each control to send the
market_tradeorder (net.js). - Show the treasury (
€) and the pool clearly; a purchase that the treasury cannot afford should be disabled or reported. - Decide whether to keep a separate "stores" summary; the pool replaces per-region stores, so a single pool row per resource is likely enough.
Related IDs in client/index.html: #tab-resources, #resources-sub,
#resources-subtabs, #resources-list.
2. National Economy tab (client/js/modals/nation.js)
- Remove the Taxes sub-tab (
#economy-taxes,_renderTaxes,_buildEconomySubtabs). Taxes tab is explicitly not needed. - Show the euro treasury and the single daily tax income line in the budget summary.
- In simple mode, hide the Currency, Central bank and Exchange rates
sub-tabs (
#economy-currency,#economy-central-bank,#economy-rates) since there is one currency and no FX. Keep "Private sector" only if it still means something; otherwise reduce the sub-tabs to what remains. - Ensure money everywhere reads
€(single symbol), viacurrency.js/setCurrency.
3. City modal (client/js/modals/city.js)
- The city build/train rows must no longer show a "gathering materials" phase in simple mode; show construction/training progress and the energy-based speed instead.
- The city Resources sub-tab should show the region's energy and the link to the player's pool, not per-region stores.
4. Game screen HUD (client/js/game_screen.js, client/js/game_screen/panels.js)
- Top bar / budget: show
€and tax income; no per-civ currency conversion. - If warmup was surfaced anywhere, drop it for simple.
5. Currency helper (client/js/currency.js)
- With one euro currency,
rateToNational,moneyTextandcurrencyForcan be simplified. Do not break hard mode: keep the multi-currency path when the snapshot is a hard game.
Files
client/index.htmlclient/js/modals/nation.js(large; the Resources and Economy tabs)client/js/modals/city.jsclient/js/game_screen.js,client/js/game_screen/panels.jsclient/js/currency.jsclient/js/net.js(sendmarket_trade)client/css/(stylesheet touched by any new market control)
Acceptance criteria
- In a simple game, no Taxes tab, no central-bank/exchange-rate view, no per-nation currency conversion; the Resources tab is a working market.
- Buying and selling from the UI updates the pool, treasury and price.
- In a hard game the existing UI is unchanged.
- Every visual change has been previewed in Firefox and approved before commit.
Notes / decisions
- One preview per element. The market row (with all lot states), the reduced Economy sub-tabs, and the build-row progress are three separate previews.
- Ask the user whether to keep "Major traders" anywhere; with a single global market it is probably redundant.
- The client never runs
GameState; all figures come from the snapshot, so make sure10-snapshot-and-orders.mdships everything these controls need.