stuff
This commit is contained in:
parent
92b04fb3f2
commit
214edf7b8a
|
@ -1022,6 +1022,10 @@
|
||||||
WebModulesData.Nonprototype = [
|
WebModulesData.Nonprototype = [
|
||||||
"ChannelTextAreaContainer"
|
"ChannelTextAreaContainer"
|
||||||
];
|
];
|
||||||
|
WebModulesData.LoadedInComponents = {
|
||||||
|
AutocompleteChannelResult: "AutocompleteComponents.Channel",
|
||||||
|
AutocompleteUserResult: "AutocompleteComponents.User"
|
||||||
|
};
|
||||||
WebModulesData.Patchfinder = {
|
WebModulesData.Patchfinder = {
|
||||||
Account: "accountinfo",
|
Account: "accountinfo",
|
||||||
App: "app",
|
App: "app",
|
||||||
|
@ -1048,6 +1052,7 @@
|
||||||
QuickSwitchGuildResult: "quickswitchresult",
|
QuickSwitchGuildResult: "quickswitchresult",
|
||||||
QuickSwitchResult: "quickswitchresult",
|
QuickSwitchResult: "quickswitchresult",
|
||||||
MemberCard: "guildsettingsmembercard",
|
MemberCard: "guildsettingsmembercard",
|
||||||
|
MessagesPopout: "messagespopout",
|
||||||
MutualGuilds: "userprofilebody",
|
MutualGuilds: "userprofilebody",
|
||||||
MutualFriends: "userprofilebody",
|
MutualFriends: "userprofilebody",
|
||||||
NameTag: "nametag",
|
NameTag: "nametag",
|
||||||
|
@ -1255,22 +1260,26 @@
|
||||||
for (let patchtype in plugin.patchedModules) for (let type in plugin.patchedModules[patchtype]) {
|
for (let patchtype in plugin.patchedModules) for (let type in plugin.patchedModules[patchtype]) {
|
||||||
if (WebModulesData.GlobalModules[type] && typeof WebModulesData.GlobalModules[type] == "function") patchInstance(WebModulesData.GlobalModules[type], type, patchtype);
|
if (WebModulesData.GlobalModules[type] && typeof WebModulesData.GlobalModules[type] == "function") patchInstance(WebModulesData.GlobalModules[type], type, patchtype);
|
||||||
else {
|
else {
|
||||||
let mapped = WebModulesData.Patchmap[type];
|
let component = WebModulesData.LoadedInComponents[type] && BDFDB.ReactUtils.getValue(LibraryComponents, WebModulesData.LoadedInComponents[type]);
|
||||||
let classname = WebModulesData.Patchfinder[type.split(" _ _ ")[1] || type];
|
if (component) patchInstance(component, type, patchtype);
|
||||||
let mappedtype = mapped ? mapped + " _ _ " + type : type;
|
else {
|
||||||
if (mapped) {
|
let mapped = WebModulesData.Patchmap[type];
|
||||||
plugin.patchedModules[patchtype][mappedtype] = plugin.patchedModules[patchtype][type];
|
let classname = WebModulesData.Patchfinder[type.split(" _ _ ")[1] || type];
|
||||||
delete plugin.patchedModules[patchtype][type];
|
let mappedtype = mapped ? mapped + " _ _ " + type : type;
|
||||||
|
if (mapped) {
|
||||||
|
plugin.patchedModules[patchtype][mappedtype] = plugin.patchedModules[patchtype][type];
|
||||||
|
delete plugin.patchedModules[patchtype][type];
|
||||||
|
}
|
||||||
|
if (!classname) patchInstance(BDFDB.ModuleUtils.findByName(mappedtype.split(" _ _ ")[0]), mappedtype, patchtype);
|
||||||
|
else if (DiscordClasses[classname]) checkForInstance(classname, mappedtype, patchtype, WebModulesData.Forceobserve.includes(type.split(" _ _ ")[1] || type));
|
||||||
}
|
}
|
||||||
if (!classname) patchInstance(BDFDB.ModuleUtils.findByName(mappedtype.split(" _ _ ")[0]), mappedtype, patchtype);
|
|
||||||
else if (DiscordClasses[classname]) checkForInstance(classname, mappedtype, patchtype, WebModulesData.Forceobserve.includes(type.split(" _ _ ")[1] || type));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function patchInstance(instance, type, patchtype) {
|
function patchInstance(instance, type, patchtype) {
|
||||||
if (instance) {
|
if (instance) {
|
||||||
let name = type.split(" _ _ ")[0];
|
let name = type.split(" _ _ ")[0];
|
||||||
instance = instance._reactInternalFiber && instance._reactInternalFiber.type ? instance._reactInternalFiber.type : instance;
|
instance = instance._reactInternalFiber && instance._reactInternalFiber.type ? instance._reactInternalFiber.type : instance;
|
||||||
instance = instance.displayName == name || instance.name == name ? instance : (BDFDB.ReactUtils.findConstructor(instance, name) || BDFDB.ReactUtils.findConstructor(instance, name, {up:true}));
|
instance = instance.displayName == name || instance.name == name || WebModulesData.LoadedInComponents[type] ? instance : (BDFDB.ReactUtils.findConstructor(instance, name) || BDFDB.ReactUtils.findConstructor(instance, name, {up:true}));
|
||||||
if (instance) {
|
if (instance) {
|
||||||
instance = instance._reactInternalFiber && instance._reactInternalFiber.type ? instance._reactInternalFiber.type : instance;
|
instance = instance._reactInternalFiber && instance._reactInternalFiber.type ? instance._reactInternalFiber.type : instance;
|
||||||
let patchfunctions = {};
|
let patchfunctions = {};
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue