mirror of
https://github.com/gwenhael-le-moine/c-urs_-toil-s.git
synced 2024-12-27 09:58:44 +01:00
displaying characters is optional and off by default
This commit is contained in:
parent
3c79be7be4
commit
aad2f4a3e0
1 changed files with 7 additions and 2 deletions
|
@ -95,7 +95,7 @@ function won_or_not( state ) {
|
||||||
return count_gifts( state ) === 0;
|
return count_gifts( state ) === 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
function format_level( state ) {
|
function format_level( state, text ) {
|
||||||
function Replacer( conversionObject ) {
|
function Replacer( conversionObject ) {
|
||||||
|
|
||||||
var regexpStr = '';
|
var regexpStr = '';
|
||||||
|
@ -119,6 +119,11 @@ function format_level( state ) {
|
||||||
'@': '<span class="starcell ball">@</span>'
|
'@': '<span class="starcell ball">@</span>'
|
||||||
};
|
};
|
||||||
substitutions[ state.moving ] = substitutions[ state.moving ].replace( '">', '_selected">' );
|
substitutions[ state.moving ] = substitutions[ state.moving ].replace( '">', '_selected">' );
|
||||||
|
if ( text == false ) {
|
||||||
|
for ( var c in substitutions ) {
|
||||||
|
substitutions[ c ] = substitutions[ c ].replace( />.</, '><' );
|
||||||
|
}
|
||||||
|
}
|
||||||
var myReplacer = Replacer( substitutions );
|
var myReplacer = Replacer( substitutions );
|
||||||
return myReplacer( state.board );
|
return myReplacer( state.board );
|
||||||
}
|
}
|
||||||
|
@ -132,7 +137,7 @@ function load_level( levelset, nb ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function display_level( state, elt ) {
|
function display_level( state, elt ) {
|
||||||
$( elt ).html( format_level( state ) );
|
$( elt ).html( format_level( state, false ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue