Bonk Host

Makes hosting rooms in bonk.io better

< 脚本Bonk Host的反馈

评价:好评 - 脚本运行良好

§
发表于:2024-01-15
编辑于:2024-01-15

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 });

发表回复

登录以发表回复。