From a5d1b09e228ec4b931e5654a09702ff0d026d659 Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Sat, 20 Apr 2024 07:35:50 +0200 Subject: [PATCH] stuff --- Library/_res/0BDFDB.data.json | 4 +++- .../DisplayServersAsChannels.plugin.js | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Library/_res/0BDFDB.data.json b/Library/_res/0BDFDB.data.json index 24549dfc01..aa42d27e6c 100644 --- a/Library/_res/0BDFDB.data.json +++ b/Library/_res/0BDFDB.data.json @@ -355,13 +355,14 @@ "FolderItem": {"strings": ["folderNode:", "expandedFolderBackground", "onExpandCollapse"]}, "FolderItemWrapper": {"strings": ["folderNode:", "isFolderExpanded", "defaultFolderName:"]}, "FolderSettingsModal": {"strings": [".handleNameChange", ".handleSubmit", "folderName:"], "noSearch": true}, + "GuildBadge": {"strings": ["foregroundDarkColor", "getBadgeCategory"]}, "GuildBans": {"strings": [".Messages.BANS_NO_USERS_BANNED", ".Messages.BANS_SEARCH_PLACEHOLDER", ".getSortedBans"]}, "GuildChannelListContextMenu": {"strings": ["GUILD_ACTIONS_MENU_LABEL", "\"guild-context\",\"aria-label\""], "noSearch": true}, + "GuildChild": {"strings": [".getAcronym", ",fontSize:", ".acronym"], "noSearch": true}, "GuildContextMenu": {"strings": ["GUILD_ACTIONS_MENU_LABEL", "navId:\"guild", "GuildContextMenu"], "noSearch": true}, "GuildEmojis": {"strings": ["getMaxEmojiSlots", "lightSrc:", ".Messages.NO_EMOJI"]}, "GuildFavorites": {"strings": [".favoriteIcon", "FAVORITES_GUILD_NAME"]}, "GuildHeader": {"strings": ["bannerVisible:", "disableBannerAnimation:", "onContextMenu"]}, - "GuildChild": {"strings": [".getAcronym", ",fontSize:", ".acronym"], "noSearch": true}, "GuildIcon": {"strings": [",animate:", ",size:", "{active:!0"], "noSearch": true}, "GuildIconWrapper": {"strings": ["badgeStrokeColor:", "textScale:"]}, "GuildInvitationRow": {"strings": [".getSelectedInviteMetadata", ".getSuggestedProps", "inviteKey:"], "noSearch": true}, @@ -380,6 +381,7 @@ "HeaderBarTitleIcon": {"strings": ["HEADER_BAR_BADGE", ".iconBadge", "iconClassName:"]}, "HomeButtonDefault": {"strings": [".DISCODO_ENABLED", "home_button_no_track", "tutorialContainer"]}, "I18nLoader": {"strings": [".Messages.I18N_LOCALE_LOADING_ERROR", ".loading"]}, + "IconBadge": {"strings": [".icon}", "ROUND,disableColor", ".iconBadge,"]}, "ImageModal": {"strings": ["renderLinkComponent", ".Messages.OPEN_IN_BROWSER", "animated"], "noSearch": true}, "ImageVideoModal": {"strings": ["renderLinkComponent", ".Messages.OPEN_IN_BROWSER", "videoWrapper"], "noSearch": true}, "InboxHeader": {"strings": [".UNREADS", ".TODOS", ".controls"]}, diff --git a/Plugins/DisplayServersAsChannels/DisplayServersAsChannels.plugin.js b/Plugins/DisplayServersAsChannels/DisplayServersAsChannels.plugin.js index 51dd0a67ef..324c03c6d0 100644 --- a/Plugins/DisplayServersAsChannels/DisplayServersAsChannels.plugin.js +++ b/Plugins/DisplayServersAsChannels/DisplayServersAsChannels.plugin.js @@ -86,10 +86,12 @@ module.exports = (_ => { "DirectMessage", "FolderHeader", "FolderItemWrapper", + "GuildBadge", "GuildFavorites", "GuildItem", "GuildsBar", "HomeButtonDefault", + "IconBadge", "UnavailableGuildsButton" ] }; @@ -232,6 +234,20 @@ module.exports = (_ => { }); } + processGuildBadge (e) { + this.processIconBadge(e, "Guild"); + } + + processIconBadge (e, type = "Icon") { + if (!e.returnvalue) return; + let ref = e.returnvalue.ref; + e.returnvalue.ref = BDFDB.TimeUtils.suppress(instance => { + if (typeof ref == "function") ref(instance); + let node = BDFDB.ReactUtils.findDOMNode(instance); + if (node) for (let path of node.querySelectorAll("path")) path.style.setProperty("d", `path("${path.getAttribute("d")}")`, "important"); + }, `Error in Ref of ${type} Badge`, this); + } + processFolderHeader (e) { if (!e.instance.props.folderNode) return; e.returnvalue = this.removeMask(e.returnvalue);