Merge branch 'main' into sea-optic-hint
This commit is contained in:
commit
54f40221d5
17 changed files with 75 additions and 21 deletions
|
|
@ -15,8 +15,12 @@ const premCity=(n,c)=>!!n.premium&&!!n.premAt&&n.premAt.includes(c),premOnlyAt=(
|
|||
const premOn=t=>!!t.premium&&!!NET[t.net]&&premCity(NET[t.net],t.city);
|
||||
// What a port costs per Gbps and month before the commit: the premium crossing at Hong Kong prices, anything else at the city's.
|
||||
const transitPerG=(n,c,prem)=>prem&&premCity(n,c)?n.price*n.premium*netMult(n,'hkg'):n.price*netMult(n,c);
|
||||
const onIx=(n,c)=>CITY[c].au&&n.auIx?n.auIx.includes(c):n.ix==='ALL'||Array.isArray(n.ix)&&n.ix.includes(c);
|
||||
function ixMembers(c){if(XIXM[c])return XIXM[c].members.slice();if(S.myIx[c])return S.myIx[c].members.slice();if(!CITY[c].ix)return [];return NETS.filter(n=>onIx(n,c)).map(n=>n.id);}
|
||||
// Exchange lists are fixed once the page has loaded, so each is looked up through a Set built on first use.
|
||||
const IX_SET=new WeakMap(),inIxList=(a,c)=>{let s=IX_SET.get(a);if(!s)IX_SET.set(a,s=new Set(a));return s.has(c);};
|
||||
const onIx=(n,c)=>CITY[c].au&&n.auIx?inIxList(n.auIx,c):n.ix==='ALL'||Array.isArray(n.ix)&&inIxList(n.ix,c);
|
||||
function ixMembers(c){if(XIXM[c])return XIXM[c].members.slice();if(S.myIx[c])return S.myIx[c].members.slice();if(!CITY[c].ix)return [];return (IX_MEM[c]||(IX_MEM[c]=NETS.filter(n=>onIx(n,c)).map(n=>n.id))).slice();}
|
||||
// A city exchange's members only depend on the networks, which are fixed after load.
|
||||
const IX_MEM={};
|
||||
// LAG: several identical ports bundled into one logical link. Flow hashing is never perfectly even, so a bundle carries ~95% of the sum.
|
||||
const LAG_MAX=8;
|
||||
function lagCap(g,n){n=n||1;return g*n*(n>1?0.95:1);}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ Object.assign(ACT,{
|
|||
// Back to the title with this network kept and saved.
|
||||
toTitle:()=>{if(pzOn()){pzLeave();}slotLeave();gameClear();showTitle();},
|
||||
slotBack:()=>{if(S&&UI.started)closeModal();else showTitle();},
|
||||
// A damaged save, opened once more: if it loads, it is no longer damaged; if not, it is marked again.
|
||||
slotRetry:({id})=>{const l=slotIdx(),e=l.find(x=>x.id===id);if(!e)return;e.broken=false;slotIdxPut(l);closeModal();ACT.cont({id});},
|
||||
slotMenu:({id})=>{const h=slotMenuHtml(id);if(h)openModal(h);},
|
||||
slotExport:({id})=>exportSlot(id),
|
||||
slotDel:({id,back})=>{const e=slotIdx().find(x=>x.id===id);if(!e)return;
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ function parseSave(txt){if(typeof txt!=='string')return {err:tr('save.that_file_
|
|||
if(s.lost)return {err:tr('save.that_network_went_bankrupt_it_cannot')};
|
||||
for(const c of Object.keys(s.pops))if(!isCity(c))return {err:tr('save.that_save_has_a_pop_in',{city:esc(String(c).slice(0,12))})};
|
||||
return {s,ver:j.version||'?',name:String(s.name||tr('common.unnamed_network'))};}
|
||||
function importFile(file){if(!file)return;if(file.size>8e6){toast(tr('save.that_file_is_too_big_to'),'bad');return;}
|
||||
function importFile(file){if(!file)return;if(file.size>64e6){toast(tr('save.that_file_is_too_big_to'),'bad');return;}
|
||||
const rd=new FileReader();rd.onload=()=>{const r=parseSave(String(rd.result));if(r.err){toast(tr('save.import_failed_err',{err:esc(r.err)}),'bad');sfx('err');return;}
|
||||
UI.importing=r.s;openModal(`<div class="eyebrow">${tr('common.import_a_save')}</div><h2 style="font-size:26px">${tr('save.load_name',{name:esc(r.name)})}</h2><p class="tagline">${esc(dateStr(r.s.day))} · ${tr('save.cash_in_the_bank',{cash:fmt$(r.s.cash)})} · ${trn('save.n_pop',Object.keys(r.s.pops).length)} · ${tr('save.saved_by_v_ver',{ver:esc(r.ver)})}</p><p class="note">${tr('slots.it_joins_your_networks_on_this')}</p><div class="btns">${btn(tr('save.load_this_network'),'importGo',{},'pink big')}${btn(tr('common.cancel'),UI.started?'closeModal':'helpClose',{},'ghost big')}</div>`);};
|
||||
rd.readAsText(file);}
|
||||
|
|
|
|||
|
|
@ -19,13 +19,16 @@ const slotRaw=id=>slotOkId(id)?lsGet(SLOT_K+id)??(id===SLOT_MAIN?lsGet(SLOT_OLD)
|
|||
function slotClean(e){if(!e||typeof e!=='object'||!slotOkId(e.id))return null;
|
||||
return {id:e.id,name:String(e.name==null?'':e.name).slice(0,24),asn:int(e.asn,0,4294967294,0),mode:['normal','sandbox','scenario'].includes(e.mode)?e.mode:'normal',
|
||||
preset:typeof e.preset==='string'&&own(PRESETS,e.preset)?e.preset:'oncall',scn:typeof e.scn==='string'?e.scn.slice(0,60):null,day:int(e.day,0,1e7,0),
|
||||
tier:['Tier 1','Tier 2','Tier 3'].includes(e.tier)?e.tier:null,cash:num(e.cash,0),at:num(e.at,0),size:int(e.size,0,1e10,0),seq:int(e.seq,0,1e15,0),gz:!!e.gz,broken:!!e.broken};}
|
||||
tier:['Tier 1','Tier 2','Tier 3'].includes(e.tier)?e.tier:null,cash:num(e.cash,0),at:num(e.at,0),size:int(e.size,0,1e10,0),seq:int(e.seq,0,1e15,0),gz:!!e.gz,
|
||||
// A save marked damaged (bv: the game version that could not load it) is tried again by the next version: the fault is
|
||||
// usually in the game, and the save itself is fine once it is fixed.
|
||||
...(e.broken&&e.bv===APP_VERSION?{broken:true,bv:e.bv}:{broken:false})};}
|
||||
const slotMeta=(s,tier)=>({name:s.name,asn:s.asn,mode:s.mode,preset:s.rules&&s.rules.preset,scn:s.scn&&s.scn.name||null,day:s.day,cash:s.cash,tier});
|
||||
function slotKeys(){const out=[];try{for(let i=0;i<localStorage.length;i++){const k=localStorage.key(i);if(k===SLOT_OLD)out.old=true;else if(k&&k.startsWith(SLOT_K)&&slotOkId(k.slice(SLOT_K.length)))out.push(k.slice(SLOT_K.length));}}catch(e){}return out;}
|
||||
// An index entry rebuilt from the save itself. A compressed one can only be read in the background: slotFix() fills it in.
|
||||
function slotFromKey(id){const raw=slotRaw(id)||'';if(raw.startsWith(GZ))return slotClean({id,gz:true,size:raw.length});
|
||||
try{const s=JSON.parse(raw);if(s&&s.v===1&&typeof s.day==='number')return slotClean({id,...slotMeta(s,null),seq:s.sv&&s.sv.seq,at:s.sv&&s.sv.at,size:raw.length});}catch(e){}
|
||||
return slotClean({id,size:raw.length,broken:true});}
|
||||
return slotClean({id,size:raw.length,broken:true,bv:APP_VERSION});}
|
||||
/* The list of networks. scan also looks at the keys themselves (cheap: no save is read unless its entry is missing):
|
||||
a save whose index write failed is added back, an entry whose save is gone is dropped. A damaged index is rebuilt. */
|
||||
function slotIdx(scan){const raw=lsGet(SLOT_IX);let list=null;
|
||||
|
|
@ -43,7 +46,7 @@ function slotIdx(scan){const raw=lsGet(SLOT_IX);let list=null;
|
|||
function slotIdxPut(list){const t=JSON.stringify({v:1,slots:list});try{localStorage.setItem(SLOT_IX,t);SLOT.ixRaw=t;SLOT.ixList=list.map(e=>({...e}));return true;}catch(e){SLOT.ixRaw=null;return false;}}
|
||||
function slotFix(list){for(const e of list)if(e.gz&&!e.name&&!e.broken&&!SLOT['fix'+e.id]){SLOT['fix'+e.id]=1;const raw=slotRaw(e.id);
|
||||
gunzip(raw).then(t=>{const s=JSON.parse(t);return s&&s.v===1?slotMeta(s,null):null;},()=>null).then(m=>{const l=slotIdx(),x=l.find(y=>y.id===e.id);if(!x)return;
|
||||
if(m)Object.assign(x,slotClean({...x,...m}));else x.broken=true;slotIdxPut(l);slotRefresh();});}}
|
||||
if(m)Object.assign(x,slotClean({...x,...m}));else{x.broken=true;x.bv=APP_VERSION;}slotIdxPut(l);slotRefresh();});}}
|
||||
const slotByAt=l=>l.slice().sort((a,b)=>b.at-a.at);
|
||||
// ---------- one writer per slot ----------
|
||||
// The heartbeat: who has a slot open, refreshed every few seconds. A hidden tab's timers can be slowed to once a
|
||||
|
|
@ -104,7 +107,7 @@ function slotOpen(id,steal,done){if(!slotIdx(true).some(e=>e.id===id)){showTitle
|
|||
slotIn(id,sv);gameResume();if(done)done();};
|
||||
const raw=slotRaw(id);if(raw==null){slotFree(id);slotDrop(id);showTitle();toast(tr('slots.that_network_is_gone'),'bad');return;}
|
||||
if(raw.startsWith(GZ)){if(raw===UI.gzRaw)go(UI.gzText);else gunzip(raw).then(go,()=>slotBroke(id));}else go(raw);});}
|
||||
function slotBroke(id){const l=slotIdx(),e=l.find(x=>x.id===id);if(e){e.broken=true;slotIdxPut(l);}
|
||||
function slotBroke(id){const l=slotIdx(),e=l.find(x=>x.id===id);if(e){e.broken=true;e.bv=APP_VERSION;slotIdxPut(l);}
|
||||
if(UI.slot===id){UI.slot=null;ssSet(SLOT_SS,null);}slotFree(id);
|
||||
S=null;R=emptyR();UI.started=false;UI.sel=null;$('dash').hidden=true;$('bankBox').hidden=true;renderAll();showTitle();toast(tr('loop.your_saved_game_could_not_be'),'bad');}
|
||||
function slotDrop(id){if(!slotOkId(id))return;SLOT.no.add(id);lsDel(SLOT_K+id);if(id===SLOT_MAIN)lsDel(SLOT_OLD);slotUnbeat(id);
|
||||
|
|
@ -123,7 +126,7 @@ function slotMigrate(cb){const raw=lsGet(SLOT_OLD);
|
|||
const done=s=>{if(s&&s.lost){cb();return;}
|
||||
let ok=false;try{localStorage.setItem(SLOT_K+SLOT_MAIN,raw);ok=localStorage.getItem(SLOT_K+SLOT_MAIN)===raw;}catch(e){}
|
||||
if(!ok)lsDel(SLOT_K+SLOT_MAIN);
|
||||
const l=slotIdx();l.push(slotClean({id:SLOT_MAIN,...(s?slotMeta(s,null):{}),seq:0,at:Date.now(),size:raw.length,gz:raw.startsWith(GZ),broken:!s}));slotIdxPut(l);if(!s)UI.bootBroken=true;cb();};
|
||||
const l=slotIdx();l.push(slotClean({id:SLOT_MAIN,...(s?slotMeta(s,null):{}),seq:0,at:Date.now(),size:raw.length,gz:raw.startsWith(GZ),broken:!s,bv:APP_VERSION}));slotIdxPut(l);if(!s)UI.bootBroken=true;cb();};
|
||||
if(!raw.startsWith(GZ)){let s=null;try{s=JSON.parse(raw);}catch(e){}done(s&&s.v===1?s:null);return;}
|
||||
if(!gzOk()){done(null);return;}
|
||||
gunzip(raw).then(t=>{UI.gzRaw=raw;UI.gzText=t;let s=null;try{s=JSON.parse(t);}catch(e){}done(s&&s.v===1?s:null);},()=>done(null));}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ function renderLeft(){checkLayer();
|
|||
}else{
|
||||
if(Object.keys(S.ixp).length||ppol()!=='open')h+=pdeskCard();
|
||||
h+=`<p class="lead">${tr('hud_and_panels.every_network_on_the_map_traffic')}</p>`;
|
||||
{const nc=conns().length;if(nc)h+=`<div class="btns" style="margin-bottom:8px">${btn(tr('hud_and_panels.all_connections_n',{n:nc}),'connOpen',{},'pink sm')}</div>`;}
|
||||
{const nc=connsN();if(nc)h+=`<div class="btns" style="margin-bottom:8px">${btn(tr('hud_and_panels.all_connections_n',{n:nc}),'connOpen',{},'pink sm')}</div>`;}
|
||||
const where=netWhereIdx(),tl=NETS.filter(n=>n.tail),tlOn=tl.filter(n=>where(n.id).some(x=>x[2]==='ix')).length;
|
||||
const foc=UI.netFocus&&NET[UI.netFocus]?NET[UI.netFocus]:null,out=!foc&&UI.nf==='out',lostN=ntLost().length;
|
||||
h+=`<div class="btns" style="margin-bottom:8px">${btn(tr('common.all_networks'),'netFilter',{f:'all'},!foc&&!out?'sm':'ghost sm')}${btn(tr('hud_and_panels.out_of_reach_without_transit_n',{n:lostN}),'netFilter',{f:'out'},out?'sm':'ghost sm')}</div>`;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
network, with a jump to the POP that holds it. The Networks tab shows the same per network. */
|
||||
const CONN_K={t:N_('common.transit'),p:'PNI',ix:'IX',c:N_('common.cache'),nni:'NNI'},CONN_ORD=['t','p','ix','c','nni'],CONN_COL={t:'#FF8A3D',p:'#7B61FF',ix:'#2DB7F5',c:'#16A866',nni:'#1E2640'};
|
||||
const connTab=k=>k==='t'?'up':k==='nni'?'links':'peer';
|
||||
// How many rows conns() gives, without building them (the Networks tab only shows the count).
|
||||
const connsN=()=>S.transit.length+S.pni.length+Object.keys(S.ixp).length+new Set(S.caches.map(x=>x.city+'|'+x.net)).size+(S.nni||[]).filter(x=>FAB[x.prov]&&NNI[x.tier]).length;
|
||||
function conns(){const out=[],pn=(tier,n)=>(n||1)>1?`${n}×${PORT[tier].n} LAG`:PORT[tier].n;
|
||||
for(const t of S.transit){const q=(R.p95&&R.p95[t.id])||0;out.push({k:'t',id:t.id,city:t.city,net:t.net,name:NET[t.net].name,port:pn(t.tier,t.n),cap:lagCap(PORT[t.tier].g,t.n),use:R.useT[t.id]||0,mo:transitMo(t,q),down:t.down>S.day||!popUp(t.city),low:t.pref==='low',note:tr('connections.95th_percentile_g',{g:fmtG(q)})});}
|
||||
for(const x of S.pni){const u=R.usePni[x.id]||0;out.push({k:'p',id:x.id,city:x.city,net:x.net,name:NET[x.net].name,port:x.g1?((x.n||1)>1?x.n+'×1G':'1G'):pn(x.tier,x.n),cap:lagCap(pniG(x),x.n),use:u,mo:pniMo(x,u),down:!popUp(x.city)||!pniOn(x),low:x.pref==='low',note:!pniOn(x)?tr('connections.on_order_n_days',{n:x.ready-S.day}):NET[x.net].pol==='paid'?tr('common.paid_peering'):''});}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ function slotRefresh(){const el=$('slotList');if(!el||UI.started)return;const h=
|
|||
function slotMenuHtml(id){const e=slotIdx().find(x=>x.id===id);if(!e)return '';const nm=esc(e.name||tr('common.unnamed_network'));
|
||||
return `<div style="display:flex;align-items:center"><div class="grow"><div class="eyebrow">${slotIcon(e)} ${slotLine(e)}</div><h2 style="font-size:26px">${nm}</h2></div><button class="x" data-act="slotBack" aria-label="${tr('common.close')}">×</button></div>
|
||||
<p class="tagline">${e.at?tr('slots.last_played_ago',{ago:slotAgo(e.at)}):''}${e.size?' · '+tr('slots.size_on_this_device',{size:slotSize(e.size)}):''}</p>
|
||||
<div class="menu-list">${e.broken?'':btn(tr('slots.continue_this_network'),'cont',{id},'pink big')}${btn(tr('game_and_settings.export_save_download_a_file'),'slotExport',{id},'')}${btn(tr('slots.delete_this_network'),'slotDel',{id},'red')}${btn(tr('common.back'),'slotBack',{},'ghost')}</div>`;}
|
||||
<div class="menu-list">${e.broken?btn(tr('slots.try_again'),'slotRetry',{id},'pink big'):btn(tr('slots.continue_this_network'),'cont',{id},'pink big')}${btn(tr('game_and_settings.export_save_download_a_file'),'slotExport',{id},'')}${btn(tr('slots.delete_this_network'),'slotDel',{id},'red')}${btn(tr('common.back'),'slotBack',{},'ghost')}</div>`;}
|
||||
const slotSize=n=>n>=1e6?(n/1e6).toFixed(1)+' MB':Math.max(1,Math.round(n/1e3))+' kB';
|
||||
function slotBusyModal(id){const e=slotIdx().find(x=>x.id===id),nm=esc(e&&e.name||tr('common.unnamed_network'));
|
||||
openModal(`<div class="eyebrow">🪟 ${tr('slots.two_windows_one_network')}</div><h2 style="font-size:26px">${tr('slots.name_is_open_in_another_window',{name:nm})}</h2>
|
||||
|
|
|
|||
|
|
@ -27,16 +27,22 @@ let SX=new Float64Array(64),SY=new Float64Array(64);
|
|||
function segDist(x,y,a,b){const dx=b[0]-a[0],dy=b[1]-a[1],L=dx*dx+dy*dy||1;const t=clamp(((x-a[0])*dx+(y-a[1])*dy)/L,0,1);return Math.hypot(x-a[0]-t*dx,y-a[1]-t*dy);}
|
||||
// `cached`: the cables are already painted into the world layer. Zoomed in, the layer is painted without
|
||||
// them (#49), so they are drawn here every frame instead.
|
||||
// Cable names are drawn in one font, so each width is measured once.
|
||||
const LBW=new Map(),labW=t=>{let w=LBW.get(t);if(w===undefined)LBW.set(t,w=ctx.measureText(t).width);return w;};
|
||||
try{document.fonts&&document.fonts.ready.then(()=>LBW.clear());}catch(e){}
|
||||
function drawCables(ks){const z=cam.z,selC=UI.drag&&UI.drag.mode==='link'?UI.drag.from:(UI.sel&&UI.sel.type==='city'?UI.sel.id:null),cached=!!(WL.cv&&WL.key&&WL.cab);
|
||||
if(!selC&&z<1.7&&cached)return;
|
||||
ctx.font='800 10px Nunito, sans-serif';ctx.textAlign='center';ctx.textBaseline='middle';
|
||||
// Labels that would sit on another, or on a segment shorter than the name, are left out (a selected city's always show).
|
||||
const LB=[],lbOk=(x,y,w,sp,hot)=>{const b=[x-w/2-3,y-7,x+w/2+3,y+7];if(!hot){let mn=Infinity,mx=-Infinity,my=Infinity,My=-Infinity;for(const q of sp){mn=Math.min(mn,q[0]);mx=Math.max(mx,q[0]);my=Math.min(my,q[1]);My=Math.max(My,q[1]);}
|
||||
if(Math.hypot(mx-mn,My-my)<w*0.8)return false;if(LB.some(o=>b[0]<o[2]&&b[2]>o[0]&&b[1]<o[3]&&b[3]>o[1]))return false;}LB.push(b);return true;};
|
||||
// Placed labels go in a 64px grid, so each check only looks at its neighbours.
|
||||
const LG=new Map(),lbOk=(x,y,w,sp,hot)=>{const b=[x-w/2-3,y-7,x+w/2+3,y+7],c0=Math.floor(b[0]/64),c1=Math.floor(b[2]/64),r0=Math.floor(b[1]/64),r1=Math.floor(b[3]/64);
|
||||
if(!hot){const a=sp[0],z=sp[sp.length-1];let L=Math.hypot(z[0]-a[0],z[1]-a[1]);if(L<w*0.8)for(const q of sp)L=Math.max(L,Math.hypot(q[0]-a[0],q[1]-a[1]));if(L<w*0.8)return false;
|
||||
for(let cx=c0;cx<=c1;cx++)for(let cy=r0;cy<=r1;cy++){const o=LG.get(cx*8192+cy);if(o)for(const q of o)if(b[0]<q[2]&&b[2]>q[0]&&b[1]<q[3]&&b[3]>q[1])return false;}}
|
||||
for(let cx=c0;cx<=c1;cx++)for(let cy=r0;cy<=r1;cy++){const k=cx*8192+cy;let o=LG.get(k);if(!o)LG.set(k,o=[]);o.push(b);}return true;};
|
||||
const ar=arOn();for(const cp of CABLE_PAIRS){const C=CAB[cp.cid],hot=!!selC&&(cp.a===selC||cp.b===selC);if(!hot&&cached&&z<1.7)continue;if(ar&&!hot&&!(arKind(cp.a)&&arKind(cp.b)))continue;const col=cableCol(C);
|
||||
for(const k of ks){const sp=cp.pts.map(p=>toS(p[0],p[1],k));let mn=Infinity,mx=-Infinity;for(const q of sp){if(q[0]<mn)mn=q[0];if(q[0]>mx)mx=q[0];}if(mx<-20||mn>CW+20)continue;
|
||||
if(hot||!cached){ctx.globalAlpha=hot?0.95:0.4;ctx.strokeStyle=col;ctx.lineWidth=hot?3:1.6;ctx.lineJoin='round';ctx.setLineDash(C.age==='old'?[6,5]:[]);ctx.beginPath();ctx.moveTo(sp[0][0],sp[0][1]);for(let i=1;i<sp.length;i++)ctx.lineTo(sp[i][0],sp[i][1]);ctx.stroke();ctx.setLineDash([]);}
|
||||
if((hot||(z>=1.7&&!ar))&&lbOk(sp[Math.floor(sp.length/2)][0],sp[Math.floor(sp.length/2)][1]-8,ctx.measureText(C.name).width,sp,hot)){const m=sp[Math.floor(sp.length/2)];ctx.globalAlpha=hot?1:0.75;ctx.lineWidth=3;ctx.strokeStyle='rgba(255,255,255,.85)';ctx.strokeText(C.name,m[0],m[1]-8);ctx.fillStyle=col;ctx.fillText(C.name,m[0],m[1]-8);}
|
||||
if((hot||(z>=1.7&&!ar))&&lbOk(sp[Math.floor(sp.length/2)][0],sp[Math.floor(sp.length/2)][1]-8,labW(C.name),sp,hot)){const m=sp[Math.floor(sp.length/2)];ctx.globalAlpha=hot?1:0.75;ctx.lineWidth=3;ctx.strokeStyle='rgba(255,255,255,.85)';ctx.strokeText(C.name,m[0],m[1]-8);ctx.fillStyle=col;ctx.fillText(C.name,m[0],m[1]-8);}
|
||||
ctx.globalAlpha=1;}}}
|
||||
function bezGeom(l,at){const A=CITY[l.a],B=CITY[l.b];const i=at!==undefined?at:lineIdx(l);const key=l.id+'|b'+i;const hit=GEO.get(key);if(hit)return hit;
|
||||
const bx=A.x+wrapDx(A.x,B.x),by=B.y;const dx=bx-A.x,dy=by-A.y,len=Math.hypot(dx,dy)||1;let nx=-dy/len,ny=dx/len;if(ny>0){nx=-nx;ny=-ny;}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ function shipSprite(x,y,face,sc,col,now,mode){const c=ctx;c.save();c.translate(x
|
|||
if(mode==='work'&&Math.floor(now/350)%2){c.fillStyle='#FFD23F';c.font='900 11px sans-serif';c.textAlign='center';c.fillText('✦',12,-8);}
|
||||
c.restore();}
|
||||
function drawShips(ks,now){SHIP_HITS.length=0;if(!S||pzOn()||!S.fleet)return;
|
||||
const T=S.day+(UI.speed?clamp(acc/DAY_MS,0,0.999):0),z=cam.z,sc=Math.max(0.9,Math.min(1.6,Math.sqrt(z)))*(lodFar()?1:1.25),list=[];
|
||||
const T=S.day+(UI.speed?clamp(acc/DAY_MS,0,0.999):0),z=cam.z,sc=Math.max(0.85,Math.min(1.5,Math.sqrt(z)))*(lodFar()?0.9:1.05),list=[];
|
||||
for(const s of SHIPS){const p=shipAt(s,T);if(p.m==='port'&&z<1.1)continue;list.push({p,s,col:s.club==='prv'?'#7A5CFF':'#FF4D5E'});}
|
||||
for(const l of S.links)if(layOwn(l)&&l.ready>S.day&&T>=layStart(l)){const g=linkGeom(l),q=layDone(l,T),two=!!l.ship2;
|
||||
const put=(t,k,dir)=>{const [x,y]=polyAt(g.pts,g.cum,clamp(t,0,1)),[x2]=polyAt(g.pts,g.cum,clamp(t+dir*0.01,0,1));list.push({p:{x,y,m:'lay',dx:x2-x||dir},lay:l,k,col:'#16A866'});};
|
||||
|
|
|
|||
|
|
@ -3690,7 +3690,7 @@
|
|||
"sites_peering_caches.your_ticket_was_merged_into_another":"<b>Your ticket was merged into another ticket.</b><br>That ticket was closed as a duplicate of yours.",
|
||||
"slots.continue":"Continue",
|
||||
"slots.continue_this_network":"Continue this network",
|
||||
"slots.damaged_export_or_delete":"Damaged: export it or delete it",
|
||||
"slots.damaged_export_or_delete":"Damaged: try again, export it or delete it",
|
||||
"slots.delete":"Delete",
|
||||
"slots.delete_forever":"Delete forever",
|
||||
"slots.delete_name":"Delete {name}?",
|
||||
|
|
@ -3726,6 +3726,7 @@
|
|||
"slots.that_network_is_gone":"<b>That network is gone.</b><br>It was deleted, maybe in another window.",
|
||||
"slots.this_window_stepped_aside_so_the":"You took it over in another window, so this one stepped aside and stopped saving. Nothing was lost.",
|
||||
"slots.this_window_stopped_saving_so_it":"A newer version was saved in another window, so this one stopped saving instead of overwriting it.",
|
||||
"slots.try_again":"Try again",
|
||||
"slots.two_windows_one_network":"Two windows, one network",
|
||||
"slots.your_networks":"Your networks",
|
||||
"slots.your_other_networks_share_this_browser":"Your other networks share this browser's storage. Export the ones you want to keep, then delete them here to make room.",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue