CristianVasile23 / conversation-hud

A simple FoundryVTT module that adds a nice HUD that display the portraits of all the characters present in a conversation.
MIT License
17 stars 3 forks source link

[Feature Request] option to set name as Unknown #33

Closed DiceKnights closed 6 months ago

DiceKnights commented 8 months ago

I love this module!!! Thank you so much for your work on creating it.

This may already exist and I just can't figure out how to do it. But would be great to have the name showing up conditional on the PCs normally being able to see the token name. So if it is a token for a creature or NPC that has it's name hidden to them it doesn't show in the conversation HUD and could even be blank or replaced with ???/unknown (perhaps this could be customizable).

Thanks, Shane

CristianVasile23 commented 8 months ago

First of all, I'm glad that this module has been of use to you and thanks for the kind words! :D

As to the request, at the moment there isn't really a way to hide the names other than manually setting it to Unknown or leaving the name field blank at which point the module will automatically set it as Anonymous. I will look into a way to automatically hide the names based on whether or not the NPC's name is hidden.

ronin-seven commented 7 months ago

+1 to this request. However, most of my conversations are with theater of the mind NPCs, so they do not usually have tokens. It would be nice if a "Hide names on conversation start" checkbox was available in the conversation journal with a toggle name visibility button available on the portrait. Perhaps a sub-choice checkbox to include banners if the "Hide" option is checked.

Edit: Actually, I went ahead and implemented a Known checkbox column in the journal with a Handshake button for each NPC in the side list that reveals the name/faction if not already known. Works great for my use case.

CristianVasile23 commented 6 months ago

With release 5.4.0 I have added an option to hide the name of a participant, in which case Unknown will be displayed. Down the line, I will probably add the option to customize what is showcased when the participant name is hidden.

@DiceKnights, since the option to hide the name is a setting tied to participants, in order to hide the name of the token that is being added to a conversation you will need to set the displayName field to false. If you are using macros, this is a slight alteration of the macro provided by the module that only shows the token name when the display name dropdown is either Hovered by Anyone or Always for Everyone.

const controlledTokens = canvas.tokens.controlled;

const conversationParticipants = controlledTokens.map((token) => {
  const participant = game.ConversationHud.tokenToParticipant(token);

  if (token.document.displayName !== 30 && token.document.displayName !== 50) {
    participant.displayName = false;
  }

  return participant;
});

if (conversationParticipants.length === 0) {
  ui.notifications.error(game.i18n.localize("CHUD.errors.noSelectedTokens"));
} else {
  if (game.ConversationHud.conversationIsActive) {
    game.ConversationHud.toggleTokenParticipantsConversationStatus(conversationParticipants);
  } else {
    game.ConversationHud.startConversationFromData(conversationParticipants);
  }
}

In the future, I might also add a checkbox in the participant list in order to easily toggle the know/unknown feature, as suggested by @ronin-seven. For now however, I think this implementation suffices.

That said, if there are any questions or issues, feel free to reach out!