diff options
Diffstat (limited to 'public')
-rw-r--r-- | public/common/play.js | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/public/common/play.js b/public/common/play.js index 9432be4..aeb30b9 100644 --- a/public/common/play.js +++ b/public/common/play.js @@ -646,8 +646,9 @@ async function init_replay() { try { eval_action(replay[p]); } catch (err) { - console.log("ERROR IN REPLAY", p, replay[p], s.state, s.automatic_disruption); - replay.length = p; + console.log("ERROR IN REPLAY %d %s %s/%s/%s", p, s.state, replay[p].role, replay[p].action, replay[p].arguments); + console.log(err); + replay.length = 0; break; } @@ -773,17 +774,18 @@ async function init_replay() { update_replay_view(); } + let div = document.createElement("div"); + div.className = "replay"; + if (replay.length > 0) + text_button(div, "Active", () => set_viewpoint("Active")); + for (let r of roles) + text_button(div, r.role, () => set_viewpoint(r.role)); + text_button(div, "Observer", () => set_viewpoint("Observer")); + document.querySelector("header").appendChild(div); + if (replay.length > 0) { console.log("REPLAY READY"); - let div = document.createElement("div"); - div.className = "replay"; - text_button(div, "Active", () => set_viewpoint("Active")); - for (let r of roles) - text_button(div, r.role, () => set_viewpoint(r.role)); - text_button(div, "Observer", () => set_viewpoint("Observer")); - document.querySelector("header").appendChild(div); - div = document.createElement("div"); div.className = "replay"; text_button(div, "<<<", () => goto_replay(1)); |