This commit is contained in:
Mirco Wittrien 2021-09-24 16:58:46 +02:00
parent 72068a1b13
commit 39cd5c4615
2 changed files with 29 additions and 33 deletions

View File

@ -2,7 +2,7 @@
* @name BDFDB
* @author DevilBro
* @authorId 278543574059057154
* @version 1.8.7
* @version 1.8.8
* @description Required Library for DevilBro's Plugins
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -19,7 +19,7 @@ module.exports = (_ => {
"info": {
"name": "BDFDB",
"author": "DevilBro",
"version": "1.8.7",
"version": "1.8.8",
"description": "Required Library for DevilBro's Plugins"
},
"rawUrl": `https://mwittrien.github.io/BetterDiscordAddons/Library/0BDFDB.plugin.js`,
@ -2172,30 +2172,31 @@ module.exports = (_ => {
instance = instance[BDFDB.ReactUtils.instanceKey] && instance[BDFDB.ReactUtils.instanceKey].type ? instance[BDFDB.ReactUtils.instanceKey].type : instance;
let toBePatched = config.nonPrototype || !instance.prototype ? instance : instance.prototype;
toBePatched = toBePatched && toBePatched.type && typeof toBePatched.type.render == "function" ? toBePatched.type : toBePatched;
for (let pluginData of pluginDataObjs) for (let patchType in pluginData.patchTypes) {
let patchMethods = {};
patchMethods[patchType] = !config.subComponent ? (e => InternalBDFDB.initiateProcess(pluginData.plugin, type, {
instance: e.thisObject,
returnvalue: e.returnValue,
component: toBePatched,
methodname: e.originalMethodName,
patchtypes: [patchType]
})) : (e => {
if (typeof e.returnValue.type != "function") return;
const originalType = e.returnValue.type;
e.returnValue.type = BDFDB.TimeUtils.suppress((...args) => {
const returnValue = originalType(...args);
InternalBDFDB.initiateProcess(pluginData.plugin, type, {
instance: {props: args[0]},
returnvalue: returnValue,
if (config.subComponent) {
for (let pluginData of pluginDataObjs) BDFDB.PatchUtils.patch(pluginData.plugin, toBePatched, "default", {after: e => {
for (let patchType in pluginData.patchTypes) BDFDB.PatchUtils.patch(pluginData.plugin, e.returnValue, "type", {
[patchType]: e2 => InternalBDFDB.initiateProcess(pluginData.plugin, type, {
instance: e2.thisObject,
returnvalue: e2.returnValue,
component: toBePatched,
methodname: e.originalMethodName,
patchtypes: [patchType]
});
return returnValue;
});
});
BDFDB.PatchUtils.patch(pluginData.plugin, toBePatched, pluginData.patchTypes[patchType], patchMethods, {name});
})
}, {name, noCache: true});
}}, {name});
}
else {
for (let pluginData of pluginDataObjs) for (let patchType in pluginData.patchTypes) {
BDFDB.PatchUtils.patch(pluginData.plugin, toBePatched, pluginData.patchTypes[patchType], {
[patchType]: e => InternalBDFDB.initiateProcess(pluginData.plugin, type, {
instance: e.thisObject,
returnvalue: e.returnValue,
component: toBePatched,
methodname: e.originalMethodName,
patchtypes: [patchType]
})
}, {name});
}
}
}
}

View File

@ -2,7 +2,7 @@
* @name ServerDetails
* @author DevilBro
* @authorId 278543574059057154
* @version 1.0.7
* @version 1.0.8
* @description Shows Server Details in the Server List Tooltip
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -17,13 +17,8 @@ module.exports = (_ => {
"info": {
"name": "ServerDetails",
"author": "DevilBro",
"version": "1.0.7",
"version": "1.0.8",
"description": "Shows Server Details in the Server List Tooltip"
},
"changeLog": {
"added": {
"Shift": "Added Shift Key Option"
}
}
};
@ -198,7 +193,7 @@ module.exports = (_ => {
this.patchedModules = {
after: {
Guild: "render"
Guild: "default"
}
};
@ -337,9 +332,9 @@ module.exports = (_ => {
}
`);
BDFDB.PatchUtils.forceAllUpdates(this);
BDFDB.GuildUtils.rerenderAll();
}
processGuild (e) {
if (BDFDB.GuildUtils.is(e.instance.props.guild)) {
let tooltipContainer;