diff --git a/Library/_res/0BDFDB.data.json b/Library/_res/0BDFDB.data.json index 264ae38f57..7b47448589 100644 --- a/Library/_res/0BDFDB.data.json +++ b/Library/_res/0BDFDB.data.json @@ -152,6 +152,42 @@ "ZoomUtils": {"props": ["setZoom", "setFontSize"]} }, "ModuleUtilsConfig": { + "QueuedComponents": [ + "GuildHeaderContextMenu", + "SystemMessageOptionContextMenu", + "SystemMessageOptionToolbar", + "MessageOptionContextMenu", + "MessageOptionToolbar" + ], + "ContextMenuTypes": [ + "UserSettingsCog", + "UserProfileActions", + "Event", + "GroupDMUser", + "GroupDM", + "DM", + "User", + "Developer", + "Slate", + "GuildSettingsRole", + "GuildDirectoryEntry", + "GuildFolder", + "SystemMessage", + "Message", + "Native", + "Role", + "Guild", + "Channel" + ], + "ContextMenuTypesMap": { + "GroupDMUserContextMenu": "DMContextMenu" + }, + "ContextMenuSubItemsMap": { + "UserContextMenu": { + "key": "user", + "items": ["useHideNoVideoParticipantsItem", "useHideSelfVideoItem", "usePreviewVideoItem", "useChangeIdentityItem", "useMoveToAudienceItem", "useAddFriendNicknameItem", "useAddNoteItem", "useBlockUserItem", "useCallUserItem", "useFocusVideoItem", "useInviteUserToGuildItems", "useMentionUserItem", "useMessageUserItem", "useUserProfileItem", "useUserRolesItems", "useUserVolumeItem", "useWatchStreamItem"] + } + }, "PatchTypes": [ "before", "instead", @@ -264,6 +300,7 @@ "QuickSwitchUserResult": "LibraryComponents.QuickSwitchItems.User" } }, + "ForceLoadedComponents": {}, "NativeSubComponents": { "Button": {"props": ["Colors", "Hovers", "Looks"]}, "Checkbox": {"name": "Checkbox"}, diff --git a/Plugins/BetterFriendList/BetterFriendList.plugin.js b/Plugins/BetterFriendList/BetterFriendList.plugin.js index 8441709142..adf868cfb8 100644 --- a/Plugins/BetterFriendList/BetterFriendList.plugin.js +++ b/Plugins/BetterFriendList/BetterFriendList.plugin.js @@ -184,10 +184,6 @@ module.exports = (_ => { } onDMContextMenu (e) { - this.onUserContextMenu(e); - } - - onUserContextMenu (e) { if (e.instance.props.user) { let [children, index] = BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: "remove-friend"}); let favorized = favorizedFriends.indexOf(e.instance.props.user.id) > -1; diff --git a/Plugins/ImageUtilities/ImageUtilities.plugin.js b/Plugins/ImageUtilities/ImageUtilities.plugin.js index 71e5cb7c7c..7875508b0d 100644 --- a/Plugins/ImageUtilities/ImageUtilities.plugin.js +++ b/Plugins/ImageUtilities/ImageUtilities.plugin.js @@ -2,7 +2,7 @@ * @name ImageUtilities * @author DevilBro * @authorId 278543574059057154 - * @version 4.5.5 + * @version 4.5.6 * @description Adds several Utilities for Images/Videos (Gallery, Download, Reverse Search, Zoom, Copy, etc.) * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -17,7 +17,7 @@ module.exports = (_ => { "info": { "name": "ImageUtilities", "author": "DevilBro", - "version": "4.5.5", + "version": "4.5.6", "description": "Adds several Utilities for Images/Videos (Gallery, Download, Reverse Search, Zoom, Copy, etc.)" } }; @@ -508,7 +508,17 @@ module.exports = (_ => { } onUserContextMenu (e) { - if (e.instance.props.user && this.settings.places.userAvatars) this.injectItem(e, (e.instance.props.user.getAvatarURL(e.instance.props.guildId, 4096) || "").replace(/\.webp|\.gif/, ".png"), BDFDB.LibraryModules.IconUtils.isAnimatedIconHash(e.instance.props.user.avatar) && e.instance.props.user.getAvatarURL(e.instance.props.guildId, 4096, true)); + if (e.instance.props.user && this.settings.places.userAvatars && e.subType == "useUserRolesItems") { + let validUrls = this.filterUrls((e.instance.props.user.getAvatarURL(e.instance.props.guildId, 4096) || "").replace(/\.webp|\.gif/, ".png"), BDFDB.LibraryModules.IconUtils.isAnimatedIconHash(e.instance.props.user.avatar) && e.instance.props.user.getAvatarURL(e.instance.props.guildId, 4096, true)); + if (!validUrls.length) return; + + if (e.returnvalue.length) e.returnvalue.push(BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuSeparator, {})); + e.returnvalue.push(BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, { + label: this.isValid(validUrls[0].file, "video") ? BDFDB.LanguageUtils.LanguageStrings.VIDEO : BDFDB.LanguageUtils.LanguageStrings.IMAGE + " " + BDFDB.LanguageUtils.LanguageStrings.ACTIONS, + id: BDFDB.ContextMenuUtils.createItemId(this.name, "main-subitem"), + children: this.createSubMenus(e.instance, validUrls) + })); + } } onGroupDMContextMenu (e) { diff --git a/Plugins/UserNotes/UserNotes.plugin.js b/Plugins/UserNotes/UserNotes.plugin.js index 8d4d815743..9d34a1d7e7 100644 --- a/Plugins/UserNotes/UserNotes.plugin.js +++ b/Plugins/UserNotes/UserNotes.plugin.js @@ -2,7 +2,7 @@ * @name UserNotes * @author DevilBro * @authorId 278543574059057154 - * @version 1.0.7 + * @version 1.0.8 * @description Allows you to write User Notes locally * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -17,7 +17,7 @@ module.exports = (_ => { "info": { "name": "UserNotes", "author": "DevilBro", - "version": "1.0.7", + "version": "1.0.8", "description": "Allows you to write User Notes locally" } }; @@ -106,14 +106,12 @@ module.exports = (_ => { } onUserContextMenu (e) { - if (e.instance.props.user) { - let [children, index] = BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: "devmode-copy-id", group: true}); - children.splice(index > -1 ? index : children.length, 0, BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuGroup, { - children: BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, { - label: this.labels.user_note, - id: BDFDB.ContextMenuUtils.createItemId(this.name, "user-note"), - action: _ => this.openNotesModal(e.instance.props.user) - }) + if (e.instance.props.user && e.subType == "useUserRolesItems") { + if (e.returnvalue.length) e.returnvalue.push(BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuSeparator, {})); + e.returnvalue.push(BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, { + label: this.labels.user_note, + id: BDFDB.ContextMenuUtils.createItemId(this.name, "user-note"), + action: _ => this.openNotesModal(e.instance.props.user) })); } }