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 * @name BDFDB
* @author DevilBro * @author DevilBro
* @authorId 278543574059057154 * @authorId 278543574059057154
* @version 1.8.7 * @version 1.8.8
* @description Required Library for DevilBro's Plugins * @description Required Library for DevilBro's Plugins
* @invite Jx3TjNS * @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien * @donate https://www.paypal.me/MircoWittrien
@ -19,7 +19,7 @@ module.exports = (_ => {
"info": { "info": {
"name": "BDFDB", "name": "BDFDB",
"author": "DevilBro", "author": "DevilBro",
"version": "1.8.7", "version": "1.8.8",
"description": "Required Library for DevilBro's Plugins" "description": "Required Library for DevilBro's Plugins"
}, },
"rawUrl": `https://mwittrien.github.io/BetterDiscordAddons/Library/0BDFDB.plugin.js`, "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; 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; let toBePatched = config.nonPrototype || !instance.prototype ? instance : instance.prototype;
toBePatched = toBePatched && toBePatched.type && typeof toBePatched.type.render == "function" ? toBePatched.type : toBePatched; toBePatched = toBePatched && toBePatched.type && typeof toBePatched.type.render == "function" ? toBePatched.type : toBePatched;
for (let pluginData of pluginDataObjs) for (let patchType in pluginData.patchTypes) { if (config.subComponent) {
let patchMethods = {}; for (let pluginData of pluginDataObjs) BDFDB.PatchUtils.patch(pluginData.plugin, toBePatched, "default", {after: e => {
patchMethods[patchType] = !config.subComponent ? (e => InternalBDFDB.initiateProcess(pluginData.plugin, type, { for (let patchType in pluginData.patchTypes) BDFDB.PatchUtils.patch(pluginData.plugin, e.returnValue, "type", {
instance: e.thisObject, [patchType]: e2 => InternalBDFDB.initiateProcess(pluginData.plugin, type, {
returnvalue: e.returnValue, instance: e2.thisObject,
component: toBePatched, returnvalue: e2.returnValue,
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,
component: toBePatched, component: toBePatched,
methodname: e.originalMethodName, methodname: e.originalMethodName,
patchtypes: [patchType] patchtypes: [patchType]
}); })
return returnValue; }, {name, noCache: true});
}); }}, {name});
}); }
BDFDB.PatchUtils.patch(pluginData.plugin, toBePatched, pluginData.patchTypes[patchType], patchMethods, {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 * @name ServerDetails
* @author DevilBro * @author DevilBro
* @authorId 278543574059057154 * @authorId 278543574059057154
* @version 1.0.7 * @version 1.0.8
* @description Shows Server Details in the Server List Tooltip * @description Shows Server Details in the Server List Tooltip
* @invite Jx3TjNS * @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien * @donate https://www.paypal.me/MircoWittrien
@ -17,13 +17,8 @@ module.exports = (_ => {
"info": { "info": {
"name": "ServerDetails", "name": "ServerDetails",
"author": "DevilBro", "author": "DevilBro",
"version": "1.0.7", "version": "1.0.8",
"description": "Shows Server Details in the Server List Tooltip" "description": "Shows Server Details in the Server List Tooltip"
},
"changeLog": {
"added": {
"Shift": "Added Shift Key Option"
}
} }
}; };
@ -198,7 +193,7 @@ module.exports = (_ => {
this.patchedModules = { this.patchedModules = {
after: { after: {
Guild: "render" Guild: "default"
} }
}; };
@ -337,7 +332,7 @@ module.exports = (_ => {
} }
`); `);
BDFDB.PatchUtils.forceAllUpdates(this); BDFDB.GuildUtils.rerenderAll();
} }
processGuild (e) { processGuild (e) {