Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ShowMeYourName): Nick, Display, Username Permutations; Streamer Mode; Mentions; Affixes; Colors #3107

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

EtorixDev
Copy link
Contributor

Changes

  1. Added a setting to respect Streamer Mode which is enabled by default.
  2. Added all permutations (15) of Nick, Display, and Usernames.
    • Added a setting to exclude duplicates if there is overlap.
    • Nick/Display fill in for each other if either is missing, and if both are then username fills in.
  3. Set custom prefixes and suffixes (up to 3 characters long) for each. Example: Nick [DISPLAY] (@username)
    • The first in the order does not have the symbols unless the setting to always show the symbols for that specific name is enabled.
  4. Set custom colors for each, including separately for the prefixes and suffixes.
    • Accepts any hex(a), rgb(a), or hsl(a) input.
    • Accepts Role+-# input (ex: Role+15) to set it to the role color brightened/darkened by that percentage. Falls back to Discord's default gray.
    • Doesn't affect the first name listed unless the setting to always have the color for that specific name is enabled.
  5. Borrowed and modified @sadan4's pr ShowMeYourName: add support for user mentions #2938 to add a setting to display the names in @ mentions.
    • Added an additional setting to hide the default @ sign from mentions (and replies) due to the possibility of it visually conflicting with the prefixes and suffixes.

Ignore the branch name. I originally just planned to add streamer mode support before deciding to add more. (Also wasn't aware there was already a PR for that, oops.)

This PR adds a ton of settings due to the customization but it's all quite straightforward and the default settings should serve most people fine in my opinion if they don't want to tinker with anything.

Examples

Before Message
After Message
Before Mention
After Mention

import { GuildMember, User } from "discord-types/general";

const StreamerModeStore = findStoreLazy("StreamerModeStore");
const colorPattern = /^#(?:[\da-f]{3}){1,2}$|^#(?:[\da-f]{4}){1,2}$|(rgb|hsl)a?\((\s*-?\d+%?\s*,){2}(\s*-?\d+%?\s*)\)|(rgb|hsl)a?\((\s*-?\d+%?\s*,){3}\s*(0|(0?\.\d+)|1)\)$/iu;
Copy link
Contributor

Choose a reason for hiding this comment

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

it would be eaiser to just only allow an hex code as the color.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perhaps but it's already implemented and as far as I can tell quite robust and allows more freedom of input.

Copy link
Contributor

@sadan4 sadan4 left a comment

Choose a reason for hiding this comment

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

it would probably be eaiser if the user just passed a format string eg{username} ({nickname}) instead of having six settings for prefixes and suffixes

@EtorixDev
Copy link
Contributor Author

it would probably be eaiser if the user just passed a format string eg{username} ({nickname}) instead of having six settings for prefixes and suffixes

Updated to switch to a string format input instead of a drop down.

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