From 51ba71567d06244b0d112d21d917b3a39564b6f7 Mon Sep 17 00:00:00 2001 From: Frederic Jung Date: Wed, 28 Oct 2026 09:25:47 +0100 Subject: [PATCH] Home cities as a compact stack, the dropdown last; a shorter Sydney line --- CHANGELOG.md | 2 +- site/i18n/es.js | 5 +++-- site/i18n/fr.js | 5 +++-- site/i18n/it.js | 5 +++-- site/i18n/pt.js | 5 +++-- src/game/90-actions/89-game-and-settings.js | 2 +- src/game/95-modals/40-title.js | 8 +++++--- src/i18n/en.js | 5 +++-- src/styles/40-modal.css | 10 +++++++++- tests/any-home-city.test.js | 2 ++ 10 files changed, 33 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd07c85..4cecf6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ All notable changes to this project are documented here. The project follows ## [Unreleased] -- Start anywhere: besides the five suggested home cities, the new game screen now lets you pick any city on the map that sells transit, grouped by continent. +- Start anywhere: the new game screen lists the five suggested home cities as a compact stack, and the last entry lets you pick any city on the map that sells transit, grouped by continent. - Language is now a dropdown on the title screen and in Settings, with each language named in itself. On phones it opens the system picker. - Every new network starts at ½ speed, so you can find your feet before the bills arrive (#186). Saved games still continue at the speed you left them. - You can put a link on standby, so one of two links between the same cities sits idle as a backup (#122). It carries traffic only when the other links are full or down, so its capacity is never wasted, and the map draws it dashed while it waits. The routing metric still applies to every link between the two cities. diff --git a/site/i18n/es.js b/site/i18n/es.js index a44b4fd..0c9a6df 100644 --- a/site/i18n/es.js +++ b/site/i18n/es.js @@ -3018,12 +3018,13 @@ "title.big_hungry_market_few_providers":"Mercado enorme y hambriento, pocos proveedores.", "title.build_an_internet_lay_fiber_between":"Construye un internet. Tiende fibra entre ciudades, compra tránsito, haz peering en intercambios, firma con empresas y mantén contentos a los eyeballs mientras retroexcavadoras, tiburones y fugas de rutas hacen lo posible por detenerte.", "title.chat_on_signal":"Chatea en Signal", -"title.choose_a_city":"Elige una ciudad…", +"title.choose":"Elegir…", "title.continue_name_date":"Continuar {name} · {date}", "title.cookieless_stats_no_tracking":"Estadísticas sin cookies, sin rastreo", "title.crossroads_of_europe_de_kicks_ix":"La encrucijada de Europa. DE-KICKS IX, tránsito barato.", -"title.hard_mode_everything_overseas_costs":"Modo difícil. Todo lo de ultramar cuesta una fortuna, los locales pagan un dineral, sobre todo a la Nearly Broadband Network, y todo lo demás intenta matarte.", +"title.hard_mode_pricey_everything":"Modo difícil. Todo carísimo, y la fauna te quiere muerto.", "title.huge_eyeball_market_pricey":"Mercado enorme de eyeballs. Vecinos caros.", +"title.n_more_cities_with_transit":{"one":"{n} ciudad más con tránsito a la venta","other":"{n} ciudades más con tránsito a la venta"}, "title.name_your_network":"Ponle nombre a tu red", "title.new_in_series_of_tubes_v":"Novedades de Series of Tubes {v}", "title.pick_your_home_city":"Elige tu ciudad de origen", diff --git a/site/i18n/fr.js b/site/i18n/fr.js index fe9f164..05ae35c 100644 --- a/site/i18n/fr.js +++ b/site/i18n/fr.js @@ -3018,12 +3018,13 @@ "title.big_hungry_market_few_providers":"Gros marché affamé, peu d’opérateurs.", "title.build_an_internet_lay_fiber_between":"Construis un Internet. Pose de la fibre entre les villes, achète du transit, fais du peering aux IX, signe des entreprises et garde les eyeballs contents pendant que pelleteuses, requins et fuites de routes font tout pour t’arrêter.", "title.chat_on_signal":"Discuter sur Signal", -"title.choose_a_city":"Choisis une ville…", +"title.choose":"Choisir…", "title.continue_name_date":"Continuer {name} · {date}", "title.cookieless_stats_no_tracking":"Stats sans cookies, sans pistage", "title.crossroads_of_europe_de_kicks_ix":"Carrefour de l’Europe. IX DE-KICKS, transit pas cher.", -"title.hard_mode_everything_overseas_costs":"Mode difficile. Tout ce qui part à l’étranger coûte une fortune, les gens d’ici paient le prix fort, surtout à la Nearly Broadband Network, et tout le reste essaie de te tuer.", +"title.hard_mode_pricey_everything":"Mode difficile. Tout coûte cher, et la faune veut ta peau.", "title.huge_eyeball_market_pricey":"Énorme marché d’eyeballs. Voisins chers.", +"title.n_more_cities_with_transit":{"one":"{n} autre ville où acheter du transit","other":"{n} autres villes où acheter du transit"}, "title.name_your_network":"Nomme ton réseau", "title.new_in_series_of_tubes_v":"Nouveautés de Series of Tubes {v}", "title.pick_your_home_city":"Choisis ta ville de départ", diff --git a/site/i18n/it.js b/site/i18n/it.js index 811f635..92ca041 100644 --- a/site/i18n/it.js +++ b/site/i18n/it.js @@ -3018,12 +3018,13 @@ "title.big_hungry_market_few_providers":"Mercato grande e affamato, pochi provider.", "title.build_an_internet_lay_fiber_between":"Costruisci un internet. Posa fibra tra le città, compra transit, fai peering agli exchange, metti sotto contratto le aziende e tieni contenti gli eyeball, mentre ruspe, squali e route leak fanno di tutto per fermarti.", "title.chat_on_signal":"Chat su Signal", -"title.choose_a_city":"Scegli una città…", +"title.choose":"Scegli…", "title.continue_name_date":"Continua {name} · {date}", "title.cookieless_stats_no_tracking":"Statistiche senza cookie, nessun tracciamento", "title.crossroads_of_europe_de_kicks_ix":"Crocevia d’Europa. IX DE-KICKS, transit economico.", -"title.hard_mode_everything_overseas_costs":"Modalità difficile. Tutto ciò che va all’estero costa una fortuna, la gente del posto paga cifre altissime, soprattutto alla Nearly Broadband Network, e tutto il resto cerca di ucciderti.", +"title.hard_mode_pricey_everything":"Modalità difficile. Tutto carissimo, e la fauna ti vuole morto.", "title.huge_eyeball_market_pricey":"Enorme mercato di eyeball. Vicini costosi.", +"title.n_more_cities_with_transit":{"one":"Ancora {n} città dove comprare transit","other":"Altre {n} città dove comprare transit"}, "title.name_your_network":"Dai un nome alla tua rete", "title.new_in_series_of_tubes_v":"Novità di Series of Tubes {v}", "title.pick_your_home_city":"Scegli la tua città di partenza", diff --git a/site/i18n/pt.js b/site/i18n/pt.js index 83a20e9..6e219ea 100644 --- a/site/i18n/pt.js +++ b/site/i18n/pt.js @@ -3018,12 +3018,13 @@ "title.big_hungry_market_few_providers":"Mercado grande e faminto, poucos provedores.", "title.build_an_internet_lay_fiber_between":"Construa uma internet. Lance fibra entre cidades, compre transit, faça peering nos exchanges, feche contratos com empresas e mantenha os eyeballs felizes enquanto retroescavadeiras, tubarões e route leaks fazem de tudo para te parar.", "title.chat_on_signal":"Chat no Signal", -"title.choose_a_city":"Escolha uma cidade…", +"title.choose":"Escolha…", "title.continue_name_date":"Continuar {name} · {date}", "title.cookieless_stats_no_tracking":"Estatísticas sem cookies, sem rastreamento", "title.crossroads_of_europe_de_kicks_ix":"Encruzilhada da Europa. IX DE-KICKS, transit barato.", -"title.hard_mode_everything_overseas_costs":"Modo difícil. Tudo que vai para fora custa uma fortuna, os locais pagam caro, principalmente para a Nearly Broadband Network, e todo o resto quer te matar.", +"title.hard_mode_pricey_everything":"Modo difícil. Tudo caro, e a fauna quer te ver morto.", "title.huge_eyeball_market_pricey":"Mercado enorme de eyeballs. Vizinhos caros.", +"title.n_more_cities_with_transit":{"one":"Mais {n} cidade com transit à venda","other":"Mais {n} cidades com transit à venda"}, "title.name_your_network":"Dê um nome à sua rede", "title.new_in_series_of_tubes_v":"Novidades no Series of Tubes {v}", "title.pick_your_home_city":"Escolha sua cidade natal", diff --git a/src/game/90-actions/89-game-and-settings.js b/src/game/90-actions/89-game-and-settings.js index 8623d93..3ec2894 100644 --- a/src/game/90-actions/89-game-and-settings.js +++ b/src/game/90-actions/89-game-and-settings.js @@ -5,7 +5,7 @@ Object.assign(ACT,{ scenarios:()=>{UI.nm=(($('nmIn')&&$('nmIn').value)||UI.nm||(S&&S.name)||randomNetworkName()).slice(0,24);scenarioModal();}, startScn:({id,sure})=>{const sc=SCN.find(x=>x.id===id);if(!sc)return;if(!sure&&S&&UI.started&&!S.lost&&!(S.scn&&(S.scn.done||S.scn.failed))){openModal(`

${tr('game_and_settings.start_name',{name:esc(sc.n)})}

${tr('game_and_settings.name_will_be_replaced_export_it',{name:esc(S.name)})}

${btn(tr('game_and_settings.start_the_scenario'),'startScn',{id,sure:1},'pink big')}${btn(tr('common.keep_playing'),'closeModal',{},'ghost big')}
`);return;}beginGame(UI.nm||(S&&S.name)||randomNetworkName(),sc.city,{scn:sc});}, startWeekly:({sure}={})=>{if(!sure&&S&&UI.started&&!S.lost&&!(S.scn&&(S.scn.done||S.scn.failed))){openModal(`

${tr('game_and_settings.start_the_weekly_challenge')}

${tr('game_and_settings.name_will_be_replaced_export_it',{name:esc(S.name)})}

${btn(tr('game_and_settings.start_the_challenge'),'startWeekly',{sure:1},'pink big')}${btn(tr('common.keep_playing'),'closeModal',{},'ghost big')}
`);return;}const wk=weekly();beginGame(UI.nm||(S&&S.name)||randomNetworkName(),wk.city,{scn:wk,seed:wk.seed});}, - pickStart:({city})=>{if(!homeOk(city))return;UI.startCity=city;document.querySelectorAll('.start').forEach(b=>b.classList.toggle('on',b.dataset.city===city||(b.classList.contains('own')&&!START5.includes(city))));const s=$('homeSel');if(s&&START5.includes(city))s.value='';}, + pickStart:({city})=>{if(!homeOk(city))return;UI.startCity=city;document.querySelectorAll('.start').forEach(b=>b.classList.toggle('on',b.dataset.city===city||(b.classList.contains('own')&&!START5.includes(city))));const s=$('homeSel');if(s&&START5.includes(city))s.value='';const w=$('homeWhat');if(w)w.innerHTML=homeWhat();}, pickHome:({v})=>{if(v)ACT.pickStart({city:v});else ACT.pickStart({city:'fra'});}, cont:()=>{migrate(S);track('game_continue',true);UI.started=true;closeModal();renderAll();}, newgame:()=>{try{localStorage.removeItem('sot-save-v1');}catch(e){}S=null;UI.started=false;UI.sel=null;UI.nm=null;$('dash').hidden=true;$('bankBox').hidden=true;renderAll();showTitle();}, diff --git a/src/game/95-modals/40-title.js b/src/game/95-modals/40-title.js index 65c14a9..0332a35 100644 --- a/src/game/95-modals/40-title.js +++ b/src/game/95-modals/40-title.js @@ -3,18 +3,20 @@ const homeOk=c=>own(CITY,c)&&!CITY[c].off&&!CITY[c].cn&&NETS.some(n=>sellsAt(n,c)); const START5=['fra','nyc','sin','sao','syd']; function homePick(){const cs=Object.keys(CITY).filter(homeOk),cur=START5.includes(UI.startCity)?'':UI.startCity; - return `${Object.keys(REG).map(r=>{const g=cs.filter(c=>CITY[c].reg===r).sort((a,b)=>CITY[a].name.localeCompare(CITY[b].name)); return g.length?`${g.map(c=>``).join('')}`:'';}).join('')}`;} +// A dropdown can't wrap, so long names (Yuzhno-Sakhalinsk) get cut on phones: the line above it says the whole name. +const homeWhat=()=>START5.includes(UI.startCity)?trn('title.n_more_cities_with_transit',Object.keys(CITY).filter(c=>homeOk(c)&&!START5.includes(c)).length):`${esc(CITY[UI.startCity].name)} · ${esc(REG[CITY[UI.startCity].reg])}`; function showTitle(){ const sv=loadSave(); if(UI.nm==null)UI.nm=randomNetworkName(); - const starts=[['fra',tr('title.crossroads_of_europe_de_kicks_ix')],['nyc',tr('title.huge_eyeball_market_pricey')],['sin',tr('title.asia_hub_great_peering_far_from')],['sao',tr('title.big_hungry_market_few_providers')],['syd',tr('title.hard_mode_everything_overseas_costs')]]; + const starts=[['fra',tr('title.crossroads_of_europe_de_kicks_ix')],['nyc',tr('title.huge_eyeball_market_pricey')],['sin',tr('title.asia_hub_great_peering_far_from')],['sao',tr('title.big_hungry_market_few_providers')],['syd',tr('title.hard_mode_pricey_everything')]]; openModal(`

Series
of Tubes

${tr('title.build_an_internet_lay_fiber_between')}

${plugHtml(false)}${isPhone()?installRow():''} ${sv?`
${btn(tr('title.continue_name_date',{name:esc(sv.name),date:dateStr(sv.day)}),'cont',{},'pink big')}
`:''}
${btn(tr('common.another_one'),'randomName',{},'ghost sm')}
-
${starts.map(([c,d])=>``).join('')}
+
${starts.map(([c,d])=>``).join('')}
${[['normal',tr('common.normal')],['sandbox',tr('common.sandbox')]].map(([m,l])=>``).join('')}${btn(tr('title.scenarios_amp_weekly_challenge'),'scenarios',{},'sm')}
${langPick('langTitle')}
${btn(sv?tr('common.start_a_new_network'):tr('common.start_building'),'start',{},'big')}${btn(tr('common.how_to_play'),'help',{},'ghost')}${btn(tr('common.import_a_save'),'importPick',{},'ghost sm')}${btn(tr('common.settings'),'settings',{},'ghost sm')}

v${APP_VERSION} · ${tr('title.source_on_github')} · ${tr('title.chat_on_signal')} · ${tr('title.cookieless_stats_no_tracking')}

`); diff --git a/src/i18n/en.js b/src/i18n/en.js index d00db8e..b8fd360 100644 --- a/src/i18n/en.js +++ b/src/i18n/en.js @@ -3019,12 +3019,13 @@ "title.big_hungry_market_few_providers":"Big hungry market, few providers.", "title.build_an_internet_lay_fiber_between":"Build an internet. Lay fiber between cities, buy transit, peer at exchanges, sign up businesses, and keep the eyeballs happy while backhoes, sharks and route leaks do their best to stop you.", "title.chat_on_signal":"Chat on Signal", -"title.choose_a_city":"Choose a city…", +"title.choose":"Choose…", "title.continue_name_date":"Continue {name} · {date}", "title.cookieless_stats_no_tracking":"Cookieless stats, no tracking", "title.crossroads_of_europe_de_kicks_ix":"Crossroads of Europe. DE-KICKS IX, cheap transit.", -"title.hard_mode_everything_overseas_costs":"Hard mode. Everything overseas costs a fortune, locals pay top dollar, mostly to the Nearly Broadband Network, and everything else is trying to kill you.", +"title.hard_mode_pricey_everything":"Hard mode. Pricey everything, and the wildlife wants you dead.", "title.huge_eyeball_market_pricey":"Huge eyeball market. Pricey neighbours.", +"title.n_more_cities_with_transit":{"one":"{n} more city with transit to buy","other":"{n} more cities with transit to buy"}, "title.name_your_network":"Name your network", "title.new_in_series_of_tubes_v":"New in Series of Tubes {v}", "title.pick_your_home_city":"Pick your home city", diff --git a/src/styles/40-modal.css b/src/styles/40-modal.css index f11ba64..4e12127 100644 --- a/src/styles/40-modal.css +++ b/src/styles/40-modal.css @@ -101,7 +101,15 @@ input.t{width:100%;box-sizing:border-box;border:3px solid var(--ink);border-radi .start.on{background:#FFE3F0;border-color:var(--me);box-shadow:0 3px 0 var(--me)} .start b{font-family:var(--display);font-size:17px;display:block} .start span{font-size:12px;color:var(--ink2);line-height:1.3;display:block} -.start.own select.pick{width:100%;margin-top:4px;min-height:40px;font-size:16px;box-shadow:none;border-width:2px} +/* Home cities: compact tiles stacked in one column, the dropdown for any other city last. */ +.starts.homes{display:flex;flex-direction:column;gap:6px} +.homes .start{display:flex;flex-wrap:wrap;align-items:baseline;column-gap:10px;row-gap:2px;padding:6px 12px;box-shadow:0 2px 0 var(--ink)} +.homes .start.on{box-shadow:0 2px 0 var(--me)} +.homes .start b{font-size:16px;flex:0 0 8.4em} +.homes .start span{flex:1 1 10em;min-width:0} +.homes .start.own select.pick{flex:1 1 100%;margin:4px 0 2px;min-height:40px;font-size:16px;box-shadow:none;border-width:2px;padding-right:30px;background-position:right 9px center} +/* In Settings it sits next to small On/Off pills: same 16px text, slimmer frame. */ +.setline select.pick{min-height:36px;padding:4px 30px 4px 10px;border-width:2px;border-radius:10px;box-shadow:0 2px 0 var(--ink);background-position:right 9px center} .tiers{display:grid;gap:7px;margin-top:10px} .tierbtn{display:flex;align-items:center;gap:10px;border:3px solid var(--ink);border-radius:13px;padding:8px 12px;background:var(--paper);cursor:pointer;box-shadow:0 3px 0 var(--ink);text-align:left} .tierbtn:hover{background:#FFF6CF} diff --git a/tests/any-home-city.test.js b/tests/any-home-city.test.js index 5bdc8f4..e1d411c 100644 --- a/tests/any-home-city.test.js +++ b/tests/any-home-city.test.js @@ -23,9 +23,11 @@ test('picking any city starts the network there, and the tiles follow the choice choose(ev, 'lis'); assert.equal(ev('UI.startCity'), 'lis'); assert.deepEqual(onTiles(ev), ['own'], 'the sixth tile lights up'); + assert.equal(ev("document.getElementById('homeWhat').textContent"), 'Lisbon · ' + ev("REG[CITY.lis.reg]"), 'and names the city in full'); ev("document.querySelector('.start[data-city=nyc]').click()"); assert.deepEqual(onTiles(ev), ['nyc'], 'a suggested tile takes over again'); assert.equal(ev("document.getElementById('homeSel').value"), '', 'and the dropdown resets'); + assert.match(ev("document.getElementById('homeWhat').textContent"), /more cities/); choose(ev, 'akl'); ev("ACT.start({});if(UI.pendGame)ACT.pitchSkip()"); assert.equal(ev('S.home'), 'akl');