make custom board an experimental feature

This commit is contained in:
Laurent Mazet 2021-04-26 21:59:18 +02:00
parent 8b6bcf3a19
commit fac4ebf1a4
4 changed files with 14 additions and 1 deletions

View File

@ -285,3 +285,6 @@ msgstr "Êtes-vous sûr·e de vouloir de changer le type du plateau à {0} ? Cel
msgid "Can't find board '{0}'. Change board or start a new game." msgid "Can't find board '{0}'. Change board or start a new game."
msgstr "Impossible de trouver le plateau de type '{0}'. Changez de type de plateau ou démarrez une nouvelle partie." msgstr "Impossible de trouver le plateau de type '{0}'. Changez de type de plateau ou démarrez une nouvelle partie."
msgid "Caution, this feature is experimental; any feedback will be appreciated"
msgstr "Attention, cette fonctionnalité est expérimentale ; tout commentaire sera grandement apprécié"

View File

@ -290,3 +290,6 @@ msgstr ""
msgid "Can't find board '{0}'. Change board or start a new game." msgid "Can't find board '{0}'. Change board or start a new game."
msgstr "" msgstr ""
msgid "Caution, this feature is experimental; any feedback will be appreciated"
msgstr ""

View File

@ -53,6 +53,9 @@ window.TrivabbleConf = {
// Cell captions. Could be "clip", "dots", "none" or "short" // Cell captions. Could be "clip", "dots", "none" or "short"
//CELL_CAPTIONS: "dots", //CELL_CAPTIONS: "dots",
// Enable custom board definitions
//ENABLE_CUSTOM_BOARD: false,
// I don't like trailing commas, here is a nice message for you reading this file :-) // I don't like trailing commas, here is a nice message for you reading this file :-)
HAVE_FUN: true HAVE_FUN: true
}; };

View File

@ -66,6 +66,7 @@
setConf("SCORE_LAST_PLAYER", true); setConf("SCORE_LAST_PLAYER", true);
setConf("ENABLE_TIMER", false); setConf("ENABLE_TIMER", false);
setConf("CELL_CAPTIONS", "dots"); // "clip", "dots", "none", "short" setConf("CELL_CAPTIONS", "dots"); // "clip", "dots", "none", "short"
setConf("ENABLE_CUSTOM_BOARD", false);
function isSetting(key) { function isSetting(key) {
return Object.prototype.hasOwnProperty.call(Conf, key) || return Object.prototype.hasOwnProperty.call(Conf, key) ||
@ -931,6 +932,9 @@
? format(_("You changed the board to {0} for language {1}"), newLabel, newLang) ? format(_("You changed the board to {0} for language {1}"), newLabel, newLang)
: format(_("{0} changed the board to {1} for language {2}"), msg.sender, newLabel, newLang) : format(_("{0} changed the board to {1} for language {2}"), msg.sender, newLabel, newLang)
); );
if (newLabel !== "15x15-7") {
infoMessage(_("Caution, this feature is experimental; any feedback will be appreciated"));
}
break; break;
} }
@ -2505,7 +2509,7 @@
return; return;
} }
if (Object.keys(BoardList).length > 1) { if (getSetting("ENABLE_CUSTOM_BOARD") && (Object.keys(BoardList).length > 1)) {
boardLabelSelect.textContent = ""; boardLabelSelect.textContent = "";
for (const key of Object.keys(BoardList)) { for (const key of Object.keys(BoardList)) {