feat: add age-based event gating, event timer, and UI polish
- Add minAge/maxAge to events so infants can't go treasure hunting - Cache event panel DOM to prevent high-speed button destruction - Add 10s auto-select countdown for choice events - Fix event title/text field mapping (name/description → title/text) - Add rotating clock icon for time flow feedback - Fix speed/pause button active states - Fix shop affordability check (disable + show insufficient money) - Add red styling for unmet choice requirements - Fix log re-rendering on every tick
This commit is contained in:
+45
@@ -0,0 +1,45 @@
|
||||
const puppeteer = require('puppeteer-core');
|
||||
const sleep = (ms) => new Promise(r => setTimeout(r, ms));
|
||||
|
||||
(async () => {
|
||||
const browser = await puppeteer.launch({
|
||||
executablePath: '/usr/bin/chromium-browser',
|
||||
headless: true,
|
||||
args: ['--no-sandbox', '--disable-setuid-sandbox']
|
||||
});
|
||||
|
||||
const page = await browser.newPage();
|
||||
page.on('console', msg => console.log('CONSOLE:', msg.type(), msg.text()));
|
||||
page.on('pageerror', err => console.log('PAGEERROR:', err.message));
|
||||
|
||||
await page.goto('http://localhost:8765', { waitUntil: 'networkidle0' });
|
||||
await sleep(1500);
|
||||
|
||||
// Check internal state
|
||||
const stateInfo = await page.evaluate(() => {
|
||||
return {
|
||||
day: window._state?.day,
|
||||
alive: window._state?.alive,
|
||||
paused: window._state?.paused,
|
||||
reincarnation: window._state?.reincarnation,
|
||||
};
|
||||
});
|
||||
console.log('Internal state:', stateInfo);
|
||||
|
||||
// Try to manually tick
|
||||
await page.evaluate(() => {
|
||||
if (window._tick) {
|
||||
window._tick(10);
|
||||
console.log('Manual tick executed, day now:', window._state?.day);
|
||||
} else {
|
||||
console.log('tick function not exposed');
|
||||
}
|
||||
});
|
||||
|
||||
await sleep(500);
|
||||
|
||||
const day = await page.$eval('#day', el => el.textContent).catch(() => 'N/A');
|
||||
console.log('Day after manual tick:', day);
|
||||
|
||||
await browser.close();
|
||||
})();
|
||||
Reference in New Issue
Block a user