This commit is contained in:
Mirco Wittrien 2023-11-01 13:00:43 +01:00
parent ec0a57057e
commit 69e867dff1
5 changed files with 64 additions and 46 deletions

View File

@ -452,6 +452,7 @@
"LazyImage": {"protos": ["loadImage", "getRatio", "getSrc"]}, "LazyImage": {"protos": ["loadImage", "getRatio", "getSrc"]},
"LazyImageZoomable": {"strings": ["renderLinkComponent", "onCloseImage"]}, "LazyImageZoomable": {"strings": ["renderLinkComponent", "onCloseImage"]},
"ListItemTooltip": {"strings": [".listItemWrapper", "tooltipClassName", "disableWrapper"]}, "ListItemTooltip": {"strings": [".listItemWrapper", "tooltipClassName", "disableWrapper"]},
"MemberListItem": {"strings": ["ownerTooltipText", "onClickPremiumGuildIcon:", "Messages.GUILD_OWNER"]},
"Mention": {"strings": [".iconType", ".color,", "),backgroundColor:"]}, "Mention": {"strings": [".iconType", ".color,", "),backgroundColor:"]},
"Menu": {"strings": ["\"empty\"", "getItemProps", "isUsingKeyboardNavigation"]}, "Menu": {"strings": ["\"empty\"", "getItemProps", "isUsingKeyboardNavigation"]},
"Message": {"strings": ["childrenMessageContent", "childrenRepliedMessage", "zalgo", ".buttonContainer"]}, "Message": {"strings": ["childrenMessageContent", "childrenRepliedMessage", "zalgo", ".buttonContainer"]},
@ -548,7 +549,7 @@
"UserMemberSince": {"strings": [".memberSinceContainer", ".USER_PROFILE_DISCORD_MEMBER_SINCE"]}, "UserMemberSince": {"strings": [".memberSinceContainer", ".USER_PROFILE_DISCORD_MEMBER_SINCE"]},
"UserMemberSinceSection": {"strings": ["userId:", "headingClassName", ".title", "guildMember:"]}, "UserMemberSinceSection": {"strings": ["userId:", "headingClassName", ".title", "guildMember:"]},
"UserMention": {"strings": [".inlinePreview", "\"@\"", "renderPopout:"]}, "UserMention": {"strings": [".inlinePreview", "\"@\"", "renderPopout:"]},
"UsernameSection": {"strings": [".shouldCopyOnClick", ".userTagDiscriminatorNoNickname"]}, "UsernameSection": {"strings": ["shouldCopyOnClick:", ".userTagDiscriminatorNoNickname"]},
"UserPopout": {"strings": ["{user:", "userId:", "\"Unexpected missing user\")", "getUser"]}, "UserPopout": {"strings": ["{user:", "userId:", "\"Unexpected missing user\")", "getUser"]},
"UserPopoutAvatar": {"strings": [".avatarDecorationHint", ".VIEW_PROFILE"], "noSearch": true}, "UserPopoutAvatar": {"strings": [".avatarDecorationHint", ".VIEW_PROFILE"], "noSearch": true},
"UserPopoutBody": {"strings": [".customStatusActivity", ".canDM", ".hidePersonalInformation", ".showCopiableUsername"]}, "UserPopoutBody": {"strings": [".customStatusActivity", ".canDM", ".hidePersonalInformation", ".showCopiableUsername"]},

View File

@ -2,7 +2,7 @@
* @name StaffTag * @name StaffTag
* @author DevilBro * @author DevilBro
* @authorId 278543574059057154 * @authorId 278543574059057154
* @version 1.5.9 * @version 1.6.0
* @description Adds a Crown/Tag to Server Owners (or Admins/Management) * @description Adds a Crown/Tag to Server Owners (or Admins/Management)
* @invite Jx3TjNS * @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien * @donate https://www.paypal.me/MircoWittrien
@ -91,11 +91,11 @@ module.exports = (_ => {
this.modulePatches = { this.modulePatches = {
before: [ before: [
"MessageHeader" "MessageHeader",
"NameContainer"
], ],
after: [ after: [
"MemberListItem", "UserProfileUsername",
"NameTag",
"UsernameSection", "UsernameSection",
"VoiceUser" "VoiceUser"
] ]
@ -260,10 +260,11 @@ module.exports = (_ => {
BDFDB.MessageUtils.rerenderAll(); BDFDB.MessageUtils.rerenderAll();
} }
processMemberListItem (e) { processNameContainer (e) {
if (!e.instance.props.user) return;
let userType = this.getUserType(e.instance.props.user, e.instance.props.channel && e.instance.props.channel.id); let userType = this.getUserType(e.instance.props.user, e.instance.props.channel && e.instance.props.channel.id);
if (userType && this.settings.tagPlaces.memberList) { if (userType && this.settings.tagPlaces.memberList) {
this.injectStaffTag(BDFDB.ObjectUtils.get(e.returnvalue, "props.decorators.props.children"), e.instance.props.user, userType, 1, { this.injectStaffTag(BDFDB.ObjectUtils.get(e.instance, "props.decorators.props.children"), e.instance.props.user, userType, 1, {
channelId: e.instance.props.channel && e.instance.props.channel.id, channelId: e.instance.props.channel && e.instance.props.channel.id,
tagClass: BDFDB.disCN.bottagmember tagClass: BDFDB.disCN.bottagmember
}); });
@ -286,52 +287,63 @@ module.exports = (_ => {
processVoiceUser (e) { processVoiceUser (e) {
if (e.instance.props.user && this.settings.tagPlaces.voiceList) { if (e.instance.props.user && this.settings.tagPlaces.voiceList) {
let userType = this.getUserType(e.instance.props.user, e.instance.props.channel && e.instance.props.channel.id); let userType = this.getUserType(e.instance.props.user, e.instance.props.channel && e.instance.props.channel.id);
if (userType) { if (!userType) return;
let content = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.voicecontent]]}); let content = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.voicecontent]]});
if (content) this.injectStaffTag(content.props.children, e.instance.props.user, userType, 3, { if (content) this.injectStaffTag(content.props.children, e.instance.props.user, userType, 3, {
channelId: e.instance.props.channel && e.instance.props.channel.id, channelId: e.instance.props.channel && e.instance.props.channel.id,
}); });
}
} }
} }
processNameTag (e) { processNameTag (e) {
if (e.instance.props.user && e.instance.props.className) { if (!e.instance.props.user || !e.instance.props.className) return;
let userType = this.getUserType(e.instance.props.user); let userType = this.getUserType(e.instance.props.user);
if (userType) { if (!userType) return;
let inject = false, tagClass = ""; let inject = false, tagClass = "";
if (e.instance.props.className.indexOf(BDFDB.disCN.userpopoutheadertagnonickname) > -1) { if (e.instance.props.className.indexOf(BDFDB.disCN.userpopoutheadertagwithnickname) > -1) {
inject = this.settings.tagPlaces.userPopout; inject = this.settings.tagPlaces.userPopout;
tagClass = BDFDB.disCNS.userpopoutheaderbottag + BDFDB.disCN.bottagnametag; tagClass = BDFDB.disCNS.userpopoutheaderbottag + BDFDB.disCN.bottagnametag;
}
else if (e.instance.props.className.indexOf(BDFDB.disCN.userprofilenametag) > -1) {
inject = this.settings.tagPlaces.userProfile;
tagClass = BDFDB.disCN.bottagnametag;
}
if (inject) this.injectStaffTag(e.returnvalue.props.children, e.instance.props.user, userType, 2, {
tagClass: tagClass,
useRem: e.instance.props.useRemSizes,
inverted: e.instance.props.invertBotTagColor
});
}
} }
else if (e.instance.props.className.indexOf(BDFDB.disCN.userprofilenametag) > -1) {
inject = this.settings.tagPlaces.userProfile;
tagClass = BDFDB.disCN.bottagnametag;
}
if (inject) this.injectStaffTag(e.returnvalue.props.children, e.instance.props.user, userType, 2, {
tagClass: tagClass,
useRem: e.instance.props.useRemSizes,
inverted: e.instance.props.invertBotTagColor
});
} }
processUsernameSection (e) { processUsernameSection (e) {
if (e.instance.props.user && this.settings.tagPlaces.userPopout) { if (e.instance.props.user && this.settings.tagPlaces.userPopout) {
let userType = this.getUserType(e.instance.props.user, e.instance.props.channel && e.instance.props.channel.id); let userType = this.getUserType(e.instance.props.user, e.instance.props.channel && e.instance.props.channel.id);
if (userType) { if (!userType) return;
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props: [["className", BDFDB.disCN.userpopoutheadernickname]]}); let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props: [["className", BDFDB.disCN.userpopoutheadernickname]]});
if (index > -1) { if (index > -1) {
if (!BDFDB.ArrayUtils.is(children[index].props.children)) children[index].props.children = [children[index].props.children].flat(10); if (!BDFDB.ArrayUtils.is(children[index].props.children)) children[index].props.children = [children[index].props.children].flat(10);
this.injectStaffTag(children[index].props.children, e.instance.props.user, userType, 2, { this.injectStaffTag(children[index].props.children, e.instance.props.user, userType, 2, {
tagClass: BDFDB.disCNS.userpopoutheaderbottag + BDFDB.disCN.bottagnametag, tagClass: BDFDB.disCNS.userpopoutheaderbottag + BDFDB.disCN.bottagnametag,
inverted: typeof e.instance.getMode == "function" && e.instance.getMode() !== "Normal" inverted: typeof e.instance.getMode == "function" && e.instance.getMode() !== "Normal"
}); });
}
} }
} }
} }
processUserProfileUsername (e) {
if (e.instance.props.user && this.settings.tagPlaces.userProfile) {
let userType = this.getUserType(e.instance.props.user, e.instance.props.channel && e.instance.props.channel.id);
if (!userType) return;
let username = BDFDB.ReactUtils.findChild(e.returnvalue, {props: ["children", "style", "variant"]});
if (!username) return;
username.props.children = [username.props.children];
this.injectStaffTag(username.props.children, e.instance.props.user, userType, 2, {
tagClass: BDFDB.disCN.bottagnametag,
useRem: e.instance.props.useRemSizes,
inverted: e.instance.props.invertBotTagColor
});
}
}
injectStaffTag (children, user, userType, insertIndex, config = {}) { injectStaffTag (children, user, userType, insertIndex, config = {}) {
if (!BDFDB.ArrayUtils.is(children) || !user) return; if (!BDFDB.ArrayUtils.is(children) || !user) return;

View File

@ -5505,7 +5505,7 @@ button.button__4f306.enabled__470f0:hover svg {
} }
#app-mount .lookLink__93965.colorPrimary__6ed40:hover .contents_fb6220, #app-mount .lookLink__93965.colorPrimary__6ed40:hover .contents_fb6220,
#app-mount .lookLink__93965.hoverPrimary__3e6c3.hasHover__3ab8c:hover .contents_fb6220 { #app-mount .lookLink__93965.hoverPrimary__3e6c3.hasHover__3ab8c:hover .contents_fb6220 {
background-image: linear-gradient(0deg, transparent, transparent 1px, rgb(var(--textdarkest)) 0, rgb(var(--textdarkest)) 2px, transparent 0); --button--underline-color: rgb(var(--textdarkest));
color: rgb(var(--textdarkest)); color: rgb(var(--textdarkest));
} }
@ -5569,7 +5569,7 @@ button.button__4f306.enabled__470f0:hover svg {
} }
#app-mount .lookLink__93965.colorTransparent__4c280:hover .contents_fb6220, #app-mount .lookLink__93965.colorTransparent__4c280:hover .contents_fb6220,
#app-mount .lookLink__93965.hoverTransparent_a4eefd.hasHover__3ab8c:hover .contents_fb6220 { #app-mount .lookLink__93965.hoverTransparent_a4eefd.hasHover__3ab8c:hover .contents_fb6220 {
background-image: linear-gradient(0deg, transparent,transparent 1px,rgb(var(--textbrighter)) 0,rgb(var(--textbrighter)) 2px,transparent 0); --button--underline-color: rgb(var(--textbright));
color: rgb(var(--textbright)); color: rgb(var(--textbright));
} }

View File

@ -799,6 +799,9 @@
.background_b61fcc .lookLink__93965.colorLink_b651e5 { .background_b61fcc .lookLink__93965.colorLink_b651e5 {
color: rgb(var(--accentcolor)); color: rgb(var(--accentcolor));
} }
.background_b61fcc .lookLink__93965.colorLink_b651e5:hover .contents_fb6220 {
--button--underline-color: rgb(var(--accentcolor));
}
.contentCircle_bc797d { /* accountsettings avatar upload */ .contentCircle_bc797d { /* accountsettings avatar upload */
background-color: rgb(var(--accentcolor)); background-color: rgb(var(--accentcolor));
} }
@ -1707,6 +1710,9 @@ a.metadataDownload__6b32d {
.reset__51b37.lookLink__93965.colorLink_b651e5 { .reset__51b37.lookLink__93965.colorLink_b651e5 {
color: rgb(var(--accentcolor)); color: rgb(var(--accentcolor));
} }
.reset__51b37.lookLink__93965.colorLink_b651e5:hover .contents_fb6220 {
--button--underline-color: rgb(var(--accentcolor));
}
/* ~~~~ 11. POPOUTS ~~~~ */ /* ~~~~ 11. POPOUTS ~~~~ */
@ -1962,8 +1968,7 @@ a.metadataDownload__6b32d {
} }
#app-mount .lookLink__93965.hoverBrand__98583.hasHover__3ab8c:hover .contents_fb6220, #app-mount .lookLink__93965.hoverBrand__98583.hasHover__3ab8c:hover .contents_fb6220,
#app-mount .lookLink__93965.hoverBrandNew_be3663.hasHover__3ab8c:hover .contents_fb6220 { #app-mount .lookLink__93965.hoverBrandNew_be3663.hasHover__3ab8c:hover .contents_fb6220 {
background-image: linear-gradient(0deg, transparent, transparent 1px, rgb(var(--accentcolor)) 0, rgb(var(--accentcolor)) 2px, transparent 0); --button--underline-color: rgb(var(--accentcolor));
color: rgb(var(--accentcolor));
} }
#app-mount .lookLink__93965.colorLink_b651e5 svg [fill*="hsl"] { #app-mount .lookLink__93965.colorLink_b651e5 svg [fill*="hsl"] {
fill: currentColor !important; fill: currentColor !important;

View File

@ -511,7 +511,7 @@ html .iconBadge__2abac {
} }
#app-mount .lookLink__93965.colorPrimary__6ed40:hover .contents_fb6220, #app-mount .lookLink__93965.colorPrimary__6ed40:hover .contents_fb6220,
#app-mount .lookLink__93965.hoverPrimary__3e6c3.hasHover__3ab8c:hover .contents_fb6220 { #app-mount .lookLink__93965.hoverPrimary__3e6c3.hasHover__3ab8c:hover .contents_fb6220 {
background-image: linear-gradient(0deg, transparent, transparent 1px, rgb(var(--textbrightest)) 0, rgb(var(--textbrightest)) 2px, transparent 0); --button--underline-color: var(--header-primary);
color: var(--header-primary); color: var(--header-primary);
} }
@ -577,7 +577,7 @@ html .iconBadge__2abac {
} }
#app-mount .lookLink__93965.colorTransparent__4c280:hover .contents_fb6220, #app-mount .lookLink__93965.colorTransparent__4c280:hover .contents_fb6220,
#app-mount .lookLink__93965.hoverTransparent_a4eefd.hasHover__3ab8c:hover .contents_fb6220 { #app-mount .lookLink__93965.hoverTransparent_a4eefd.hasHover__3ab8c:hover .contents_fb6220 {
background-image: linear-gradient(0deg, transparent,transparent 1px,rgb(var(--textbrighter)) 0,rgb(var(--textbrighter)) 2px,transparent 0); --button--underline-color: var(--text-normal);
color: var(--text-normal); color: var(--text-normal);
} }