X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=score.js;h=f8bb712e58f491b74bafc39eb63d5a378c69b3a9;hb=22084c552fc5405860bcd4c7052736a48fb7a516;hp=273a311896ee3712ef8c87bc48d7971b4ab01f80;hpb=742194d6c8b42570e529c6099fa8125ad9e423f2;p=ultimatescore diff --git a/score.js b/score.js index 273a311..f8bb712 100644 --- a/score.js +++ b/score.js @@ -213,6 +213,13 @@ function time_elapsed_raw() clock_elapsed = clock_limit; clock_origin = Date.now(); clock_running = false; + + if (state['autocomment_on_clock_limit'] == '1' && !comment_visible) { + state['comment'] = state['autocomment']; + setcomment(); + showcomment(); + } + return clock_limit; } return clock_elapsed + elapsed; @@ -238,16 +245,15 @@ function time_elapsed2() return Math.floor(time_elapsed2_raw()); } -function update_clock() +function update_given_clock(elapsed, id) { - let elapsed = time_elapsed(); let min = Math.floor(elapsed / 60); let sec = elapsed % 60; if (sec < 10) sec = "0" + sec; let text = min + ":" + sec; - if (false) { + if (ultimateconfig['exohack']) { // This is a hack around the fact that Exo has variable-width numerals. // It doesn't look fantastic, but for the clock, it's better not to have // the text jumping around. @@ -259,22 +265,20 @@ function update_clock() html += "
" + text.charAt(i) + "
"; } } - document.getElementById('clock').innerHTML = html; + document.getElementById(id).innerHTML = html; } else { - document.getElementById('clock').innerHTML = text; + document.getElementById(id).innerHTML = text; } } -function update_clock2() +function update_clock() { - let elapsed = time_elapsed2(); - let min = Math.floor(elapsed / 60); - let sec = elapsed % 60; - - if (sec < 10) sec = "0" + sec; - let text = min + ":" + sec; + update_given_clock(time_elapsed(), 'clock'); +} - document.getElementById('clock2').innerHTML = text; +function update_clock2() +{ + update_given_clock(time_elapsed2(), 'clock2'); } function goalA()