+ setOptions: function() {
+ let options = {};
+ // Get/set options variables / TODO: v-model?!
+ for (const check of this.V.Options.check || []) {
+ const elt = document.getElementById(check.variable + "_opt");
+ if (elt.checked) options[check.variable] = true;
+ }
+ for (const select of this.V.Options.select || []) {
+ const elt = document.getElementById(select.variable + "_opt");
+ options[select.variable] = parseInt(elt.value, 10) || elt.value;
+ }
+ if (!V.IsValidOptions(options)) {
+ alert(this.st.tr["Invalid options"]);
+ return;
+ }
+ document.getElementById("modalOptions").checked = false;
+ if (this.whatNext == "analyze") this.gotoAnalyze(options);
+ else this.startGame(this.whatNext, options);
+ },
+ startGame: function(mode, options) {
+ if (this.gameInProgress) return;
+ const next = (game, options) => {
+ this.gameInProgress = true;
+ this.display = "computer";
+ this.gameInfo.mode = mode;
+ this.$refs["compgame"].launchGame(game, options);
+ };
+ if (!!options) {
+ next(null, options);