Skip to content

QoL UI-Moregano/Melron/Percival#767

Open
22Chaos wants to merge 1 commit intovck3000:masterfrom
22Chaos:qol-role-visibility-deceptive
Open

QoL UI-Moregano/Melron/Percival#767
22Chaos wants to merge 1 commit intovck3000:masterfrom
22Chaos:qol-role-visibility-deceptive

Conversation

@22Chaos
Copy link

@22Chaos 22Chaos commented Mar 3, 2026

  • Percival, Morgana, and Merlin now only see question marks if deceptive roles (Morgana,Melron,Moregano) are in play
  • Refactor role visibility logic for self-visibility
  • Post-game announcements for spiesMelronSaw and spiesMoreganoSaw now only triggered if respective roles are in play

- Percival, Morgana, and Merlin now only see question marks if deceptive roles (Morgana,Melron,Moregano) are in play
- Refactor role visibility logic for self-visibility
- Post-game announcements for spiesMelronSaw and spiesMoreganoSaw now only triggered if respective roles are in play
@22Chaos 22Chaos changed the title QoL patch: QoL UI-Moregano/Melronn/Percival Mar 6, 2026
@22Chaos 22Chaos changed the title QoL UI-Moregano/Melronn/Percival QoL UI-Moregano/Melron/Percival Mar 6, 2026

private announceIllusionsIfAny() {
// Melron
if(this.resRoles.includes(Role.Melron)) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please format code with prettier

if(this.resRoles.includes(Role.Melron)) {
const melronRole = this.specialRoles[Role.Melron];
if (melronRole) {
if (melronRole) { //TODO: is this if required now?
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your comment is correct. Let's remove this.

roleTags[
this.room.anonymizer.anon(this.room.playersInGame[i].username)
] = this.role;
}
Copy link
Owner

@vck3000 vck3000 Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you saying that currently in anon games, you don't see your own role tag in the UI?

Edit: Thinking about this a bit more, we should solve this a different way. It looks like the UI renders its own role tag through a different code path.

)
merlinsCount++;
}
for (let i = 0; i < this.room.playersInGame.length; i++) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please space it out and fix formatting too 🙏

moreganoExists = true;
break;
}
else continue;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line doesn't do anything :)

roleTags[
this.room.anonymizer.anon(this.room.playersInGame[i].username)
] = moreganoExists ? "Morgana?" : this.role;
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix formatting 🙏

] = 'Hitberon';
}


Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please undo the new lines here

{
roleTags[
this.room.anonymizer.anon(this.room.playersInGame[i].username)
] = moreganoExists ? "Morgana?" : this.role;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

data[i] = {
alliance: effectiveAlliance,
role: effectiveRole,
see: this.specialRoles[playerRoles[i].role].see(),
username: this.anonymizer.anon(playerRoles[i].username),
};

This is currently where we give the role that is displayed. Can we instead of doing all this logic, simply send to the client whether to show an extra "?" on the UI side?

if (playerData.username === gameData.username) {
//if rendering our own player, give it the role tag
//if he is vanilla resistance or vanilla spy
if (playerData.username === gameData.username && gameData.role === gameData.alliance) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you need this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants