stuf
This commit is contained in:
parent
217a3cb192
commit
9eb8aeb457
|
@ -8139,7 +8139,7 @@ module.exports = (_ => {
|
||||||
avatarWrapper.props.children = BDFDB.TimeUtils.suppress((...args) => {
|
avatarWrapper.props.children = BDFDB.TimeUtils.suppress((...args) => {
|
||||||
let renderedChildren = renderChildren(...args);
|
let renderedChildren = renderChildren(...args);
|
||||||
return InternalBDFDB._processAvatarRender(e.instance.props.message.author, renderedChildren, BDFDB.disCN.messageavatar) || renderedChildren;
|
return InternalBDFDB._processAvatarRender(e.instance.props.message.author, renderedChildren, BDFDB.disCN.messageavatar) || renderedChildren;
|
||||||
});
|
}, "Error in Avatar Render of MessageHeader!");
|
||||||
}
|
}
|
||||||
else if (avatarWrapper && avatarWrapper.type == "img") e.returnvalue.props.children[0] = InternalBDFDB._processAvatarRender(e.instance.props.message.author, avatarWrapper) || avatarWrapper;
|
else if (avatarWrapper && avatarWrapper.type == "img") e.returnvalue.props.children[0] = InternalBDFDB._processAvatarRender(e.instance.props.message.author, avatarWrapper) || avatarWrapper;
|
||||||
}
|
}
|
||||||
|
@ -8234,56 +8234,35 @@ module.exports = (_ => {
|
||||||
InternalBDFDB.patchContextMenu = function (plugin, type, module) {
|
InternalBDFDB.patchContextMenu = function (plugin, type, module) {
|
||||||
if (!module || !module.default) return;
|
if (!module || !module.default) return;
|
||||||
plugin = plugin == BDFDB && InternalBDFDB || plugin;
|
plugin = plugin == BDFDB && InternalBDFDB || plugin;
|
||||||
if (!module.default.displayName || module.default.displayName.indexOf("ContextMenu") == -1) {
|
const call = (props, returnValue, name) => plugin[`on${type}`]({
|
||||||
BDFDB.PatchUtils.patch(plugin, module, "default", {after: e => {
|
instance: {props: props},
|
||||||
if (typeof plugin[`on${type}`] != "function") return;
|
returnvalue: returnValue,
|
||||||
else if (e.returnValue && e.returnValue.props.children && e.returnValue.props.children.type && e.returnValue.props.children.type.displayName) {
|
component: module,
|
||||||
|
methodname: "default",
|
||||||
|
type: name
|
||||||
|
});
|
||||||
|
BDFDB.PatchUtils.patch(plugin, module, "default", {after: e => {
|
||||||
|
if (typeof plugin[`on${type}`] != "function") return;
|
||||||
|
else if (e.returnValue && e.returnValue.props.children) {
|
||||||
|
if (e.returnValue.props.children.type && e.returnValue.props.children.type.displayName) {
|
||||||
let name = e.returnValue.props.children.type.displayName;
|
let name = e.returnValue.props.children.type.displayName;
|
||||||
let originalReturn = e.returnValue.props.children.type(e.returnValue.props.children.props);
|
let originalReturn = e.returnValue.props.children.type(e.returnValue.props.children.props);
|
||||||
let newType = props => {
|
let newType = props => {
|
||||||
const returnValue = BDFDB.ReactUtils.createElement(originalReturn.type, originalReturn.props);
|
const returnValue = BDFDB.ReactUtils.createElement(originalReturn.type, originalReturn.props);
|
||||||
if (returnValue.props.children) plugin[`on${type}`]({
|
if (returnValue.props.children) call(props, returnValue, name);
|
||||||
instance: {props: props},
|
|
||||||
returnvalue: returnValue,
|
|
||||||
component: module,
|
|
||||||
methodname: "default",
|
|
||||||
type: name
|
|
||||||
});
|
|
||||||
else BDFDB.PatchUtils.patch(plugin, returnValue, "type", {after: e2 => {
|
else BDFDB.PatchUtils.patch(plugin, returnValue, "type", {after: e2 => {
|
||||||
if (e2.returnValue && typeof plugin[`on${type}`] == "function") plugin[`on${type}`]({
|
if (e2.returnValue && typeof plugin[`on${type}`] == "function") call(e2.methodArguments[0], e2.returnValue, name);
|
||||||
instance: {props: e2.methodArguments[0]},
|
}}, {noCache: true});
|
||||||
returnvalue: e2.returnValue,
|
|
||||||
component: module,
|
|
||||||
methodname: "default",
|
|
||||||
type: name
|
|
||||||
});
|
|
||||||
}});
|
|
||||||
return returnValue;
|
return returnValue;
|
||||||
};
|
};
|
||||||
newType.displayName = name;
|
newType.displayName = name;
|
||||||
e.returnValue.props.children = BDFDB.ReactUtils.createElement(newType, e.returnValue.props.children.props);
|
e.returnValue.props.children = BDFDB.ReactUtils.createElement(newType, e.returnValue.props.children.props);
|
||||||
}
|
}
|
||||||
}}, {name: type});
|
}
|
||||||
}
|
|
||||||
else BDFDB.PatchUtils.patch(plugin, module, "default", {after: e => {
|
|
||||||
if (typeof plugin[`on${type}`] != "function") return;
|
|
||||||
else if (e.returnValue.props.children) plugin[`on${type}`]({
|
|
||||||
instance: {props: e.methodArguments[0]},
|
|
||||||
returnvalue: e.returnValue,
|
|
||||||
component: module,
|
|
||||||
methodname: "default",
|
|
||||||
type: module.default.displayName
|
|
||||||
});
|
|
||||||
else BDFDB.PatchUtils.patch(plugin, e.returnValue, "type", {after: e2 => {
|
else BDFDB.PatchUtils.patch(plugin, e.returnValue, "type", {after: e2 => {
|
||||||
if (e2.returnValue && typeof plugin[`on${type}`] == "function") plugin[`on${type}`]({
|
if (e2.returnValue && typeof plugin[`on${type}`] == "function") call(e2.methodArguments[0], e2.returnValue, module.default.displayName);
|
||||||
instance: {props: e2.methodArguments[0]},
|
}}, {noCache: true});
|
||||||
returnvalue: e2.returnValue,
|
}}, {name: type});
|
||||||
component: module,
|
|
||||||
methodname: "default",
|
|
||||||
type: module.default.displayName
|
|
||||||
});
|
|
||||||
}});
|
|
||||||
}});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
BDFDB.ReactUtils.instanceKey = Object.keys(document.querySelector(BDFDB.dotCN.app) || {}).some(n => n.startsWith("__reactInternalInstance")) ? "_reactInternalFiber" : "_reactInternals";
|
BDFDB.ReactUtils.instanceKey = Object.keys(document.querySelector(BDFDB.dotCN.app) || {}).some(n => n.startsWith("__reactInternalInstance")) ? "_reactInternalFiber" : "_reactInternals";
|
||||||
|
@ -8408,7 +8387,7 @@ module.exports = (_ => {
|
||||||
});
|
});
|
||||||
}}, {noCache: true});
|
}}, {noCache: true});
|
||||||
return renderedPopout;
|
return renderedPopout;
|
||||||
});
|
}, "Error in Popout Render of MessageOptionToolbar!");
|
||||||
}
|
}
|
||||||
}}, {once: true});
|
}}, {once: true});
|
||||||
}});
|
}});
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* @name EditUsers
|
* @name EditUsers
|
||||||
* @author DevilBro
|
* @author DevilBro
|
||||||
* @authorId 278543574059057154
|
* @authorId 278543574059057154
|
||||||
* @version 4.4.7
|
* @version 4.4.8
|
||||||
* @description Allows you to locally edit Users
|
* @description Allows you to locally edit Users
|
||||||
* @invite Jx3TjNS
|
* @invite Jx3TjNS
|
||||||
* @donate https://www.paypal.me/MircoWittrien
|
* @donate https://www.paypal.me/MircoWittrien
|
||||||
|
@ -17,8 +17,13 @@ module.exports = (_ => {
|
||||||
"info": {
|
"info": {
|
||||||
"name": "EditUsers",
|
"name": "EditUsers",
|
||||||
"author": "DevilBro",
|
"author": "DevilBro",
|
||||||
"version": "4.4.7",
|
"version": "4.4.8",
|
||||||
"description": "Allows you to locally edit Users"
|
"description": "Allows you to locally edit Users"
|
||||||
|
},
|
||||||
|
"changeLog": {
|
||||||
|
"improved": {
|
||||||
|
"Colored Text": "If you are using BetterRoleColors to color messages as the same color as the role and set a custom color with EditUsers, the message color will use the custom color again, like it used to with Colored Text in BD"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -695,7 +700,7 @@ module.exports = (_ => {
|
||||||
if (content && content.type && content.type.type && content.props.message && this.shouldChangeInChat(content.props.message.channel_id)) {
|
if (content && content.type && content.type.type && content.props.message && this.shouldChangeInChat(content.props.message.channel_id)) {
|
||||||
let data = changedUsers[content.props.message.author.id];
|
let data = changedUsers[content.props.message.author.id];
|
||||||
if (data) {
|
if (data) {
|
||||||
let messageColor = data.color5 || (BDFDB.BDUtils.getSettings(BDFDB.BDUtils.settingsIds.coloredText) && (data.color1 && data.useRoleColor && (BDFDB.LibraryModules.MemberStore.getMember((BDFDB.LibraryModules.ChannelStore.getChannel(content.props.message.channel_id) || {}).guild_id, content.props.message.author.id) || {}).colorString || data.color1));
|
let messageColor = data.color5 || (BDFDB.ObjectUtils.get(BDFDB.BDUtils.getPlugin("BetterRoleColors", true), "settings.modules.chat") && (data.color1 && data.useRoleColor && (BDFDB.LibraryModules.MemberStore.getMember((BDFDB.LibraryModules.ChannelStore.getChannel(content.props.message.channel_id) || {}).guild_id, content.props.message.author.id) || {}).colorString || data.color1));
|
||||||
if (messageColor) {
|
if (messageColor) {
|
||||||
let message = new BDFDB.DiscordObjects.Message(Object.assign({}, content.props.message, {author: this.getUserData(content.props.message.author.id, true, false, content.props.message.author)}));
|
let message = new BDFDB.DiscordObjects.Message(Object.assign({}, content.props.message, {author: this.getUserData(content.props.message.author.id, true, false, content.props.message.author)}));
|
||||||
message.colorString = BDFDB.ColorUtils.convert(BDFDB.ObjectUtils.is(messageColor) ? messageColor[0] : messageColor, "HEX");
|
message.colorString = BDFDB.ColorUtils.convert(BDFDB.ObjectUtils.is(messageColor) ? messageColor[0] : messageColor, "HEX");
|
||||||
|
@ -776,7 +781,7 @@ module.exports = (_ => {
|
||||||
}
|
}
|
||||||
else if (e.instance.props.message.state != BDFDB.DiscordConstants.MessageStates.SEND_FAILED) {
|
else if (e.instance.props.message.state != BDFDB.DiscordConstants.MessageStates.SEND_FAILED) {
|
||||||
let data = changedUsers[e.instance.props.message.author.id];
|
let data = changedUsers[e.instance.props.message.author.id];
|
||||||
let messageColor = data && (data.color5 || (BDFDB.BDUtils.getSettings(BDFDB.BDUtils.settingsIds.coloredText) && (data.color1 && data.useRoleColor && (BDFDB.LibraryModules.MemberStore.getMember((BDFDB.LibraryModules.ChannelStore.getChannel(e.instance.props.message.channel_id) || {}).guild_id, e.instance.props.message.author.id) || {}).colorString || data.color1)));
|
let messageColor = data && (data.color5 || (BDFDB.ObjectUtils.get(BDFDB.BDUtils.getPlugin("BetterRoleColors", true), "settings.modules.chat") && (data.color1 && data.useRoleColor && (BDFDB.LibraryModules.MemberStore.getMember((BDFDB.LibraryModules.ChannelStore.getChannel(e.instance.props.message.channel_id) || {}).guild_id, e.instance.props.message.author.id) || {}).colorString || data.color1)));
|
||||||
if (messageColor) {
|
if (messageColor) {
|
||||||
if (BDFDB.ObjectUtils.is(messageColor)) e.returnvalue.props.children = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TextGradientElement, {
|
if (BDFDB.ObjectUtils.is(messageColor)) e.returnvalue.props.children = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TextGradientElement, {
|
||||||
gradient: BDFDB.ColorUtils.createGradient(messageColor),
|
gradient: BDFDB.ColorUtils.createGradient(messageColor),
|
||||||
|
|
Loading…
Reference in New Issue