From 086327956f53ef050e3885d62d792b7ac8efb010 Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Wed, 31 Aug 2022 12:54:06 +0200 Subject: [PATCH] Update StaffTag.plugin.js --- Plugins/StaffTag/StaffTag.plugin.js | 31 ++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/Plugins/StaffTag/StaffTag.plugin.js b/Plugins/StaffTag/StaffTag.plugin.js index 4f822a39de..d86a74b057 100644 --- a/Plugins/StaffTag/StaffTag.plugin.js +++ b/Plugins/StaffTag/StaffTag.plugin.js @@ -2,7 +2,7 @@ * @name StaffTag * @author DevilBro * @authorId 278543574059057154 - * @version 1.5.4 + * @version 1.5.5 * @description Adds a Crown/Tag to Server Owners (or Admins/Management) * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -17,13 +17,8 @@ module.exports = (_ => { "info": { "name": "StaffTag", "author": "DevilBro", - "version": "1.5.4", + "version": "1.5.5", "description": "Adds a Crown/Tag to Server Owners (or Admins/Management)" - }, - "changeLog": { - "improved": { - "Custom Title Option": "Using the crown icons and changing the custom titles, will now also change the title in the tooltip text" - } } }; @@ -100,6 +95,7 @@ module.exports = (_ => { MessageUsername: "default", VoiceUser: "render", NameTag: "default", + UsernameSection: "default", UserPopoutInfo: "UserPopoutInfo" } }; @@ -304,10 +300,15 @@ module.exports = (_ => { inject = this.settings.tagPlaces.userPopout; tagClass = BDFDB.disCNS.userpopoutheaderbottag + BDFDB.disCN.bottagnametag; } + else if (e.instance.props.className.indexOf(BDFDB.disCN.userpopoutusernametagnonickname) > -1) { + inject = this.settings.tagPlaces.userPopout; + tagClass = BDFDB.disCNS.userpopoutusernamebottag + BDFDB.disCN.bottagnametag; + } else if (e.instance.props.className.indexOf(BDFDB.disCN.userprofilenametag) > -1) { inject = this.settings.tagPlaces.userProfile; tagClass = BDFDB.disCNS.userprofilebottag + BDFDB.disCN.bottagnametag; } + console.log(e); if (inject) this.injectStaffTag(e.returnvalue.props.children, e.instance.props.user, userType, 2, { tagClass: tagClass, useRem: e.instance.props.useRemSizes, @@ -317,6 +318,22 @@ module.exports = (_ => { } } + processUsernameSection (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.userpopoutusernamenickname]]}); + if (index > -1) { + 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, { + tagClass: BDFDB.disCNS.userpopoutheaderbottag + BDFDB.disCN.bottagnametag, + inverted: typeof e.instance.getMode == "function" && e.instance.getMode() !== "Normal" + }); + } + } + } + } + processUserPopoutInfo (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);