fix a couple bugs, tweak colors

This commit is contained in:
AlecM33
2026-01-24 20:39:20 -05:00
parent f8aa4666b0
commit 6559e4ba0b
5 changed files with 53 additions and 36 deletions

View File

@@ -194,11 +194,15 @@ export const HTMLFragments = {
<label id='players-alive-label'></label>
<div id="spectator-count" tabindex="0"></div>
<div id='game-player-list'>
<div class='evil-players'>
<div id="independent-players" class='independent-players' style="display: none;">
<label class='independent'>Team Independent</label>
<div id='player-list-moderator-team-independent'></div>
</div>
<div id="evil-players" class='evil-players' style="display: none;">
<label class='evil'>Team Evil</label>
<div id='player-list-moderator-team-evil'></div>
</div>
<div class='good-players'>
<div id="good-players" class='good-players' style="display: none;">
<label class='good'>Team Good</label>
<div id='player-list-moderator-team-good'></div>
</div>

View File

@@ -391,7 +391,7 @@ function validateCustomRoleCookie (cookie) {
for (const entry of cookieJSON) {
if (entry !== null && typeof entry === 'object') {
if (typeof entry.role !== 'string' || entry.role.length > PRIMITIVES.MAX_CUSTOM_ROLE_NAME_LENGTH
|| typeof entry.team !== 'string' || (entry.team !== ALIGNMENT.GOOD && entry.team !== ALIGNMENT.EVIL)
|| typeof entry.team !== 'string' || (entry.team !== ALIGNMENT.GOOD && entry.team !== ALIGNMENT.EVIL && entry.team !== ALIGNMENT.INDEPENDENT)
|| typeof entry.description !== 'string' || entry.description.length > PRIMITIVES.MAX_CUSTOM_ROLE_DESCRIPTION_LENGTH
) {
return false;

View File

@@ -299,36 +299,45 @@ export class InProgress {
&& ((p.userType !== USER_TYPES.MODERATOR && p.userType !== USER_TYPES.SPECTATOR)
|| p.killed)
);
this.renderGroupOfPlayers(
teamEvil,
this.killPlayerHandlers,
this.revealRoleHandlers,
this.stateBucket.currentGameState.accessCode,
ALIGNMENT.EVIL,
this.stateBucket.currentGameState.people.find(person =>
person.id === this.stateBucket.currentGameState.currentModeratorId).userType,
this.socket
);
this.renderGroupOfPlayers(
teamGood,
this.killPlayerHandlers,
this.revealRoleHandlers,
this.stateBucket.currentGameState.accessCode,
ALIGNMENT.GOOD,
this.stateBucket.currentGameState.people.find(person =>
person.id === this.stateBucket.currentGameState.currentModeratorId).userType,
this.socket
);
this.renderGroupOfPlayers(
teamIndependent,
this.killPlayerHandlers,
this.revealRoleHandlers,
this.stateBucket.currentGameState.accessCode,
ALIGNMENT.INDEPENDENT,
this.stateBucket.currentGameState.people.find(person =>
person.id === this.stateBucket.currentGameState.currentModeratorId).userType,
this.socket
);
if (teamEvil.length > 0) {
document.getElementById(`${ALIGNMENT.EVIL}-players`).style.display = 'block';
this.renderGroupOfPlayers(
teamEvil,
this.killPlayerHandlers,
this.revealRoleHandlers,
this.stateBucket.currentGameState.accessCode,
ALIGNMENT.EVIL,
this.stateBucket.currentGameState.people.find(person =>
person.id === this.stateBucket.currentGameState.currentModeratorId).userType,
this.socket
);
}
if (teamGood.length > 0) {
document.getElementById(`${ALIGNMENT.GOOD}-players`).style.display = 'block';
this.renderGroupOfPlayers(
teamGood,
this.killPlayerHandlers,
this.revealRoleHandlers,
this.stateBucket.currentGameState.accessCode,
ALIGNMENT.GOOD,
this.stateBucket.currentGameState.people.find(person =>
person.id === this.stateBucket.currentGameState.currentModeratorId).userType,
this.socket
);
}
if (teamIndependent.length > 0) {
document.getElementById(`${ALIGNMENT.INDEPENDENT}-players`).style.display = 'block';
this.renderGroupOfPlayers(
teamIndependent,
this.killPlayerHandlers,
this.revealRoleHandlers,
this.stateBucket.currentGameState.accessCode,
ALIGNMENT.INDEPENDENT,
this.stateBucket.currentGameState.people.find(person =>
person.id === this.stateBucket.currentGameState.currentModeratorId).userType,
this.socket
);
}
document.getElementById('players-alive-label').innerText =
'Players: ' + this.stateBucket.currentGameState.people.filter((person) => !person.out).length + ' / ' +
this.stateBucket.currentGameState.gameSize + ' Alive';

View File

@@ -609,7 +609,7 @@ input {
}
.independent, .compact-card.independent .card-role {
color: #d4a027 !important;
color: #af8523 !important;
font-weight: bold;
}

View File

@@ -424,7 +424,7 @@ h1 {
display: none;
position: relative;
border: 5px solid transparent;
background-color: #e3e3e3;
background-color: #efefef;
flex-direction: column;
cursor: pointer;
justify-content: space-between;
@@ -462,6 +462,10 @@ h1 {
border: 4px solid #c55454 !important;
}
.game-role-independent {
border: 4px solid #af8523 !important;
}
#game-role-back {
display: flex;
align-items: center;
@@ -548,7 +552,7 @@ h1 {
}
#game-role #role-name.independent {
color: #d4a027 !important;
color: #af8523 !important;
}
#role-image {