Makes hosting rooms in bonk.io better
< 腳本Bonk Host的回應
There's a bug when using freejoin in teams it keeps adding empty lines to the score board.
Here is a hacky fix to just not display the empty lines (only works for those who have the mod):
let scoresObserver = new MutationObserver((mutations, me) => { const scores_left = document.getElementById('ingamewinner_scores_left'); const scores_right = document.getElementById('ingamewinner_scores_right'); const left_corrected = scores_left.textContent.split('\r\n').filter(x => x !== ':'); const right_corrected = scores_right.textContent.split('\r\n').splice(0, left_corrected.length); scores_left.textContent = left_corrected.join('\r\n'); scores_right.textContent = right_corrected.join('\r\n'); }); scoresObserver.observe(document.getElementById('ingamewinner_scores'), { childList: true, subtree: true });
登入以回復
There's a bug when using freejoin in teams it keeps adding empty lines to the score board.
Here is a hacky fix to just not display the empty lines (only works for those who have the mod):