feat: display campaign createdAt in UI card
Campaign card now shows created date/time next to char/encounter counts. Lets DM tell newest campaign apart (replay tool creates many). createdAt already set at campaign create (line 2174). Display renders formatted: 'Jul 1, 2026, 16:32'. replay-combat.js: campaign + encounter names now include timestamp (new Date().toLocaleString) for easy identification. WS collection push verified live (injected test campaigns appeared without reload).
This commit is contained in:
@@ -91,7 +91,7 @@ async function main() {
|
||||
const encounterId = crypto.randomUUID();
|
||||
|
||||
await storage.setDoc(getPath.campaign(campaignId), {
|
||||
name: 'Replay Campaign',
|
||||
name: `Replay Campaign (${new Date().toLocaleString('en-US', { hour12: false })})`,
|
||||
playerDisplayBackgroundUrl: '',
|
||||
ownerId: 'replay',
|
||||
createdAt: new Date().toISOString(),
|
||||
@@ -121,7 +121,7 @@ async function main() {
|
||||
];
|
||||
|
||||
await storage.setDoc(getPath.encounter(campaignId, encounterId), {
|
||||
name: 'Big Boss Replay',
|
||||
name: `Big Boss Replay (${new Date().toLocaleString('en-US', { hour12: false })})`,
|
||||
campaignId,
|
||||
createdAt: new Date().toISOString(),
|
||||
participants,
|
||||
@@ -184,7 +184,9 @@ async function main() {
|
||||
const p = enc.participants.find(x => x.id === id);
|
||||
return p ? `${p.name}:${p.initiative}` : id;
|
||||
}).join(',');
|
||||
console.log(` turn ${totalTurns} (round ${enc.round}): ${actorName} | order=[${ordStr}] cur=${enc.currentTurnParticipantId}`);
|
||||
// Also dump participants[] order (display source). Diverge from order = sync bug.
|
||||
const pStr = enc.participants.map(p => `${p.name}:${p.initiative}`).join(',');
|
||||
console.log(` turn ${totalTurns} (round ${enc.round}): ${actorName} | order=[${ordStr}] parts=[${pStr}] cur=${enc.currentTurnParticipantId}`);
|
||||
|
||||
// 1. damage: actor hits a random living, active target.
|
||||
if (actor) {
|
||||
|
||||
Reference in New Issue
Block a user