Add real-time sales automation and automatic paid repairs

Add independent toggles for auto-accept in Deals and auto-pay repairs in
NOC. Save both settings and default them off for older or malformed saves.

Check sales every five wall-clock seconds regardless of game speed, and
show a small countdown on Accept buttons in Deals, city offers and fiber
broker offers. Only sign when all requirements, locations, equipment and
service capacity are ready. Trial the added demand before accepting it,
protect healthy existing customers and account for booked future events.

Use the existing paid repair action for affordable active incidents,
including slow router reboots. Skip expired incidents, removed equipment,
DDoS attacks and repairs that were already rushed. Pause both automations
with the game, hidden pages and open dialogs.

Translate the controls into all five supported languages and cover timing,
countdowns, capacity, budgets, repair payments, persistence, mobile controls
and trial rollback with deterministic tests. Chromium checks verify about
five real seconds at both 0.5x and 8x game speed and exercise the supplied
large save without changing the save file.
This commit is contained in:
logfro 2026-10-28 02:19:30 +01:00
parent ad94833ad1
commit abe92fe3b1
14 changed files with 388 additions and 6 deletions

View file

@ -10,6 +10,7 @@ function frame(now){
if(UI.panelsDue){UI.panelsDue=false;if(!pressing){renderPanel();renderLeft();if(!$('dash').hidden)renderDash();renderBank();}renderHint();}
if(S&&!S.lost&&$('modal').hidden&&UI.speed){acc+=dt*UI.speed;let n=0;while(acc>=DAY_MS&&n<4&&UI.speed){acc-=DAY_MS;try{dayTick();}catch(e){tickErr(e);}n++;}
if(n){UI.ticking=true;renderHUD();UI.ticking=false;UI.panelsDue=true;}}
try{automationTick(now);renderAutoCountdown();}catch(e){tickErr(e);}
if(UI.speed&&!(S&&S.lost))animT+=dt; /* paused = frozen dots, waves and clouds */
const t=animOn()?animT:0;
if(!(UI.mapHid=mapHidden())&&!mapStill(t,now)){try{draw(t);}catch(e){tickErr(e);}UI.drawnAt=now;}