From e7b130bd39c9e79c93663f23cc23cb243c827dab Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Thu, 20 Jun 2024 19:28:53 +0200 Subject: [PATCH] Fixed Plugin Settings --- Library/0BDFDB.plugin.js | 27 +++++++++++-------- Library/_res/0BDFDB.data.json | 49 ++++++++++++++++++----------------- 2 files changed, 41 insertions(+), 35 deletions(-) diff --git a/Library/0BDFDB.plugin.js b/Library/0BDFDB.plugin.js index 7ff785bfb6..f890b4b0e9 100644 --- a/Library/0BDFDB.plugin.js +++ b/Library/0BDFDB.plugin.js @@ -2,7 +2,7 @@ * @name BDFDB * @author DevilBro * @authorId 278543574059057154 - * @version 3.6.8 + * @version 3.6.9 * @description Required Library for DevilBro's Plugins * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -1435,23 +1435,28 @@ module.exports = (_ => { })]; if (!DiscordConstants[item]) DiscordConstants[item] = BDFDB.ModuleUtils.findByProperties(InternalData.DiscordConstants[item]); } - if (InternalData.DiscordConstants[item].value) DiscordConstants[item] = DiscordConstants[item][InternalData.DiscordConstants[item].value] || DiscordConstants[item]; + if (DiscordConstants[item] && InternalData.DiscordConstants[item].value) DiscordConstants[item] = DiscordConstants[item][InternalData.DiscordConstants[item].value] || DiscordConstants[item]; return DiscordConstants[item] ? DiscordConstants[item] : {}; } }); - const DiscordColors = BDFDB.ModuleUtils.findByProperties("spotify", "guild-boosting-blue"); + const DiscordColors = BDFDB.ModuleUtils.findByProperties("spotify", "guild-boosting-blue") || {}; Internal.DiscordConstants.Colors = new Proxy(DiscordConstants, { get: function (_, item) { const color = DiscordColors[item] || DiscordColors[item.toLowerCase()] || DiscordColors[item.toUpperCase()]; if (color) return color && color.hex || color || ""; else { - const item2 = item.replace(/-/g, "_"); + const item2 = item + "-500"; const color2 = DiscordColors[item2] || DiscordColors[item2.toLowerCase()] || DiscordColors[item2.toUpperCase()]; if (color2) return color2 && color2.hex || color2 || ""; else { - const item3 = item.replace(/_/g, "-"); + const item3 = item.replace(/-/g, "_"); const color3 = DiscordColors[item3] || DiscordColors[item3.toLowerCase()] || DiscordColors[item3.toUpperCase()]; - return color3 && color3.hex || color3 || ""; + if (color3) return color3 && color3.hex || color3 || ""; + else { + const item4 = item.replace(/_/g, "-"); + const color4 = DiscordColors[item4] || DiscordColors[item4.toLowerCase()] || DiscordColors[item4.toUpperCase()]; + return color4 && color4.hex || color4 || ""; + } } } } @@ -2554,7 +2559,7 @@ module.exports = (_ => { }); BDFDB.LibraryModules = Internal.LibraryModules; - if (Internal.LibraryModules.KeyCodeUtils) { + if (Internal.LibraryModules.KeyCodeUtils && Internal.LibraryModules.PlatformUtils) { let originalModule = LibraryModules.KeyCodeUtils; LibraryModules.KeyCodeUtils = new Proxy(originalModule, { get: function (_, item) { @@ -2565,7 +2570,7 @@ module.exports = (_ => { } }); - let codeMap = BDFDB.ObjectUtils.invert(Internal.LibraryModules.PlatformUtils.isLinux() ? Internal.DiscordConstants.LinuxKeyToCode : Internal.LibraryModules.PlatformUtils.isMac() ? Internal.DiscordConstants.MacosKeyToCode : Internal.LibraryModules.PlatformUtils.isWindows() ? Internal.DiscordConstants.WindowsKeyToCode : {}); + let codeMap = BDFDB.ObjectUtils.invert(Internal.LibraryModules.PlatformUtils.isLinux && Internal.LibraryModules.PlatformUtils.isLinux() ? Internal.DiscordConstants.LinuxKeyToCode : Internal.LibraryModules.PlatformUtils.isMac && Internal.LibraryModules.PlatformUtils.isMac() ? Internal.DiscordConstants.MacosKeyToCode : Internal.LibraryModules.PlatformUtils && Internal.LibraryModules.PlatformUtils.isWindows() ? Internal.DiscordConstants.WindowsKeyToCode : {}); let keyMap = [["META", "⌘"], ["RIGHT META", "RIGHT ⌘"], ["SHIFT", "⇧"], ["RIGHT SHIFT", "RIGHT ⇧"], ["ALT", "⌥"], ["RIGHT ALT", "RIGHT ⌥"], ["CTRL", "⌃"], ["RIGHT CTRL", "RIGHT ⌃"], ["ENTER", "↵"], ["BACKSPACE", "⌫"], ["DEL", "⌦"], ["ESC", "⎋"], ["PAGEUP", "⇞"], ["PAGEDOWN", "⇟"], ["UP", "↑"], ["DOWN", "↓"], ["LEFT", "←"], ["RIGHT", "→"], ["HOME", "↖"], ["END", "↘"], ["TAB", "⇥"], ["SPACE", "␣"]]; let mapKeys = key => { let upperCaseKey = key.toUpperCase(); @@ -3072,7 +3077,7 @@ module.exports = (_ => { return activity && activity.type == Internal.DiscordConstants.ActivityTypes.STREAMING ? "streaming" : Internal.LibraryStores.PresenceStore.getStatus(id); }; BDFDB.UserUtils.getStatusColor = function (status, useColor) { - if (!Internal.DiscordConstants.Colors) return null; + if (!Internal.DiscordConstants.Colors || !Internal.DiscordConstants.ColorsCSS) return null; status = typeof status == "string" ? status.toLowerCase() : null; let color = ""; switch (status) { @@ -4454,13 +4459,13 @@ module.exports = (_ => { BDFDB.LogUtils.warn([DiscordClasses[item][0], "not found in DiscordClassModules"]); return className; } - else if ([DiscordClasses[item][1]].flat().every(prop => Internal.DiscordClassModules[DiscordClasses[item][0]][prop] === undefined)) { + else if ([DiscordClasses[item][1]].flat().every(prop => Internal.DiscordClassModules[DiscordClasses[item][0]][prop] === undefined && !(JSON.stringify(Internal.DiscordClassModules[DiscordClasses[item][0]]).split(" ").find(n => n.startsWith(`${prop}_`)) || "").split("\"")[0])) { BDFDB.LogUtils.warn([DiscordClasses[item][1], "not found in", DiscordClasses[item][0], "in DiscordClassModules"]); return className; } else { for (let prop of [DiscordClasses[item][1]].flat()) { - className = Internal.DiscordClassModules[DiscordClasses[item][0]][prop]; + className = Internal.DiscordClassModules[DiscordClasses[item][0]][prop] || (JSON.stringify(Internal.DiscordClassModules[DiscordClasses[item][0]]).split(" ").find(n => n.startsWith(`${prop}_`)) || "").split("\"")[0]; if (className) break; else className = fallbackClassName; } diff --git a/Library/_res/0BDFDB.data.json b/Library/_res/0BDFDB.data.json index b8f14a86ac..d9b307558e 100644 --- a/Library/_res/0BDFDB.data.json +++ b/Library/_res/0BDFDB.data.json @@ -24,8 +24,8 @@ "MAX_MESSAGE_LENGTH": 2000, "MAX_MESSAGE_LENGTH_PREMIUM": 4000, "MAX_MESSAGES_PER_CHANNEL": 50, - "MAX_VIDEO_WIDTH": 1024, - "MAX_VIDEO_HEIGHT": 640, + "MAX_VIDEO_WIDTH": 3840, + "MAX_VIDEO_HEIGHT": 2160, "ME": "@me", "MenuItemColors": { "BRAND": "brand", @@ -101,12 +101,18 @@ "UserSettingsSections": ["CHANGE_LOG", "DEVELOPER_OPTIONS"] }, "LibraryModules": { - "AckUtils": {"props": ["ack", "bulkAck", "localAck"]}, + "AckUtils": {"strings": ["type:\"CHANNEL_ACK\",channelId", "type:\"BULK_ACK\",channels:"], "exported": false, "value": "exports", "map": { + "ack": ["type:\"CHANNEL_ACK\""], + "bulkAck": ["type:\"BULK_ACK\""] + }}, "ActivityUtils": {"props": ["sendActivityInvite", "updateActivity"]}, "AnalyticsUtils": {"props": ["isThrottled", "track"]}, "AnimationUtils": {"props": ["spring", "decay"]}, "APIEncodeUtils": {"props": ["stringify", "parse", "encode"]}, "APIUtils": {"props": ["getAPIBaseURL"]}, + "APIUtils": {"strings": ["window.GLOBAL_ENV.API_ENDPOINT+", "GLOBAL_ENV.API_VERSION"], "exported": false, "value": "exports", "map": { + "getAPIBaseURL": ["window.GLOBAL_ENV.API_ENDPOINT+"] + }}, "AppearanceSettingsUtils": {"props": ["updateLocale", "updateTheme"]}, "ApplicationAssetUtils": {"props": ["getAssetImage", "getAssetIds"]}, "AppUtils": {"props": ["clipboard", "os"]}, @@ -156,12 +162,16 @@ "MessageParser": {"props": ["parseEmbedTitle", "defaultRules"]}, "MessagePinUtils": {"props": ["pinMessage", "unpinMessage"]}, "MessageUtils": {"props": ["receiveMessage", "editMessage"]}, - "ModalUtils": {"props": ["openModal", "hasModalOpen", "useHasAnyModalOpen"]}, + "ModalUtils": {"strings": [".modalKey", "onCloseCallback", "Layer:"], "exported": false, "value": "exports", "map": { + "openModal": ["backdropStyle:", "modalKey:", "Layer:"] + }}, "NitroUtils": {"props": ["canUseIncreasedMessageLength", "canUsePremiumGuildMemberProfile"]}, "NotificationSettingsUtils": {"props": ["setDesktopType", "setTTSType"]}, "PlatformUtils": {"props": ["isAndroid", "isWindows"]}, "PermissionRoleUtils": {"props": ["can", "makeEveryoneOverwrite"]}, - "PreferencesContext": {"strings": ["reducedMotion", "forcedColors", "alwaysShowLinkDecorations", "createContext"]}, + "PreferencesContext": {"strings": ["reducedMotion", "forcedColors", "alwaysShowLinkDecorations", "createContext"], "exported": false, "value": "exports", "map": { + "AccessibilityPreferencesContext": ["[object Object]"] + }}, "PrivateChannelUtils": {"props": ["addRecipient", "openPrivateChannel"]}, "QuerySearchUtils": {"props": ["queryGuilds", "queryGroupDMs"]}, "ReactionEmojiUtils": {"props": ["getReactionEmojiName", "getAccessibleEmojiDisplayName"]}, @@ -1281,39 +1291,30 @@ }, "NotFound": { "_": "", - "attachmentWrapper": "wrapper_f316dd", - "botTag": "botTag_a02df3", - "embed": "embed_ad0b71", "emoji": "emoji", "carouselModal": "carouselModal__7e22f", "carouselModal": "carouselModal__7e22f", "highlight": "highlight", - "hotkeyButton": "button_c67e31", - "hotkeyContainer": "container_c67e31", "hueCursor": "hue_cursor", "hueHorizontal": "hue-horizontal", "hueVertical": "hue-vertical", "mention": "mention", "mentionInteractive": "interactive", "mentionWrapper": "wrapper__53064", - "messageBotTag": "botTag_ec86aa", "messagesLoadingWrapper": "wrapper__11501", "nameContainer": "container_a48b21", "nameContainerNameContainer": "container__43554", - "pageButton": "pageButton_b48941", "saturationBlack": "saturation-black", "saturationColor": "saturation-color", "saturationCursor": "saturation-cursor", "saturationWhite": "saturation-white", "searchResultsPagination": "container__77df8", - "settingsTableHeader": "header_cacc4c", "stopAnimations": "stop-animations", "subtext": "subtext_ce73b4", "themeCustomBackground": "custom-theme-background", "themeDark": "theme-dark", "themeLight": "theme-light", "themeUndefined": "theme-undefined", - "titleBar": "titleBar_a934d8", "userPopoutNote": "note_ba0c31" }, "Toast": { @@ -1584,7 +1585,7 @@ "UserBadges": {"props": ["profileBadge", "container"]}, "UserBanner": {"props": ["popoutBanner", "popoutBannerPremium"]}, "UserPopoutFooter": {"props": ["wumpusTooltip", "messageInputContainer"]}, - "UserPopoutHeader": {"props": ["avatarHint", "profileBadges", "avatarWrapper"]}, + "UserPopoutHeader": {"props": ["avatarHint", "profileBadges", "avatarWrapperNormal"]}, "UserPopoutSection": {"props": ["section", "lastSection"]}, "UserPopoutSectionTitle": {"props": ["title", "body", "clydeMoreInfo"]}, "UserPopoutUsernameSection": {"props": ["userTagNoNickname", "nickname", "headerBotTag"]}, @@ -1858,7 +1859,7 @@ "appinner": ["AppInner", "app"], "appmount": ["AppMount", "appMount"], "applayers": ["AppInner", "layers"], - "attachment": ["NotFound", "attachmentWrapper"], + "attachment": ["Attachment", "wrapper"], "attachmentcontrolshidden": ["Attachment", "wrapperControlsHidden"], "attachmentcover": ["AttachmentCover", "cover"], "attachmentcovericon": ["AttachmentCover", "icon"], @@ -1929,7 +1930,7 @@ "bdfdbsupportert3": ["BDFDB", "supporterTier3"], "bdfdbsupportert4": ["BDFDB", "supporterTier4"], "bold": ["TextStyle", "bold"], - "bottag": ["NotFound", "botTag"], + "bottag": ["BotTag", "botTag"], "bottaginvert": ["BotTag", "botTagInvert"], "bottagmember": ["Member", "botTag"], "bottagnametag": ["NameTag", "bot"], @@ -2234,7 +2235,7 @@ "defaultchannelwelcometitle": ["DefaultChannelWelcome", "titleName"], "downloadlink": ["DownloadLink", "downloadLink"], "ellipsis": ["PopoutActivity", "ellipsis"], - "embed": ["NotFound", "embed"], + "embed": ["Embed", "embed"], "embedauthor": ["Embed", "embedAuthor"], "embedauthoricon": ["Embed", "embedAuthorIcon"], "embedauthorname": ["Embed", "embedAuthorName"], @@ -2472,8 +2473,8 @@ "highlight": ["NotFound", "highlight"], "homebuttonicon": ["HomeIcon", "homeIcon"], "homebuttonpill": ["HomeIcon", "pill"], - "hotkeybutton": ["NotFound", "hotkeyButton"], - "hotkeycontainer": ["NotFound", "hotkeyContainer"], + "hotkeybutton": ["HotKeyRecorder", "button"], + "hotkeycontainer": ["HotKeyRecorder", "container"], "hotkeydisabled": ["HotKeyRecorder", "disabled"], "hotkeyediticon": ["HotKeyRecorder", "editIcon"], "hotkeyhasvalue": ["HotKeyRecorder", "hasValue"], @@ -2708,7 +2709,7 @@ "messageblockedtext": ["MessageBlocked", "blockedMessageText"], "messageblockquotecontainer": ["MessageMarkup", "blockquoteContainer"], "messageblockquotedivider": ["MessageMarkup", "blockquoteDivider"], - "messagebottag": ["NotFound", "messageBotTag"], + "messagebottag": ["MessageBody", "botTag"], "messagebottagcompact": ["MessageBody", "botTagCompact"], "messagebottagcozy": ["MessageBody", "botTagCozy"], "messagebuttoncontainer": ["MessageBody", "buttonContainer"], @@ -2954,7 +2955,7 @@ "pageimagewrapper": ["PageImage", "wrapper"], "pagination": ["BDFDB", "pagination"], "paginationbottom": ["BDFDB", "paginationBottom"], - "paginationbutton": ["NotFound", "pageButton"], + "paginationbutton": ["Pagination", "pageButton"], "paginationbuttonactive": ["Pagination", "activeButton"], "paginationbuttonend": ["Pagination", "endButton"], "paginationbuttonendinner": ["Pagination", "endButtonInner"], @@ -3119,7 +3120,7 @@ "settingsrowtitle": ["SettingsItems", "title"], "settingsrowtitlemini": ["BDFDB", "settingsRowTitleMini"], "settingsseparator": ["Item", "separator"], - "settingstableheader": ["NotFound", "settingsTableHeader"], + "settingstableheader": ["SettingsTable", "header"], "settingstableheadername": ["SettingsTable", "headerName"], "settingstableheaderoption": ["SettingsTable", "headerOption"], "settingstableheaderoptions": ["BDFDB", "settingsTableHeaderOptions"], @@ -3249,7 +3250,7 @@ "tipblock": ["Tip", "block"], "tippro": ["Tip", "pro"], "tipinline": ["Tip", "inline"], - "titlebar": ["NotFound", "titleBar"], + "titlebar": ["TitleBar", "titleBar"], "titlebarmac": ["TitleBar", "typeMacOS"], "titlebarmacbutton": ["TitleBar", "macButton"], "titlebarmacbuttonclose": ["TitleBar", "macButtonClose"],