X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=app.js;h=e269c5bf06f240043dba851d38bb539ad380e9c6;hb=f3336fdf24e48ef54aee71426d979f81ef744c14;hp=7f8dc274cf28376ebd9ece4b542aee6837d3b666;hpb=f46a68b8ed74b54b6a26645b88d2a4ae48c1227a;p=xogo.git diff --git a/app.js b/app.js index 7f8dc27..e269c5b 100644 --- a/app.js +++ b/app.js @@ -86,8 +86,9 @@ function cancelSeek() { if (send("cancelseek", {vname: seek_vname})) toggleVisible("newGame"); } -function sendRematch() { - if (send("rematch", {gid: gid})) toggleVisible("pendingRematch"); +function sendRematch(random) { + if (send("rematch", {gid: gid, random: !!random})) + toggleVisible("pendingRematch"); } function cancelRematch() { if (send("norematch", {gid: gid})) toggleVisible("newGame"); @@ -103,6 +104,7 @@ function showNewGameForm() { toggleVisible("newGameForm"); import(`/variants/${vname}/class.js`).then(module => { window.V = module.default; + for (const [k, v] of Object.entries(V.Aliases)) window[k] = v; prepareOptions(); }); } @@ -206,6 +208,7 @@ function fillGameInfos(gameInfos, oppIndex) { for (let j=i; j { } }; // Pack into one moves array, then send - curMoves.push({ - appear: move.appear, - vanish: move.vanish, - start: move.start, - end: move.end - }); + curMoves.push(move); if (vr.turn != playerColor) { toggleTurnIndicator(false); send("newmove", @@ -451,6 +449,7 @@ function initializeGame(obj) { const options = obj.options || {}; import(`/variants/${obj.vname}/class.js`).then(module => { window.V = module.default; + for (const [k, v] of Object.entries(V.Aliases)) window[k] = v; // Load CSS. Avoid loading twice the same stylesheet: const allIds = [].slice.call($.styleSheets).map(s => s.id); const newId = obj.vname + "_css";