Skip to content

Commit

Permalink
Make round end player independant from round end text
Browse files Browse the repository at this point in the history
  • Loading branch information
Simyon264 committed Aug 20, 2024
1 parent ab733d8 commit 1bdf4f2
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions ReplayBrowser/Pages/Shared/MainLayout.razor
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,26 @@
return 1;
}
return 0;
});
});
data.roundEndPlayers.forEach(player => {
let job = "Unknown";
if (player.jobPrototypes.length > 0) {
job = player.jobPrototypes[0];
}
let playerText = `<a href="/player/${player.playerGuid}"><span style="color: gray">${player.playerOocName}</span></a> was <bold>${player.playerIcName}</bold> playing role of <span style="color: orange"><bold>${job}</bold></span>`;
if (player.antagPrototypes.length > 0) {
playerText = `<a href="/player/${player.playerGuid}"><span style="color: red">${player.playerOocName}</span></a> was <span style="color:red"><bold>${player.playerIcName}</bold></span> playing role of <span style="color: orange"><bold>${job}</bold></span>`;
}
// Need to show the guid as well
playerText += `<br><span style="color: gray;font-size: x-small;"> ${player.playerGuid}</span>`;
playerList += playerText + "<br>";
});
players.innerHTML = playerList;
}
if (!data.roundEndText || data.roundEndText.trim() == "") {
endTextElement.innerHTML = "No round end text available.";
return
} else {
const colorTagPattern = new RegExp("\\[color=(.*?)\\](.*?)\\[/color\\]", "g");
const colorTagReplacement = "<span style=\"color:$1\">$2</span>";
Expand All @@ -209,21 +223,6 @@
.replaceAll("\n", "<br>")
.replaceAll(boldTagPattern, boldTagReplacement);
}
data.roundEndPlayers.forEach(player => {
let job = "Unknown";
if (player.jobPrototypes.length > 0) {
job = player.jobPrototypes[0];
}
let playerText = `<a href="/player/${player.playerGuid}"><span style="color: gray">${player.playerOocName}</span></a> was <bold>${player.playerIcName}</bold> playing role of <span style="color: orange"><bold>${job}</bold></span>`;
if (player.antagPrototypes.length > 0) {
playerText = `<a href="/player/${player.playerGuid}"><span style="color: red">${player.playerOocName}</span></a> was <span style="color:red"><bold>${player.playerIcName}</bold></span> playing role of <span style="color: orange"><bold>${job}</bold></span>`;
}
// Need to show the guid as well
playerText += `<br><span style="color: gray;font-size: x-small;"> ${player.playerGuid}</span>`;
playerList += playerText + "<br>";
});
players.innerHTML = playerList;
}
</script>

0 comments on commit 1bdf4f2

Please sign in to comment.