This commit is contained in:
Mirco Wittrien 2022-10-11 13:15:58 +02:00
parent faa38237bd
commit 2c0656fb20
2 changed files with 12 additions and 9 deletions

View File

@ -2,7 +2,7 @@
* @name BDFDB
* @author DevilBro
* @authorId 278543574059057154
* @version 2.6.9
* @version 2.7.0
* @description Required Library for DevilBro's Plugins
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -3891,7 +3891,7 @@ module.exports = (_ => {
else {
if (props.render || props.persisting || BDFDB.ObjectUtils.is(props.popoutProps) || (typeof props.color == "string" && !DiscordClasses[`menu${props.color.toLowerCase()}`])) component = Internal.MenuItem;
if (BDFDB.ObjectUtils.toArray(RealMenuItems).some(c => c == component)) return BDFDB.ReactUtils.createElement(component, props);
else return BDFDB.ReactUtils.createElement(RealMenuItems.MenuItem, {
else return BDFDB.ReactUtils.createElement(LibraryComponents.MenuItems.MenuItem, {
id: props.id,
disabled: props.disabled,
customItem: true,
@ -3917,7 +3917,7 @@ module.exports = (_ => {
if (contextMenu) {
let children = BDFDB.ArrayUtils.is(contextMenu.props.children) ? contextMenu.props.children : [contextMenu.props.children];
for (let i in children) {
if (children[i] && children[i].type == RealMenuItems.MenuGroup) {
if (children[i] && children[i].type == LibraryComponents.MenuItems.MenuGroup) {
if (BDFDB.ArrayUtils.is(children[i].props.children)) {
for (let j in children[i].props.children) if (check(children[i].props.children[j])) {
if (config.group) return [children, parseInt(i)];
@ -3945,6 +3945,7 @@ module.exports = (_ => {
return [children, -1];
}
return [null, -1];
function check (child) {
if (!child) return false;
let props = child.stateNode ? child.stateNode.props : child.props;
@ -6197,12 +6198,12 @@ module.exports = (_ => {
if (!guild) return BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCN.guildsummaryemptyguild
});
let icon = BDFDB.ReactUtils.createElement(Internal.LibraryComponents.GuildComponents.Icon, {
let icon = BDFDB.ReactUtils.createElement(Internal.LibraryComponents.GuildIconComponents.Icon, {
className: BDFDB.disCN.guildsummaryicon,
guild: guild,
showTooltip: this.props.showTooltip,
tooltipPosition: "top",
size: Internal.LibraryComponents.GuildComponents.Icon.Sizes.SMALLER
size: Internal.LibraryComponents.GuildIconComponents.Icon.Sizes.SMALLER
});
return this.props.switchOnClick ? BDFDB.ReactUtils.createElement(Internal.LibraryComponents.Clickable, {
className: BDFDB.disCN.guildsummaryclickableicon,
@ -6942,9 +6943,9 @@ module.exports = (_ => {
text: guild.name,
children: BDFDB.ReactUtils.createElement("div", {
className: BDFDB.DOMUtils.formatClassName(this.props.guildClassName, BDFDB.disCN.settingsguild, this.props.disabled.includes(guild.id) && BDFDB.disCN.settingsguilddisabled),
children: BDFDB.ReactUtils.createElement(Internal.LibraryComponents.GuildComponents.Icon, {
children: BDFDB.ReactUtils.createElement(Internal.LibraryComponents.GuildIconComponents.Icon, {
guild: guild,
size: this.props.size || Internal.LibraryComponents.GuildComponents.Icon.Sizes.MEDIUM
size: this.props.size || Internal.LibraryComponents.GuildIconComponents.Icon.Sizes.MEDIUM
}),
onClick: e => {
let isDisabled = this.props.disabled.includes(guild.id);
@ -8290,6 +8291,8 @@ module.exports = (_ => {
let module = e.methodArguments[0] && (e.methodArguments[0].type || e.methodArguments[0].render || e.methodArguments[0]);
if (!module || typeof module != "function") return;
if (PluginStores.modulePatches.before) for (const type in PluginStores.modulePatches.before) if (Internal.isCorrectModule(module, type, true)) {
let children = [...e.methodArguments].slice(2);
if (children.length && (!e.methodArguments[1].children || !e.methodArguments[1].children.length)) e.methodArguments[1].children = children;
for (let plugin of PluginStores.modulePatches.before[type].flat(10)) Internal.initiatePatch(plugin, type, {
arguments: e.methodArguments,
instance: {props: e.methodArguments[1]},

View File

@ -200,10 +200,10 @@ module.exports = (_ => {
e.returnvalue = this.removeMask(e.returnvalue);
this.addElementName(e.returnvalue, e.instance.props.guild.name, {
badges: [
this.settings.general.showGuildIcon && BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.GuildComponents.Icon, {
this.settings.general.showGuildIcon && BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.GuildIconComponents.Icon, {
animate: e.instance.props.animatable && e.instance.state && e.instance.state.hovered,
guild: e.instance.props.guild,
size: BDFDB.LibraryComponents.GuildComponents.Icon.Sizes.SMALLER
size: BDFDB.LibraryComponents.GuildIconComponents.Icon.Sizes.SMALLER
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.GuildComponents.Badge, {
size: this.settings.amounts.serverElementHeight * 0.5,