fixed train# specific rules. cleaned up display topline and train display on division map

This commit is contained in:
Jesse
2026-08-09 19:44:18 -04:00
parent 4a800a053a
commit 6ead39c530
14 changed files with 316 additions and 57 deletions
+27 -4
View File
@@ -152,9 +152,17 @@ function render(): void {
renderTurnChart(f);
$('revenue').textContent = String(f.revenue);
/**
* THE OBJECTIVE, WITHOUT THE COMMENTARY.
*
* It used to read "3 of 20 · 2 Days left · behind the pace (expected 8)". The score, the target and
* the Days left are what a player steers by; the pace verdict and the engine's guess at what the
* score ought to be were an opinion taking up the one line that must not wrap — and the expected
* figure came from a target that is itself an open question.
*/
const obj = $('objective');
obj.textContent = f.objective.note;
obj.className = f.objective.onPace ? 'pace good' : 'pace behind';
obj.textContent = `${f.revenue} of ${f.objective.target} · ${f.objective.daysLeft} Day${f.objective.daysLeft === 1 ? '' : 's'} left`;
obj.className = 'pace';
$('seed').textContent = String(game.seed);
// -- division
@@ -794,9 +802,24 @@ if (newBtn) {
const day = game.state.clock.day;
const started = game.state.status === 'active' && (day > 1 || game.state.clock.stage > 1);
if (started && !confirm(`Forget this game (seed ${game.seed}, Day ${day}) and deal a new one?`)) return;
/**
* ASK FOR THE SEED, rather than documenting a URL parameter in the title bar.
*
* The same deal can be replayed, shared or compared by seed, which is worth offering — it was
* offered as the note "add ?seed=1234 for a set deal", which spent width on the one line that
* must not wrap to explain a thing the button could simply ask. Blank means random.
*/
const asked = prompt('Seed for the new game — leave blank for a random one:', '');
if (asked === null) return; // cancelled
clearSave();
if (location.search === '') location.reload();
else location.search = '';
const wanted = asked.trim();
if (wanted === '') {
// No `?seed=`, so `start()` rolls one. Reload rather than re-render, to clear any seed in the URL.
if (location.search === '') location.reload();
else location.search = '';
return;
}
location.search = `?seed=${encodeURIComponent(wanted)}`;
};
}