Update 0BDFDB.plugin.js
This commit is contained in:
parent
584a478b77
commit
352ec6b8e3
|
@ -2,7 +2,7 @@
|
||||||
* @name BDFDB
|
* @name BDFDB
|
||||||
* @author DevilBro
|
* @author DevilBro
|
||||||
* @authorId 278543574059057154
|
* @authorId 278543574059057154
|
||||||
* @version 2.6.7
|
* @version 2.6.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
|
||||||
|
@ -2379,7 +2379,10 @@ module.exports = (_ => {
|
||||||
};
|
};
|
||||||
|
|
||||||
Internal.isCorrectModule = function (module, type, useCache = false) {
|
Internal.isCorrectModule = function (module, type, useCache = false) {
|
||||||
if (!InternalData.PatchModules || !InternalData.PatchModules[type]) return false;
|
if (!InternalData.PatchModules || !InternalData.PatchModules[type]) {
|
||||||
|
BDFDB.LogUtils.warn(`[${type}] not found in PatchModules InternalData`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
else if (useCache && Cache && Cache.modules && Cache.modules.patch && Cache.modules.patch[type] == module) return true;
|
else if (useCache && Cache && Cache.modules && Cache.modules.patch && Cache.modules.patch[type] == module) return true;
|
||||||
else {
|
else {
|
||||||
let foundModule = null;
|
let foundModule = null;
|
||||||
|
@ -7804,6 +7807,7 @@ module.exports = (_ => {
|
||||||
}
|
}
|
||||||
render() {
|
render() {
|
||||||
let child = (typeof this.props.children == "function" ? this.props.children() : (BDFDB.ArrayUtils.is(this.props.children) ? this.props.children[0] : this.props.children)) || BDFDB.ReactUtils.createElement("div", {});
|
let child = (typeof this.props.children == "function" ? this.props.children() : (BDFDB.ArrayUtils.is(this.props.children) ? this.props.children[0] : this.props.children)) || BDFDB.ReactUtils.createElement("div", {});
|
||||||
|
if (!child || !child.props) return null;
|
||||||
child.props.className = BDFDB.DOMUtils.formatClassName(child.props.className, this.props.className);
|
child.props.className = BDFDB.DOMUtils.formatClassName(child.props.className, this.props.className);
|
||||||
let childProps = Object.assign({}, child.props);
|
let childProps = Object.assign({}, child.props);
|
||||||
let shown = false;
|
let shown = false;
|
||||||
|
@ -8321,15 +8325,19 @@ module.exports = (_ => {
|
||||||
let module = e.methodArguments[0] && (e.methodArguments[0].type || e.methodArguments[0].render || e.methodArguments[0]);
|
let module = e.methodArguments[0] && (e.methodArguments[0].type || e.methodArguments[0].render || e.methodArguments[0]);
|
||||||
if (!module || typeof module != "function") return;
|
if (!module || typeof module != "function") return;
|
||||||
if (PluginStores.modulePatches.after && e.returnValue && e.returnValue.type) for (const type in PluginStores.modulePatches.after) if (Internal.isCorrectModule(module, type, true)) {
|
if (PluginStores.modulePatches.after && e.returnValue && e.returnValue.type) for (const type in PluginStores.modulePatches.after) if (Internal.isCorrectModule(module, type, true)) {
|
||||||
for (let plugin of PluginStores.modulePatches.after[type].flat(10)) if (!BDFDB.PatchUtils.isPatched(plugin, e.returnValue, "type")) {
|
for (let plugin of PluginStores.modulePatches.after[type].flat(10)) {
|
||||||
BDFDB.PatchUtils.patch(plugin, e.returnValue, "type", {after: e2 => Internal.initiatePatch(plugin, type, {
|
let patchModule = e.returnValue, patchFunction = "type";
|
||||||
arguments: e2.methodArguments,
|
if (e.returnValue.type && e.returnValue.type.prototype && typeof e.returnValue.type.prototype.render == "function") {
|
||||||
instance: e2.thisObject,
|
patchModule = e.returnValue.type.prototype, patchFunction = "render";
|
||||||
returnvalue: e2.returnValue,
|
}
|
||||||
component: e.methodArguments[0],
|
if (!BDFDB.PatchUtils.isPatched(plugin, patchModule, patchFunction)) BDFDB.PatchUtils.patch(plugin, patchModule, patchFunction, {after: e2 => Internal.initiatePatch(plugin, type, {
|
||||||
name: type,
|
arguments: e2.methodArguments,
|
||||||
methodname: "type",
|
instance: e2.thisObject,
|
||||||
patchtypes: ["after"]
|
returnvalue: e2.returnValue,
|
||||||
|
component: e.methodArguments[0],
|
||||||
|
name: type,
|
||||||
|
methodname: patchFunction,
|
||||||
|
patchtypes: ["after"]
|
||||||
})});
|
})});
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue