Bonk Host

Makes hosting rooms in bonk.io better

< Feedback on Bonk Host

Review: Good - script works

§
Posted: 15. 01. 2024
Edited: 15. 01. 2024

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

Post reply

Sign in to post a reply.