From 978d396ebb9117218ab6af271e5b7f417fbb2c60 Mon Sep 17 00:00:00 2001 From: Mirco Wittrien <23700969+mwittrien@users.noreply.github.com> Date: Thu, 23 Jun 2022 19:28:44 +0200 Subject: [PATCH] stuff --- Library/_res/0BDFDB.data.json | 3 ++- .../DisplayServersAsChannels.plugin.js | 20 ++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Library/_res/0BDFDB.data.json b/Library/_res/0BDFDB.data.json index 57edbb5652..4cd234b56f 100644 --- a/Library/_res/0BDFDB.data.json +++ b/Library/_res/0BDFDB.data.json @@ -242,6 +242,7 @@ "DirectMessage": {"class": "guildouter", "forceObserve": true}, "EmojiPicker": {"strings": ["EMOJI_PICKER_TAB_PANEL_ID", "diversitySelector"]}, "FocusRing": {"props": ["FocusRingScope"]}, + "GuildFavorites": {"strings": [".favoriteIcon", "FAVORITES_GUILD_NAME"]}, "GuildFolderSettingsModal": {"lazyLoaded": true, "exported": true}, "GuildHeader": {"strings": ["bannerVisible", "guildBanner", "onContextMenu"]}, "GuildIcon": {"class": "avataricon", "forceObserve": true}, @@ -362,6 +363,7 @@ "Badge": {"name": "GuildBadge"}, "BlobMask": {"name": "BlobMask"}, "DragPlaceholder": {"name": "DragPlaceholder"}, + "Favorites": {"strings": [".favoriteIcon", "FAVORITES_GUILD_NAME"]}, "Icon": {"name": "GuildIconWrapper"}, "MutedText": {"props": ["useMutedUntilText"], "value": "default"}, "Pill": {"strings": ["opacity:1,height:", "20:8", "default.item"]}, @@ -2738,7 +2740,6 @@ "noticedefault": ["Notice", "colorDefault"], "noticedownload": ["Notice", "colorDownload"], "noticedismiss": ["Notice", "closeButton"], - "noticedismissicon": ["Notice", "closeIcon"], "noticeicon": ["NoticePlatform", "icon"], "noticeiconandroid": ["NoticePlatform", "iconAndroid"], "noticeiconapple": ["NoticePlatform", "iconApple"], diff --git a/Plugins/DisplayServersAsChannels/DisplayServersAsChannels.plugin.js b/Plugins/DisplayServersAsChannels/DisplayServersAsChannels.plugin.js index 8097b25728..24bd2b8987 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.5.8 + * @version 1.5.9 * @description Displays Servers in a similar way as Channels * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -17,15 +17,8 @@ module.exports = (_ => { "info": { "name": "DisplayServersAsChannels", "author": "DevilBro", - "version": "1.5.8", + "version": "1.5.9", "description": "Displays Servers in a similar way as Channels" - }, - "changeLog": { - "improved": { - "Voice/Stream Users": "Shows Voice/Stream Users Tooltip when hovering over a Server", - "Muted": "Reduces Opacity of DM/Server Name if they are muted", - "New Inbox Position": "Works for the new Inbox Position above the Home Button" - } } }; @@ -85,6 +78,7 @@ module.exports = (_ => { after: { Guilds: "type", HomeButton: "type", + GuildFavorites: "default", DirectMessage: "render", GuildItem: "type", FolderItem: "default", @@ -161,6 +155,8 @@ module.exports = (_ => { } processGuilds (e) { + let [favoritesChildren, favoritesIndex] = BDFDB.ReactUtils.findParent(e.returnvalue, {filter: n => n && n.type && [".favoriteIcon", "FAVORITES_GUILD_NAME"].every(s => n.type.toString().indexOf(s) > -1)}); + if (favoritesIndex > -1) favoritesChildren[favoritesIndex] = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.GuildComponents.Favorites, {}); let [errorChildren, errorIndex] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "FluxContainer()"}); if (errorIndex > -1) errorChildren[errorIndex] = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.GuildComponents.UnavailableGuildsButton, { unavailableGuilds: BDFDB.LibraryModules.GuildUnavailableStore.totalUnavailableGuilds @@ -178,6 +174,12 @@ module.exports = (_ => { this.addElementName(e.returnvalue, BDFDB.LanguageUtils.LanguageStrings.HOME); } + processGuildFavorites (e) { + this.removeTooltip(e.returnvalue); + e.returnvalue = this.removeMask(e.returnvalue); + this.addElementName(e.returnvalue, BDFDB.LanguageUtils.LanguageStrings.FAVORITES_GUILD_NAME); + } + processDirectMessage (e) { if (e.instance.props.channel.id) { if (e.returnvalue.props.children && e.returnvalue.props.children.props) e.returnvalue.props.children.props.className = BDFDB.DOMUtils.formatClassName(e.returnvalue.props.children.props.className, BDFDB.LibraryModules.MutedUtils.isChannelMuted(null, e.instance.props.channel.id) && BDFDB.disCN._displayserversaschannelsmuted);