diff --git a/Library/_res/0BDFDB.data.json b/Library/_res/0BDFDB.data.json index 86af467fa2..fbd8b3d1e6 100644 --- a/Library/_res/0BDFDB.data.json +++ b/Library/_res/0BDFDB.data.json @@ -51,6 +51,7 @@ "ChannelTypeGroups": ["GUILD_TEXTUAL", "GUILD_VOCAL", "ALL_DMS"], "Colors": ["SPOTIFY", "STATUS_RED"], "ComponentActions": ["INSERT_TEXT", "TEXTAREA_FOCUS"], + "EmojiSprites": ["DiversityPerRow", "PickerPerRow"], "Endpoints": ["CAPTCHA", "GUILD", "MESSAGES"], "FriendsSections": ["ALL", "ONLINE", "ADD_FRIEND"], "InboxTabs": ["MENTIONS", "UNREADS"], diff --git a/Plugins/DisplayServersAsChannels/DisplayServersAsChannels.plugin.js b/Plugins/DisplayServersAsChannels/DisplayServersAsChannels.plugin.js index 66cefbb81a..9e97abaeb2 100644 --- a/Plugins/DisplayServersAsChannels/DisplayServersAsChannels.plugin.js +++ b/Plugins/DisplayServersAsChannels/DisplayServersAsChannels.plugin.js @@ -2,7 +2,7 @@ * @name DisplayServersAsChannels * @author DevilBro * @authorId 278543574059057154 - * @version 1.6.1 + * @version 1.6.2 * @description Displays Servers in a similar way as Channels * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -60,7 +60,8 @@ module.exports = (_ => { onLoad () { this.defaults = { general: { - showGuildIcon: {value: true, description: "Shows a Icon for Servers"}, + showGuildIcon: {value: true, description: "Adds the Server Icon"}, + addFolderColor: {value: true, description: "Recolors the Folder's Server List Background to the Folder Color"}, }, amounts: { serverListWidth: {value: 240, min: 45, description: "Server List Width in px: "}, @@ -74,8 +75,8 @@ module.exports = (_ => { after: [ "CircleIconButton", "DirectMessage", - "FolderItem", "FolderHeader", + "FolderItemWrapper", "GuildFavorites", "GuildItem", "GuildsBar", @@ -88,6 +89,10 @@ module.exports = (_ => { ${BDFDB.dotCN.forumpagelist} { justify-content: flex-start; } + ${BDFDB.dotCN.guilds} [style*="--folder-color"] ${BDFDB.dotCN.guildfolderexpandedbackground} { + background: var(--folder-color) !important; + opacity: 0.2 !important; + } `; } @@ -156,6 +161,20 @@ module.exports = (_ => { if (scroller) { scroller.props.fade = true; scroller.type = BDFDB.LibraryComponents.Scrollers.Thin; + let padding = parseInt(BDFDB.LibraryModules.PlatformUtils.isWindows() ? 4 : BDFDB.LibraryModules.PlatformUtils.isDarwin() ? 0 : 12) + 10; + let isVisible = (currentItem, t, items) => { + if (!scroller.ref || !scroller.ref.current) return false; + const index = items.findIndex(item => typeof item == "string" || !item ? currentItem === item : item.includes(currentItem)); + if (index < 0) return false; + let size = this.settings.amounts.serverElementHeight * index + padding; + if (!t) size += 40; + const state = scroller.ref.current.getScrollerState(); + return !!(!t && size >= state.scrollTop || t && size + parseInt(this.settings.amounts.serverElementHeight) <= state.scrollTop + state.offsetHeight); + }; + let topBar = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.guildswrapperunreadmentionsbartop]]}); + if (topBar) topBar.props.isVisible = BDFDB.TimeUtils.suppress(isVisible, "Error in isVisible of Top Bar in Guild List!"); + let bottomBar = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.guildswrapperunreadmentionsbarbottom]]}); + if (bottomBar) bottomBar.props.isVisible = BDFDB.TimeUtils.suppress(isVisible, "Error in isVisible of Bottom Bar in Guild List!"); } } @@ -205,11 +224,6 @@ module.exports = (_ => { }); } - processFolderItem (e) { - if (!e.instance.props.folderNode) return; - this.removeTooltip(e.returnvalue); - } - processFolderHeader (e) { if (!e.instance.props.folderNode) return; e.returnvalue = this.removeMask(e.returnvalue, true); @@ -229,6 +243,15 @@ module.exports = (_ => { }); } + processFolderItemWrapper (e) { + if (!e.instance.props.folderNode) return; + let folderColor = this.settings.general.addFolderColor && BDFDB.LibraryStores.ExpandedGuildFolderStore.isFolderExpanded(e.instance.props.folderNode.id) && BDFDB.ColorUtils.convert(e.instance.props.folderNode.color, "HEX"); + if (folderColor) e.returnvalue = BDFDB.ReactUtils.createElement("div", { + style: {"--folder-color": folderColor}, + children: e.returnvalue + }); + } + processCircleIconButton (e) { const child = BDFDB.ReactUtils.findChild(e.returnvalue, {filter: n => n.props && n.props.id && typeof n.props.children == "function"}); let process = returnvalue => {