|
|
@ -26,6 +26,11 @@ import { CompactPronounsChatComponentWrapper, PronounsChatComponentWrapper } fro
|
|
|
|
import { useProfilePronouns } from "./pronoundbUtils";
|
|
|
|
import { useProfilePronouns } from "./pronoundbUtils";
|
|
|
|
import { settings } from "./settings";
|
|
|
|
import { settings } from "./settings";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const PRONOUN_TOOLTIP_PATCH = {
|
|
|
|
|
|
|
|
match: /text:(.{0,10}.Messages\.USER_PROFILE_PRONOUNS)(?=,)/,
|
|
|
|
|
|
|
|
replace: '$& + (typeof vcPronounSource !== "undefined" ? ` (${vcPronounSource})` : "")'
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
export default definePlugin({
|
|
|
|
export default definePlugin({
|
|
|
|
name: "PronounDB",
|
|
|
|
name: "PronounDB",
|
|
|
|
authors: [Devs.Tyman, Devs.TheKodeToad, Devs.Ven],
|
|
|
|
authors: [Devs.Tyman, Devs.TheKodeToad, Devs.Ven],
|
|
|
@ -50,18 +55,24 @@ export default definePlugin({
|
|
|
|
// Patch the profile popout username header to use our pronoun hook instead of Discord's pronouns
|
|
|
|
// Patch the profile popout username header to use our pronoun hook instead of Discord's pronouns
|
|
|
|
{
|
|
|
|
{
|
|
|
|
find: ".userTagNoNickname",
|
|
|
|
find: ".userTagNoNickname",
|
|
|
|
replacement: {
|
|
|
|
replacement: [
|
|
|
|
match: /=(\i)\.pronouns/,
|
|
|
|
{
|
|
|
|
replace: "=$self.useProfilePronouns($1.user.id)"
|
|
|
|
match: /,(\i)=(\i)\.pronouns/,
|
|
|
|
}
|
|
|
|
replace: ",[$1,vcPronounSource]=$self.useProfilePronouns($2.user.id)"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
PRONOUN_TOOLTIP_PATCH
|
|
|
|
|
|
|
|
]
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// Patch the profile modal username header to use our pronoun hook instead of Discord's pronouns
|
|
|
|
// Patch the profile modal username header to use our pronoun hook instead of Discord's pronouns
|
|
|
|
{
|
|
|
|
{
|
|
|
|
find: ".USER_PROFILE_ACTIVITY",
|
|
|
|
find: ".USER_PROFILE_ACTIVITY",
|
|
|
|
replacement: {
|
|
|
|
replacement: [
|
|
|
|
match: /\).showPronouns/,
|
|
|
|
{
|
|
|
|
replace: ").showPronouns||true;const vcPronounce=$self.useProfilePronouns(arguments[0].user.id);if(arguments[0].displayProfile&&vcPronounce)arguments[0].displayProfile.pronouns=vcPronounce"
|
|
|
|
match: /getGlobalName\(\i\);(?<=displayProfile.{0,200})/,
|
|
|
|
}
|
|
|
|
replace: "$&const [vcPronounce,vcPronounSource]=$self.useProfilePronouns(arguments[0].user.id);if(arguments[0].displayProfile&&vcPronounce)arguments[0].displayProfile.pronouns=vcPronounce;"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
PRONOUN_TOOLTIP_PATCH
|
|
|
|
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
|
|