diff --git a/Plugins/OwnerTag/OwnerTag.plugin.js b/Plugins/OwnerTag/OwnerTag.plugin.js index beb61cd0a8..bfee26b529 100644 --- a/Plugins/OwnerTag/OwnerTag.plugin.js +++ b/Plugins/OwnerTag/OwnerTag.plugin.js @@ -14,12 +14,12 @@ module.exports = (_ => { "info": { "name": "OwnerTag", "author": "DevilBro", - "version": "1.3.6", + "version": "1.3.7", "description": "Add a tag or crown to the server owner (or admins/management)" }, "changeLog": { - "fixed": { - "Compact": "Fixed some issues with compact mode" + "added": { + "Voice Channel List": "Added Option to add Role Tag in the Voice Channel List for Users" } } }; @@ -77,6 +77,7 @@ module.exports = (_ => { after: { MemberListItem: "render", MessageUsername: "default", + VoiceUser: "render", NameTag: "default", UserPopout: "render" } @@ -86,15 +87,16 @@ module.exports = (_ => { settings: { addInChatWindow: {value: true, inner: true, description: "Messages"}, addInMemberList: {value: true, inner: true, description: "Member List"}, + addInVoiceList: {value: true, inner: true, description: "Voice User List"}, addInUserPopout: {value: true, inner: true, description: "User Popouts"}, addInUserProfile: {value: true, inner: true, description: "User Profile Modal"}, - useRoleColor: {value: true, inner: false, description: "Use the Rolecolor instead of the default blue"}, - useBlackFont: {value: false, inner: false, description: "Instead of darkening the Rolecolor on bright colors use black font"}, - useCrown: {value: false, inner: false, description: "Use the Crown Icon instead of the Bot Tag Style"}, - hideNativeCrown: {value: true, inner: false, description: "Hide the native Crown Icon (not the Plugin one)"}, - addForAdmins: {value: false, inner: false, description: "Add an Admin Tag for users with admin permissions"}, - addForManagement: {value: false, inner: false, description: "Add a Management Tag for users with management permissions"}, - ignoreBotAdmins: {value: false, inner: false, description: "Do not add the Admin/Management tag for bots"} + useRoleColor: {value: true, inner: false, description: "Use the Rolecolor instead of the default blue"}, + useBlackFont: {value: false, inner: false, description: "Instead of darkening the Rolecolor on bright colors use black font"}, + useCrown: {value: false, inner: false, description: "Use the Crown Icon instead of the Bot Tag Style"}, + hideNativeCrown: {value: true, inner: false, description: "Hide the native Crown Icon (not the Plugin one)"}, + addForAdmins: {value: false, inner: false, description: "Add an Admin Tag for users with admin permissions"}, + addForManagement: {value: false, inner: false, description: "Add a Management Tag for users with management permissions"}, + ignoreBotAdmins: {value: false, inner: false, description: "Do not add the Admin/Management tag for bots"} }, inputs: { ownTagName: {value: "Owner", description: "Tag Text for Owners"}, @@ -113,14 +115,17 @@ module.exports = (_ => { ${BDFDB.dotCNS.message + BDFDB.dotCN.memberownericon} { top: 2px; } + ${BDFDB.dotCNS.voicecontent + BDFDB.dotCN.memberownericon} { + top: 0px; + } + ${BDFDB.dotCNS.userprofile + BDFDB.dotCN.memberownericon} { + top: 0px; + } ${BDFDB.dotCNS.messagerepliedmessage + BDFDB.dotCN.memberownericon}, ${BDFDB.dotCNS.messagecompact + BDFDB.dotCN.memberownericon} { margin-left: 0; margin-right: 4px; } - ${BDFDB.dotCNS.userprofile + BDFDB.dotCN.memberownericon} { - top: 0px; - } `; } @@ -205,6 +210,7 @@ module.exports = (_ => { let userType = this.getUserType(e.instance.props.user, e.instance.props.channel && e.instance.props.channel.id); if (userType && settings.addInMemberList) { this.injectOwnerTag(BDFDB.ObjectUtils.get(e.returnvalue, "props.decorators.props.children"), e.instance.props.user, userType, 1, { + channelId: e.instance.props.channel && e.instance.props.channel.id, tagClass: BDFDB.disCN.bottagmember }); } @@ -221,6 +227,18 @@ module.exports = (_ => { } } + processVoiceUser (e) { + if (e.instance.props.user && settings.addInVoiceList) { + let userType = this.getUserType(e.instance.props.user, e.instance.props.channel && e.instance.props.channel.id); + if (userType) { + let content = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.voicecontent]]}); + if (content) this.injectOwnerTag(content.props.children, e.instance.props.user, userType, 3, { + channelId: e.instance.props.channel && e.instance.props.channel.id, + }); + } + } + } + processNameTag (e) { if (e.instance.props.user && e.instance.props.className) { let userType = this.getUserType(e.instance.props.user); diff --git a/Plugins/TopRoleEverywhere/TopRoleEverywhere.plugin.js b/Plugins/TopRoleEverywhere/TopRoleEverywhere.plugin.js index 9bbe57c08c..4cf6ae778a 100644 --- a/Plugins/TopRoleEverywhere/TopRoleEverywhere.plugin.js +++ b/Plugins/TopRoleEverywhere/TopRoleEverywhere.plugin.js @@ -18,8 +18,8 @@ module.exports = (_ => { "description": "Add the highest role of a user as a tag" }, "changeLog": { - "fixed": { - "Compact": "Fixed some issues with compact mode" + "added": { + "Voice Channel List": "Added Option to add Role Tag in the Voice Channel List for Users" } } }; @@ -70,6 +70,7 @@ module.exports = (_ => { settings: { showInChat: {value: true, inner: true, description: "Chat Window"}, showInMemberList: {value: true, inner: true, description: "Member List"}, + showInVoiceList: {value: true, inner: true, description: "Voice User List"}, useOtherStyle: {value: false, inner: false, description: "Use BotTag Style instead of the Role Style"}, useBlackFont: {value: false, inner: false, description: "Instead of darkening the Color for BotTag Style on bright Colors use black Font"}, includeColorless: {value: false, inner: false, description: "Include colorless Roles"}, @@ -82,7 +83,8 @@ module.exports = (_ => { this.patchedModules = { after: { MemberListItem: "render", - MessageUsername: "default" + MessageUsername: "default", + VoiceUser: "render" } }; @@ -93,6 +95,8 @@ module.exports = (_ => { overflow: visible; } ${BDFDB.dotCN._toproleseverywheretag} { + display: inline-flex; + flex: 0 1 auto; cursor: pointer; overflow: hidden; text-overflow: ellipsis; @@ -190,6 +194,13 @@ module.exports = (_ => { } } + processVoiceUser (e) { + if (e.instance.props.user && settings.showInVoiceList) { + let content = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.voicecontent]]}); + if (content) this.injectRoleTag(content.props.children, e.instance.props.user, "voice", 3); + } + } + injectRoleTag (children, user, type, insertIndex, config = {}) { if (!BDFDB.ArrayUtils.is(children) || !user) return; let guild = BDFDB.LibraryModules.GuildStore.getGuild(BDFDB.LibraryModules.LastGuildStore.getGuildId());