From a7bc1445501d20ea56ae327d72602cf2abeed7d0 Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Fri, 21 May 2021 17:51:26 +0200 Subject: [PATCH] stuff --- Library/_res/BDFDB.data.json | 1 + Library/_res/BDFDB.raw.css | 11 +++++++++++ Plugins/EditUsers/EditUsers.plugin.js | 17 ++++++++++++----- Plugins/StaffTag/StaffTag.plugin.js | 16 +++++++++++++--- Themes/_res/UsrBgs.css | 9 +++++++++ 5 files changed, 46 insertions(+), 8 deletions(-) diff --git a/Library/_res/BDFDB.data.json b/Library/_res/BDFDB.data.json index 45780461ae..0065590c6b 100644 --- a/Library/_res/BDFDB.data.json +++ b/Library/_res/BDFDB.data.json @@ -3020,6 +3020,7 @@ "userpopoutheadertext_old": ["UserPopoutWrapper", "headerText"], "userpopoutheadertop_old": ["UserPopoutWrapper", "headerTop"], "userpopoutheaderbottagwithnickname": ["UserPopout", "headerBotTagWithNickname"], + "userpopoutheadertagdiscriminatornonickname": ["UserPopout", "headerTagDiscriminatorNoNickname"], "userpopoutheadername": ["UserPopout", "headerName"], "userpopoutheadernamewrapper": ["UserPopout", "headerNameWrapper"], "userpopoutheadernormal": ["UserPopout", "headerNormal"], diff --git a/Library/_res/BDFDB.raw.css b/Library/_res/BDFDB.raw.css index 746b1a6751..b0d933aee1 100644 --- a/Library/_res/BDFDB.raw.css +++ b/Library/_res/BDFDB.raw.css @@ -459,6 +459,17 @@ img:not([src]), img[src=""], img[src="null"] { text-overflow: ellipsis; } +[REPLACE_CLASS_userpopoutheadernamewrapper_old], +[REPLACE_CLASS_userpopoutheadernamewrapper], +[REPLACE_CLASS_userpopoutheadertagnonickname] { + display: flex; + align-items: center; + line-height: unset; +} +[REPLACE_CLASS_userpopoutheadertagdiscriminatornonickname] { + position: relative; + top: 1px; +} [REPLACE_CLASS_userinfodate] { user-select: text; margin-top: 8px; diff --git a/Plugins/EditUsers/EditUsers.plugin.js b/Plugins/EditUsers/EditUsers.plugin.js index 4172b812a7..350f02c80f 100644 --- a/Plugins/EditUsers/EditUsers.plugin.js +++ b/Plugins/EditUsers/EditUsers.plugin.js @@ -107,6 +107,7 @@ module.exports = (_ => { ChannelEditorContainer: "render", AutocompleteUserResult: "render", UserPopout: "render", + UserPopoutHeader: "default", UserProfile: "render", UserInfo: "default", NowPlayingHeader: "Header", @@ -140,6 +141,7 @@ module.exports = (_ => { DiscordTag: "default", NameTag: "default", UserPopout: "render", + UserPopoutHeader: "default", NowPlayingHeader: "Header", VoiceUser: "render", Account: "render", @@ -172,10 +174,6 @@ module.exports = (_ => { ${BDFDB.dotCN.voicedetailschannel}:hover > span[style*="color"] { text-decoration: underline; } - ${BDFDB.dotCNS.userpopoutheadernamewrapper + BDFDB.dotCN.bottag} { - position: relative; - bottom: 1px; - } ${BDFDB.dotCNS.dmchannel + BDFDB.dotCN.bottag} { display: inline; margin-left: 4px; @@ -445,6 +443,7 @@ module.exports = (_ => { let changeBackground = false; let tagClass = ""; switch (e.instance.props.className) { + case BDFDB.disCN.userpopoutheadertagnonickname_old: case BDFDB.disCN.userpopoutheadertagnonickname: change = this.settings.places.userPopout; guildId = BDFDB.LibraryModules.LastGuildStore.getGuildId(); @@ -485,6 +484,14 @@ module.exports = (_ => { } processUserPopout (e) { + this.handleUserPopout(e); + } + + processUserPopoutHeader (e) { + this.handleUserPopout(e); + } + + handleUserPopout (e) { if (e.instance.props.user && this.settings.places.userPopout) { let data = changedUsers[e.instance.props.user.id]; if (!e.returnvalue) { @@ -499,7 +506,7 @@ module.exports = (_ => { } else { if (data && (data.color1 || data.color2 || data.tag)) { - 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.userpopoutheadername_old, BDFDB.disCN.userpopoutheadername]]]}); if (index > -1) { this.changeUserColor(children[index], e.instance.props.user.id, {changeBackground: true}); this.injectBadge(children, e.instance.props.user.id, BDFDB.LibraryModules.LastGuildStore.getGuildId(), 2, { diff --git a/Plugins/StaffTag/StaffTag.plugin.js b/Plugins/StaffTag/StaffTag.plugin.js index 7d8da32ad0..111fbdbd7b 100644 --- a/Plugins/StaffTag/StaffTag.plugin.js +++ b/Plugins/StaffTag/StaffTag.plugin.js @@ -80,7 +80,8 @@ module.exports = (_ => { MessageUsername: "default", VoiceUser: "render", NameTag: "default", - UserPopout: "render" + UserPopout: "render", + UserPopoutHeader: "default" } }; @@ -266,6 +267,7 @@ module.exports = (_ => { if (userType) { let inject = false, tagClass = ""; switch (e.instance.props.className) { + case BDFDB.disCN.userpopoutheadertagnonickname_old: case BDFDB.disCN.userpopoutheadertagnonickname: inject = this.settings.tagPlaces.userPopout; tagClass = BDFDB.disCN.bottagnametag; @@ -285,12 +287,20 @@ module.exports = (_ => { } processUserPopout (e) { + this.handleUserPopout(e); + } + + processUserPopoutHeader (e) { + this.handleUserPopout(e); + } + + handleUserPopout (e) { 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); if (userType) { - let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props: [["className", BDFDB.disCN.userpopoutheadertagwithnickname]]}); + let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props: [["className", [BDFDB.disCN.userpopoutheadername_old, BDFDB.disCN.userpopoutheadername]]]}); if (index > -1) this.injectStaffTag(children, e.instance.props.user, userType, 2, { - tagClass: BDFDB.disCNS.userpopoutheaderbottagwithnickname + BDFDB.disCN.bottagnametag, + tagClass: BDFDB.disCNS.userpopoutheaderbottagwithnickname_old + BDFDB.disCNS.userpopoutheaderbottagwithnickname + BDFDB.disCN.bottagnametag, inverted: typeof e.instance.getMode == "function" && e.instance.getMode() !== "Normal" }); } diff --git a/Themes/_res/UsrBgs.css b/Themes/_res/UsrBgs.css index ff330c23d2..8c0ac94d42 100644 --- a/Themes/_res/UsrBgs.css +++ b/Themes/_res/UsrBgs.css @@ -123,6 +123,15 @@ font-weight: 500; line-height: 18px; } +.userPopout-3XzG_A .headerTagNoNickname-ENx6no { + align-items: center; + line-height: unset; +} +.userPopout-3XzG_A .headerTagNoNickname-ENx6no > span:not([class]) { + position: relative; + top: 1px; + font-size: 14px; +} .userPopout-3XzG_A .botTagInvert-18-95s { background: var(--brand-experiment, #5865f2); color: #fff;