NOC tab and Pie Control tidied for phones: Pie Control in the NOC top row, traceroute in Routing & DDoS, government money in the bank
- NOC tab: Pie Control is a button in the top row next to "Open NOC dashboard" (only once the rocket
company is unlocked) and replaces the Pie in the Sky card; a spat waiting for an answer keeps its card.
The Connections button is gone (it lives in the NOC dashboard), and the traceroute moved into the
Routing & DDoS modal as an entry that opens the unchanged traceroute modal.
- Government money (Rural Digital Pie Fund, Pitcairn grant, Ex-Im Pie Bank) is a section of the bank,
shown with a rocket company or anything of the fund's to show. pieGovOpen, the action the toasts use,
opens the bank there; pieTab({t:'gov'}) does too.
- Pie Control has four tabs (Traffic, Company, Launch, Dishes) in one segmented control that fits 360 px,
styled like the HUD's speed buttons. The Founder's posts and the orbit books moved into the Company tab,
newest three posts shown and the rest folded. A stale UI.pieTab of 'gov', 'book' or 'founder' falls back.
- Agent docs for pieGovOpen, pieTab, routingOpen and connOpen; the route fuzzer drops connOpen from the
NOC tab on both pages to stay in lockstep with main.
- Tests: tests/noc-panel-layout.test.js, and the pie tests follow the moves.
This commit is contained in:
parent
176a6995b1
commit
9d74873edb
22 changed files with 207 additions and 68 deletions
|
|
@ -1,5 +1,5 @@
|
|||
// Pie in the Sky (60-features/99-pie-in-the-sky.js): every action checks pieCanBuild() for anything new.
|
||||
const pieRe=()=>{after();if(!$('modal').hidden&&$('modal').className==='pie')pieModal();};
|
||||
const pieRe=()=>{after();if(!$('modal').hidden&&$('modal').className==='pie')pieModal();if(!$('bankBox').hidden)renderBank();};
|
||||
const pieNo=why=>{toast(why,'bad');sfx('err');pieRe();};
|
||||
Object.assign(ACT,{
|
||||
pieOpen:()=>{if(!S||pzOn()||!pieOn())return;UI.confirm=null;pieModal();},
|
||||
|
|
@ -28,13 +28,13 @@ Object.assign(ACT,{
|
|||
pieSafe:()=>{const P=pieGet();if(!P||!P.co)return;P.safe=!P.safe;sfx('click');pieRe();},
|
||||
pieName:()=>{const P=pieGet();if(!P||!P.co)return;const i=PIE_NAMES.indexOf(P.co.name);P.co.name=PIE_NAMES[(i+1)%PIE_NAMES.length];pieFounder(N_('pie.fp_rename'));pieRe();},
|
||||
pieRename:()=>{const P=pieGet(),el=$('pieNm');if(!P||!P.co||!el)return;const v=el.value.replace(/\s+/g,' ').trim().slice(0,40);if(!v)return;P.co.name=v;pieFounder(N_('pie.fp_rename'));pieRe();},
|
||||
// Government money (60-features/99-pie-subsidies.js): Pie Control's Gov tab, a bid, the Ex-Im loan.
|
||||
pieGovOpen:()=>{if(!S||pzOn()||!pieOn())return;UI.pieTab='gov';UI.confirm=null;pieModal();},
|
||||
// Government money (60-features/99-pie-subsidies.js): its section in the bank, a bid, the Ex-Im loan. It was Pie Control's Gov tab; the name stays for old toasts.
|
||||
pieGovOpen:()=>{if(!S||pzOn()||!pieOn())return;if(!$('modal').hidden)closeModal();ACT.bank();const g=$('bankGov');if(g&&g.scrollIntoView)g.scrollIntoView({block:'start'});},
|
||||
pieBid:({id,f})=>{const P=pieGet();f=+f;const a=P&&P.gov.auc.find(x=>x.id===id);if(!a||!PIE_RDF_BIDS.includes(f))return;if(!pieCanBuild())return pieNo(tr('pie.why_not_t1'));
|
||||
a.bid=f;toast(tr('pie_gov.t_bid',{city:esc(CITY[a.city].name),mo:fmt$(Math.round(a.ask*f)),d:dateStr(a.close)}),'good');sfx('click');pieRe();},
|
||||
pieExim:()=>{const P=pieGet();if(!P||!P.co)return;if(!pieCanBuild())return pieNo(tr('pie.why_not_t1'));if(!pieEximTake())return pieRe();
|
||||
const l=pieEximLoan();toast(`<b>${tr('interface.amt_from_bank_has_landed',{amt:fmt$(l.amount),bank:esc(BANKS.exim.name)})}</b><br>${loanSummary(l)}`,'good');sfx('coin');pieRe();},
|
||||
pieTab:({t})=>{if(!PIE_TABS.includes(t))return;UI.pieTab=t;pieModal();},
|
||||
pieTab:({t})=>{if(t==='gov')return ACT.pieGovOpen();if(!PIE_TABS.includes(t)&&t!=='book'&&t!=='founder')return;UI.pieTab=pieTabOf(t);pieModal();},
|
||||
pieHi:({id})=>{if(typeof id!=='string')return;sfx('click');pieHiSet(id);},
|
||||
pieCity:({v})=>{if(!S||!S.pops[v])return;UI.pieCity=v;pieModal();},
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue