stuff
This commit is contained in:
parent
f5fa486b33
commit
2a08729bef
|
@ -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,6 +87,7 @@ 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"},
|
||||
|
@ -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);
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Reference in New Issue