This commit is contained in:
Mirco Wittrien 2022-12-10 11:15:13 +01:00
parent 84d45cc70a
commit 618c8bbc8f
4 changed files with 54 additions and 38 deletions

View File

@ -1450,7 +1450,7 @@
"GuildSettingsEmoji": {"props": ["emojiRow", "emojiAliasPlaceholder"]},
"GuildSettingsInvite": {"props": ["countdownColumn", "inviteSettingsInviteRow"]},
"GuildSettingsMember": {"props": ["member", "membersFilterPopout"]},
"GuildsInbox": {"props": ["listItemWrapper", "listItemTooltip"]},
"GuildsListItem": {"props": ["listItemWrapper", "listItemTooltip"]},
"GuildsInboxIcon": {"props": ["iconButton", "selected"]},
"GuildsItems": {"props": ["circleIcon", "guildsError"]},
"GuildsWrapper": {"props": ["scroller", "unreadMentionsBar", "wrapper"]},
@ -2407,13 +2407,13 @@
"guildiconchildwrapper": ["GuildIcon", "childWrapper"],
"guildiconselected": ["GuildIcon", "selected"],
"guildiconwrapper": ["GuildIcon", "wrapper"],
"guildinbox": ["GuildsInbox", "listItemWrapper"],
"guildinboxicon": ["GuildsInboxIcon", "iconButton"],
"guildinboxiconmask": ["GuildsInboxIcon", "iconMask"],
"guildinboxiconselected": ["GuildsInboxIcon", "selected"],
"guildinboxtooltip": ["GuildsInbox", "listItemTooltip"],
"guildinner": ["Guild", "wrapper"],
"guildinnerwrapper": ["GuildsItems", "listItemWrapper"],
"guildlistitem": ["GuildsListItem", "listItemWrapper"],
"guildlistitemtooltip": ["GuildsListItem", "listItemTooltip"],
"guildlowerbadge": ["Guild", "lowerBadge"],
"guildlowerleftbadge": ["BDFDB", "guildLowerLeftBadge"],
"guildouter": ["GuildItem", "listItem"],

View File

@ -2,7 +2,7 @@
* @name CompleteTimestamps
* @author DevilBro
* @authorId 278543574059057154
* @version 1.6.2
* @version 1.6.3
* @description Replaces Timestamps with your own custom Timestamps
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -167,7 +167,7 @@ module.exports = (_ => {
}
processMessageTimestamp (e) {
let tooltipWrapper = BDFDB.ReactUtils.findChild(e.returnvalue, {name: "Tooltip"});
let tooltipWrapper = BDFDB.ReactUtils.findChild(e.returnvalue, {name: "TooltipContainer"});
if (!tooltipWrapper) return;
let childClassName = BDFDB.ObjectUtils.get(e, "instance.props.children.props.className");
if (childClassName && childClassName.indexOf(BDFDB.disCN.messageedited) > -1) {

View File

@ -2,7 +2,7 @@
* @name ServerFolders
* @author DevilBro
* @authorId 278543574059057154
* @version 7.0.9
* @version 7.1.0
* @description Changes Discord's Folders, Servers open in a new Container, also adds extra Features to more easily organize, customize and manage your Folders
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -120,10 +120,13 @@ module.exports = (_ => {
className: BDFDB.disCN.guildfoldericonwrapper,
style: {background: `url(${folderIcon}) center/cover no-repeat`}
}) : BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCN.guildfoldericonwrapperexpanded,
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
name: BDFDB.LibraryComponents.SvgIcon.Names.FOLDER,
color: BDFDB.ColorUtils.convert(folder.folderColor, "RGB") || "var(--bdfdb-blurple)"
className: BDFDB.disCN.guildfoldericonwrapper,
children: BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCN.guildfoldericonwrapperexpanded,
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
name: BDFDB.LibraryComponents.SvgIcon.Names.FOLDER,
style: {color: BDFDB.ColorUtils.convert(folder.folderColor || BDFDB.DiscordConstants.Colors.BRAND, "RGB")}
})
})
});
}
@ -460,14 +463,14 @@ module.exports = (_ => {
before: [
"FolderItem",
"GuildItemWrapper",
"GuildsBar"
"GuildsBar",
"TooltipContainer"
],
after: [
"FolderHeader",
"FolderSettingsModal",
"GuildItem",
"GuildsBar",
"ListItemTooltip"
"GuildsBar"
],
componentDidMount: [
"FolderSettingsModal"
@ -767,37 +770,50 @@ module.exports = (_ => {
let data = this.getFolderConfig(e.instance.props.folderNode.id);
if (e.instance.props.expanded || data.useCloseIcon) {
let folderIcons = this.loadAllIcons(), iconType = e.instance.props.expanded ? "openicon" : "closedicon";
let icon = folderIcons[data.iconID] ? (!folderIcons[data.iconID].customID ? this.createBase64SVG(folderIcons[data.iconID][iconType], data.color1, data.color2) : folderIcons[data.iconID][iconType]) : null;
if (icon) {
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "FolderIcon"});
if (index > -1) children[index] = BDFDB.ReactUtils.createElement("div", {
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "FolderIcon"});
if (index > -1) {
if (parseInt(data.iconID) == -1 && data.useCloseIcon && !e.instance.props.expanded) children[index] = BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCN.guildfoldericonwrapper,
children: BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCN.guildfoldericonwrapperexpanded,
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
name: BDFDB.LibraryComponents.SvgIcon.Names.FOLDER,
style: {color: BDFDB.ColorUtils.convert(data.folderColor || BDFDB.DiscordConstants.Colors.BRAND, "RGB")}
})
})
});
else if (e.instance.props.expanded || data.useCloseIcon) {
let folderIcons = this.loadAllIcons(), iconType = e.instance.props.expanded ? "openicon" : "closedicon";
let icon = folderIcons[data.iconID] ? (!folderIcons[data.iconID].customID ? this.createBase64SVG(folderIcons[data.iconID][iconType], data.color1, data.color2) : folderIcons[data.iconID][iconType]) : null;
if (icon) children[index] = BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCN.guildfoldericonwrapper,
style: {background: `url(${icon}) center/cover no-repeat`}
});
}
}
if (this.settings.general.showCountBadge) {
let mask = BDFDB.ReactUtils.findChild(e.returnvalue, {name: "BlobMask"});
if (mask) {
mask.props.upperLeftBadgeWidth = BDFDB.LibraryComponents.Badges.NumberBadge.prototype.getBadgeWidthForValue(e.instance.props.folderNode.children.length);
mask.props.upperLeftBadge = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Badges.NumberBadge, {
count: e.instance.props.folderNode.children.length,
style: {backgroundColor: "var(--bdfdb-blurple)"}
});
if (this.settings.general.showCountBadge) {
let mask = BDFDB.ReactUtils.findChild(e.returnvalue, {name: "BlobMask"});
if (mask) {
mask.props.upperLeftBadgeWidth = BDFDB.LibraryComponents.Badges.NumberBadge.prototype.getBadgeWidthForValue(e.instance.props.folderNode.children.length);
mask.props.upperLeftBadge = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Badges.NumberBadge, {
count: e.instance.props.folderNode.children.length,
style: {backgroundColor: "var(--bdfdb-blurple)"}
});
}
}
}
}
processListItemTooltip (e) {
let folderNodeChild = BDFDB.ReactUtils.findChild(e.instance, {filter: n => n && n.props && n.props.folderNode});
if (!folderNodeChild) return;
processTooltipContainer (e) {
if (!e.instance.props.tooltipClassName || e.instance.props.tooltipClassName.indexOf(BDFDB.disCN.guildlistitemtooltip) == -1) return;
let child = e.instance.props.children({});
if (!child || !child.props || !child.props.children || !child.props.children.props || !child.props.children.props.folderNode) return;
let data = this.getFolderConfig(folderNodeChild.props.folderNode.id);
e.returnvalue = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, {
text: folderNodeChild.props.folderNode.name || folderNodeChild.props.tooltipName,
e.instance.props.shouldShow = false;
let data = this.getFolderConfig(child.props.children.props.folderNode.id);
let childrenRender = e.instance.props.children;
e.instance.props.children = BDFDB.TimeUtils.suppress((...args) => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, {
text: child.props.children.props.folderNode.name || e.instance.props.text,
tooltipConfig: {
type: "right",
list: true,
@ -805,8 +821,8 @@ module.exports = (_ => {
backgroundColor: data.color3,
fontColor: data.color4
},
children: e.returnvalue.props.children
});
children: childrenRender(...args)
}), "Error in children Render of Guild Folder Tooltip!");
}
processGuildItemWrapper (e) {

View File

@ -345,7 +345,7 @@ module.exports = (_ => {
let key = parseInt(e.returnvalue.props.children[i].key);
let keyName = filter && Object.keys(badges).find(n => badges[n].keys.includes(key));
if (keyName && badgeConfigs[keyName] && !badgeConfigs[keyName][e.instance.props.place]) e.returnvalue.props.children[i] = null;
else if (e.returnvalue.props.children[i].type.displayName == "TooltipContainer" || e.returnvalue.props.children[i].type.displayName == "Tooltip") {
else if (typeof e.returnvalue.props.children[i].props.children == "function" && e.returnvalue.props.children[i].props.text) {
const childrenRender = e.returnvalue.props.children[i].props.children;
e.returnvalue.props.children[i].props.children = (...args) => {
const children = childrenRender(...args);