"raw-loader!@/translations/rules/" +
this.gameInfo.vname + "/" +
this.st.lang + ".pug"
- )
+ ).default
+ .replace('export default "', "")
+ .replace(/";$/, "")
// Next two lines fix a weird issue after last update (2019-11)
.replace(/\\n/g, " ")
.replace(/\\"/g, '"')
- .replace('module.exports = "', "")
- .replace(/"$/, "")
.replace(/(fen:)([^:]*):/g, replaceByDiag)
);
}
else if (this.gameInProgress) this.display = "computer";
},
re_setVariant: async function(vname) {
+ const key = "rr_" + vname;
+ if (!localStorage.getItem(key))
+ // Mark rules as "read"
+ localStorage.setItem(key, '1');
await import("@/variants/" + vname + ".js")
.then((vModule) => {
this.V = window.V = vModule[vname + "Rules"];
this.$refs["compgame"].launchGame();
}
},
- // user wants to stop the game:
+ // The user wants to stop the game:
stopGame: function() {
this.$refs["compgame"].gameOver("?", "Undetermined result");
},