From 478373a26a808ed89a328398e889667528a38ae3 Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Sat, 11 Sep 2021 19:35:49 +0200 Subject: [PATCH] stuff --- Library/0BDFDB.plugin.js | 12 ++++---- Plugins/EditChannels/EditChannels.plugin.js | 6 ++-- Plugins/EditUsers/EditUsers.plugin.js | 4 +-- Plugins/ServerDetails/ServerDetails.plugin.js | 28 +++++++++++++++++-- Themes/BasicBackground/BasicBackground.css | 11 ++++++-- 5 files changed, 45 insertions(+), 16 deletions(-) diff --git a/Library/0BDFDB.plugin.js b/Library/0BDFDB.plugin.js index f713bb9883..c4b5abb4c5 100644 --- a/Library/0BDFDB.plugin.js +++ b/Library/0BDFDB.plugin.js @@ -2,7 +2,7 @@ * @name BDFDB * @author DevilBro * @authorId 278543574059057154 - * @version 1.8.4 + * @version 1.8.5 * @description Required Library for DevilBro's Plugins * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -19,7 +19,7 @@ module.exports = (_ => { "info": { "name": "BDFDB", "author": "DevilBro", - "version": "1.8.4", + "version": "1.8.5", "description": "Required Library for DevilBro's Plugins" }, "rawUrl": `https://mwittrien.github.io/BetterDiscordAddons/Library/0BDFDB.plugin.js` @@ -7705,9 +7705,9 @@ module.exports = (_ => { let childProps = Object.assign({}, child.props); let shown = false; child.props.onMouseEnter = (e, childThis) => { - if (!shown && !e.currentTarget.BDFDBtooltipShown) { + if (!shown && !e.currentTarget.BDFDBtooltipShown && !(this.props.onlyShowOnShift && !e.shiftKey) && !(this.props.onlyShowOnCtrl && !e.ctrlKey)) { e.currentTarget.BDFDBtooltipShown = shown = true; - this.tooltip = BDFDB.TooltipUtils.create(e.currentTarget, typeof this.props.text == "function" ? this.props.text(this) : this.props.text, Object.assign({ + this.tooltip = BDFDB.TooltipUtils.create(e.currentTarget, typeof this.props.text == "function" ? this.props.text(this, e) : this.props.text, Object.assign({ note: this.props.note, delay: this.props.delay }, this.props.tooltipConfig, { @@ -7728,12 +7728,12 @@ module.exports = (_ => { child.props.onClick = (e, childThis) => { if (typeof this.props.onClick == "function") this.props.onClick(e, this); if (typeof childProps.onClick == "function") childProps.onClick(e, childThis); - if (typeof this.props.text == "function") this.updateTooltip(this.props.text(this)); + if (typeof this.props.text == "function") this.updateTooltip(this.props.text(this, e)); }; child.props.onContextMenu = (e, childThis) => { if (typeof this.props.onContextMenu == "function") this.props.onContextMenu(e, this); if (typeof childProps.onContextMenu == "function") childProps.onContextMenu(e, childThis); - if (typeof this.props.text == "function") this.updateTooltip(this.props.text(this)); + if (typeof this.props.text == "function") this.updateTooltip(this.props.text(this, e)); }; return BDFDB.ReactUtils.createElement(LibraryModules.React.Fragment, { children: child diff --git a/Plugins/EditChannels/EditChannels.plugin.js b/Plugins/EditChannels/EditChannels.plugin.js index 95f598bee1..2c32d71eab 100644 --- a/Plugins/EditChannels/EditChannels.plugin.js +++ b/Plugins/EditChannels/EditChannels.plugin.js @@ -107,7 +107,7 @@ module.exports = (_ => { ThreadEmptyMessage: "default", SystemMessageWrapper: "type", AutocompleteChannelResult: "render", - AuditLog: "render", + GuildSettingsAuditLogEntry: "render", SettingsInvites: "render", HeaderBarContainer: "render", ChannelCategoryItem: "type", @@ -121,7 +121,7 @@ module.exports = (_ => { ThreadMessageAccessories: "default", ThreadCreated: "default", AutocompleteChannelResult: "render", - AuditLog: "render", + GuildSettingsAuditLogEntry: "render", HeaderBarContainer: "render", ThreadSidebar: "default", ThreadCard: "type", @@ -345,7 +345,7 @@ module.exports = (_ => { } } - processAuditLog (e) { + processGuildSettingsAuditLogEntry (e) { let channel = BDFDB.ObjectUtils.get(e.instance, "props.log.options.channel"); if (channel && this.settings.places.auditLog) { if (!e.returnvalue) e.instance.props.log.options.channel = this.getChannelData(channel.id); diff --git a/Plugins/EditUsers/EditUsers.plugin.js b/Plugins/EditUsers/EditUsers.plugin.js index 33d090a566..89e03c9375 100644 --- a/Plugins/EditUsers/EditUsers.plugin.js +++ b/Plugins/EditUsers/EditUsers.plugin.js @@ -131,7 +131,7 @@ module.exports = (_ => { ChannelReply: "default", MemberListItem: "render", AuditLogs: "render", - AuditLog: "render", + GuildSettingsAuditLogEntry: "render", GuildSettingsEmoji: "render", MemberCard: "render", SettingsInvites: "render", @@ -962,7 +962,7 @@ module.exports = (_ => { } } - processAuditLog (e) { + processGuildSettingsAuditLogEntry (e) { if (e.instance.props.log && this.settings.places.guildSettings) { if (e.instance.props.log.user) e.instance.props.log.user = this.getUserData(e.instance.props.log.user.id); if (e.instance.props.log.target && e.instance.props.log.targetType == "USER") e.instance.props.log.target = this.getUserData(e.instance.props.log.target.id); diff --git a/Plugins/ServerDetails/ServerDetails.plugin.js b/Plugins/ServerDetails/ServerDetails.plugin.js index 72c611c139..257cd97a0d 100644 --- a/Plugins/ServerDetails/ServerDetails.plugin.js +++ b/Plugins/ServerDetails/ServerDetails.plugin.js @@ -2,7 +2,7 @@ * @name ServerDetails * @author DevilBro * @authorId 278543574059057154 - * @version 1.0.6 + * @version 1.0.7 * @description Shows Server Details in the Server List Tooltip * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -17,8 +17,13 @@ module.exports = (_ => { "info": { "name": "ServerDetails", "author": "DevilBro", - "version": "1.0.6", + "version": "1.0.7", "description": "Shows Server Details in the Server List Tooltip" + }, + "changeLog": { + "added": { + "Shift": "Added Shift Key Option" + } } }; @@ -82,6 +87,7 @@ module.exports = (_ => { } } render() { + if (_this.settings.general.onlyShowOnShift && !this.props.shiftKey) return null; if (_this.settings.amounts.tooltipDelay && !this.state.delayed) { BDFDB.TimeUtils.timeout(_ => { this.state.delayed = true; @@ -164,6 +170,9 @@ module.exports = (_ => { _this = this; this.defaults = { + general: { + onlyShowOnShift: {value: false, description: "Only show the Details Tooltip, while holding 'Shift'"} + }, items: { icon: {value: true, description: "GUILD_CREATE_UPLOAD_ICON_LABEL"}, owner: {value: true, description: "GUILD_OWNER"}, @@ -239,6 +248,18 @@ module.exports = (_ => { children: _ => { let settingsItems = []; + settingsItems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.CollapseContainer, { + title: "Settings", + collapseStates: collapseStates, + children: Object.keys(this.defaults.general).map(key => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSaveItem, { + type: "Switch", + plugin: this, + keys: ["general", key], + label: this.defaults.general[key].description, + value: this.settings.general[key] + })) + })); + settingsItems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.CollapseContainer, { title: "Tooltip Items", collapseStates: collapseStates, @@ -334,7 +355,8 @@ module.exports = (_ => { list: true, offset: 12 }), - text: _ => BDFDB.ReactUtils.createElement(GuildDetailsComponent, { + text: (instance, event) => BDFDB.ReactUtils.createElement(GuildDetailsComponent, { + shiftKey: event.shiftKey, tooltipContainer: tooltipContainer, guild: e.instance.props.guild }) diff --git a/Themes/BasicBackground/BasicBackground.css b/Themes/BasicBackground/BasicBackground.css index f4b9b4f096..67bedd7cba 100644 --- a/Themes/BasicBackground/BasicBackground.css +++ b/Themes/BasicBackground/BasicBackground.css @@ -282,6 +282,9 @@ body::before { body::after { backdrop-filter: blur(var(--backgroundblur)); } +.layer-3QrUeG { + z-index: 1000; +} .container-16j22k::before, .layer-3QrUeG ~ .layer-3QrUeG::before, .root-3R2ngo::before, @@ -514,9 +517,11 @@ body::after { background-color: rgba(var(--transparencycolor), .2); } +.container-3O_wAf, .channelNotice-1-XFjC { /* notice container */ box-shadow: inset 0 -1px 0 rgba(var(--transparencycolor), .3); } +.container-3O_wAf, .channelNotice-1-XFjC.invite-OjTXrW, .channelNotice-1-XFjC.guildMFAWarning-3GEzs8, .channelNotice-1-XFjC.maxMembersCount-3E4zND, @@ -633,10 +638,11 @@ body::after { /* ---- 5.4. ACCOUNT/VOICE/GOLIVE ---- */ -.panels-j1Uci_ > * { /* account/voice inner */ +.panels-j1Uci_ > *, /* account/voice inner */ +.panels-j1Uci_ .wrapper-24pKcD > * { /* account/voice inner */ border: none; } -.panels-j1Uci_ > * + * { +.panels-j1Uci_ > *:not(:empty) + * { border-top: 1px solid rgba(var(--transparencycolor), .2); } @@ -2649,6 +2655,7 @@ img[src="/assets/cef02719c12d8aaf38894c16dca7fbe6.svg"] { /* rolesettings addr .icon-3_8HGa { /* rolesettings everyone role icon */ background-color: rgba(var(--transparencycolor), .4); } +.titleContainer-2CXtJo, /* rolesettings roles list header */ .header-2mZ9Ov { /* rolesettings perms list header */ background-color: transparent; }