Routers: the picture only in the POP overview
The list of other models goes back to its badges; only the model a POP runs shows its picture.
This commit is contained in:
parent
73e11349dc
commit
78d2b7c8c9
3 changed files with 4 additions and 4 deletions
|
|
@ -10,7 +10,7 @@ All notable changes to this project are documented here. The project follows
|
|||
|
||||
## [2.0.0] — 2026-10-29
|
||||
|
||||
- Every router model has its own picture: open a POP's routers to meet the one you have, and the others when you compare models.
|
||||
- Every router model has its own picture: open a POP's routers to meet the one it runs.
|
||||
- A new Architect run every week: every Sunday a fresh HQ somewhere in the world and six or seven briefs, each built around the network you already have, with its own stars. Sites can outgrow their tubes, so some briefs are about making room. Later briefs stay a surprise in every Architect run: their cities only appear when they come.
|
||||
- In puzzles, the map now shows whether the tubes between two cities share one trench or take separate paths, at any zoom: one trench is drawn as a bundle with a "2× one trench" tag, separate paths bow apart with a "2 paths" tag.
|
||||
- Every puzzle now has the chaos monkey: when your build earns a new star, it runs round the map snipping each trench and cable in turn, and the cities that lose traffic say how much. Let it loose again whenever you like, or skip straight to the stars.
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ function waveOk(a,b,i){return [a,b].every(c=>i<=RG[S.pops[c]?(S.pops[c].rgen||0)
|
|||
function waveNeed(i){const g=RG.find(r=>r.maxLT>=i);return g?tr('sites_and_service.pn_routers',{pn:g.pn}):'?';}
|
||||
function routerModels(c){const p=S.pops[c],g=p.rgen||0,rt=p.routers||1;
|
||||
return `<div style="margin-top:6px">${RG.map((M,i)=>{if(i===g)return '';const why=modelFits(c,i),lk=!techOk('rg',i,M.lvl);
|
||||
return `<div class="row">${rgArt(i)?`<span class="rgpic">${rgArt(i)}</span>`:`<span class="logo" style="--c:${M.badge?'#2C7A7B':'#FF4F9A'}">${M.badge||'R'+(M.cls+1)}</span>`}<div class="grow"><div class="nm">${esc(M.n)} <span class="meta">${M.pn} · ${tr('sites_and_service.n_ports',{n:M.ports})} · ${fmtG(M.cap)} · ${tr('sites_and_service.boots_in_n_min',{n:M.boot})}${M.flaky?' · '+tr('common.crashes_more'):''}</span></div><div class="meta">${esc(M.blurb)}</div>${why?`<div class="why">${esc(why)}</div>`:''}</div>${lk?demoBtn('rg',i,M.lvl,tr('sites_and_service.level_n',{n:M.lvl}),'sm'):btn(tr('sites_and_service.swap_cost_mo_mo',{cost:fmt$(swapCost(c,i)),mo:fmt$(M.mo*rt)}),'upRouter',{city:c,g:i},'sm',!!why||S.cash<swapCost(c,i)||p.rupDay===S.day)}</div>`;}).join('')}</div>`;}
|
||||
return `<div class="row"><span class="logo" style="--c:${M.badge?'#2C7A7B':'#FF4F9A'}">${M.badge||'R'+(M.cls+1)}</span><div class="grow"><div class="nm">${esc(M.n)} <span class="meta">${M.pn} · ${tr('sites_and_service.n_ports',{n:M.ports})} · ${fmtG(M.cap)} · ${tr('sites_and_service.boots_in_n_min',{n:M.boot})}${M.flaky?' · '+tr('common.crashes_more'):''}</span></div><div class="meta">${esc(M.blurb)}</div>${why?`<div class="why">${esc(why)}</div>`:''}</div>${lk?demoBtn('rg',i,M.lvl,tr('sites_and_service.level_n',{n:M.lvl}),'sm'):btn(tr('sites_and_service.swap_cost_mo_mo',{cost:fmt$(swapCost(c,i)),mo:fmt$(M.mo*rt)}),'upRouter',{city:c,g:i},'sm',!!why||S.cash<swapCost(c,i)||p.rupDay===S.day)}</div>`;}).join('')}</div>`;}
|
||||
function portNote(c){const p=S.pops[c];if(!p)return '';const g=p.rgen||0;return RG[g].maxP<PORT.length-1?`<p class="note" style="margin-top:0">${tr('sites_and_service.your_model_here_tops_out_at',{model:esc(RG[g].n),pn:RG[g].pn})}</p>`:'';}
|
||||
// Service: what you deliver, times how it feels. Traffic backhauled far to transit is slow, and users notice.
|
||||
const latSlow=c=>!!(R&&R.latF&&R.latF[c]<0.97&&R.latFar[c]);
|
||||
|
|
|
|||
|
|
@ -17,11 +17,11 @@ test('every router model has a picture, and each one is valid SVG', () => {
|
|||
assert.equal(ev('rgArt(99)'), '');
|
||||
});
|
||||
|
||||
test('the POP panel shows the model\'s picture, and the other models show theirs', () => {
|
||||
test('only the POP overview shows a picture: the model in use', () => {
|
||||
const { ev, errors, dom } = load();
|
||||
ev("ACT.start({});if(UI.pendGame)ACT.pitchSkip();S.cash=1e9;selectCity(S.home);UI.tab='links';UI.models=true;renderAll()");
|
||||
const pics = dom.window.document.querySelectorAll('#panel .rgpic');
|
||||
assert.equal(pics.length, ev('RG.length'), 'the model in use plus every other one');
|
||||
assert.equal(pics.length, 1, 'the model in use only, not the list of other models');
|
||||
assert.ok(dom.window.document.querySelector('#panel .rgpic.big svg.rgart'), 'the one in use, big');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue