$ steps through the open offers, soonest to expire first
$ moves the map to the next offer's city, in the Deals list's order, opens the Customers tab on a POP and marks the offer under Offers here (UI.offerAt, the existing .row.on style). Two offers in one city each get a press; any other selection clears the mark. With nothing on the table it says so with the Deals tab's own "No open offers" text.
This commit is contained in:
parent
daec638bfc
commit
3192f42b5a
13 changed files with 44 additions and 9 deletions
|
|
@ -49,6 +49,10 @@ const ACT={
|
|||
findGo:({city})=>{if(!isCity(city))return;closeModal();$('dash').hidden=true;ACT.focusCity({city});},
|
||||
focusCity:({city})=>{selectCity(city);const C=CITY[city];cam.x=C.x;cam.y=C.y;cam.z=Math.max(cam.z,1.2);if(innerWidth<760)UI.leftOpen=false;renderLeft();},
|
||||
popStep:({d})=>{const L=popOrder(),n=L.length;if(!n)return;const i=UI.sel&&UI.sel.type==='city'?L.indexOf(UI.sel.id):-1;$('dash').hidden=true;ACT.focusCity({city:L[i<0?(d>0?0:n-1):(i+(d>0?1:n-1))%n]});},
|
||||
// The offer stays marked in its city's Offers here until something else is selected, so two offers in one city each get a press.
|
||||
offerStep:()=>{const L=offerOrder(),n=L.length;if(!n){toast(tr('hud_and_panels.no_open_offers_right_now_businesses'));return;}
|
||||
const i=L.findIndex(o=>o.id===UI.offerAt),o=L[(i+1)%n];$('dash').hidden=true;ACT.focusCity({city:o.city});UI.offerAt=o.id;if(S.pops[o.city])UI.tab='cust';renderPanel();
|
||||
const r=document.querySelector('#panelBody .row.on');if(r&&r.scrollIntoView)r.scrollIntoView({block:'nearest'});},
|
||||
zoomStep:({d})=>zoomAt(CW/2,CH/2,d>0?1.25:0.8),
|
||||
keys:()=>showKeys(),
|
||||
selLink:({id})=>{selectLink(id);focusLink(id);},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue