Toolbar polish: tool prices on buttons, robust stats listener, closeInfoPopup fix; tests on isolated ports
|
Before Width: | Height: | Size: 115 KiB After Width: | Height: | Size: 116 KiB |
|
Before Width: | Height: | Size: 165 KiB After Width: | Height: | Size: 158 KiB |
|
Before Width: | Height: | Size: 168 KiB After Width: | Height: | Size: 157 KiB |
|
Before Width: | Height: | Size: 202 KiB After Width: | Height: | Size: 196 KiB |
|
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 183 KiB After Width: | Height: | Size: 172 KiB |
|
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 75 KiB |
@@ -127,7 +127,7 @@ export class UI {
|
|||||||
b.classList.toggle('poor', money < +b.dataset.cost);
|
b.classList.toggle('poor', money < +b.dataset.cost);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
this.city.on('stats', s => affordability(s.money));
|
this.city.on('stats', () => affordability(this.city.money));
|
||||||
affordability(this.city.money);
|
affordability(this.city.money);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -160,7 +160,7 @@ export class UI {
|
|||||||
const cursors = { bulldoze: 'not-allowed', query: 'help' };
|
const cursors = { bulldoze: 'not-allowed', query: 'help' };
|
||||||
this.game.renderer.domElement.style.cursor =
|
this.game.renderer.domElement.style.cursor =
|
||||||
tool === 'none' ? 'grab' : (cursors[tool] || 'crosshair');
|
tool === 'none' ? 'grab' : (cursors[tool] || 'crosshair');
|
||||||
this.hideInfoPopup();
|
this.closeInfoPopup();
|
||||||
}
|
}
|
||||||
|
|
||||||
bindTopbar() {
|
bindTopbar() {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ const srv = createServer((q, r) => {
|
|||||||
try { r.setHeader('content-type', MIME[extname(p)] || 'application/octet-stream'); r.end(readFileSync(join(DIST, p))); }
|
try { r.setHeader('content-type', MIME[extname(p)] || 'application/octet-stream'); r.end(readFileSync(join(DIST, p))); }
|
||||||
catch { r.writeHead(404); r.end(); }
|
catch { r.writeHead(404); r.end(); }
|
||||||
});
|
});
|
||||||
await new Promise(r => srv.listen(4173, r));
|
await new Promise(r => srv.listen(4176, r));
|
||||||
|
|
||||||
let exe;
|
let exe;
|
||||||
{ const root = '/root/.cache/ms-playwright';
|
{ const root = '/root/.cache/ms-playwright';
|
||||||
@@ -28,7 +28,7 @@ const b = await chromium.launch({ executablePath: exe, args: ['--no-sandbox', '-
|
|||||||
const page = await b.newPage({ viewport: { width: 1280, height: 800 }, deviceScaleFactor: 1 });
|
const page = await b.newPage({ viewport: { width: 1280, height: 800 }, deviceScaleFactor: 1 });
|
||||||
await page.addInitScript(() => localStorage.setItem('polycity.settings.v1',
|
await page.addInitScript(() => localStorage.setItem('polycity.settings.v1',
|
||||||
JSON.stringify({ sound: false, shadows: true, autosave: true, minimap: true })));
|
JSON.stringify({ sound: false, shadows: true, autosave: true, minimap: true })));
|
||||||
await page.goto('http://127.0.0.1:4173/', { waitUntil: 'load' });
|
await page.goto('http://127.0.0.1:4176/', { waitUntil: 'load' });
|
||||||
await page.waitForTimeout(3500);
|
await page.waitForTimeout(3500);
|
||||||
try { const h = await page.$('#helpClose'); if (h) await h.click(); } catch {}
|
try { const h = await page.$('#helpClose'); if (h) await h.click(); } catch {}
|
||||||
await page.waitForTimeout(600);
|
await page.waitForTimeout(600);
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ const server = createServer((req, res) => {
|
|||||||
res.end(readFileSync(join(DIST, p)));
|
res.end(readFileSync(join(DIST, p)));
|
||||||
} catch { res.writeHead(404); res.end(); }
|
} catch { res.writeHead(404); res.end(); }
|
||||||
});
|
});
|
||||||
await new Promise(r => server.listen(4173, r));
|
await new Promise(r => server.listen(4175, r));
|
||||||
LOG('static server on :4173');
|
LOG('static server on :4175');
|
||||||
|
|
||||||
const errors = [];
|
const errors = [];
|
||||||
let closing = false;
|
let closing = false;
|
||||||
@@ -79,7 +79,7 @@ const sleep = (ms) => safe(`sleep ${ms}`, () => new Promise(r => setTimeout(r, m
|
|||||||
await safe('goto', () => page.addInitScript(() => {
|
await safe('goto', () => page.addInitScript(() => {
|
||||||
localStorage.setItem('polycity.settings.v1', JSON.stringify({ sound: false, shadows: false, autosave: true, minimap: true }));
|
localStorage.setItem('polycity.settings.v1', JSON.stringify({ sound: false, shadows: false, autosave: true, minimap: true }));
|
||||||
}));
|
}));
|
||||||
await safe('load', () => page.goto('http://127.0.0.1:4173/', { waitUntil: 'load', timeout: 20000 }));
|
await safe('load', () => page.goto('http://127.0.0.1:4175/', { waitUntil: 'load', timeout: 20000 }));
|
||||||
LOG('page loaded');
|
LOG('page loaded');
|
||||||
await sleep(3200);
|
await sleep(3200);
|
||||||
|
|
||||||
|
|||||||