From ef5abb863aa36165badc94ec6c85ab9c8d653b30 Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Tue, 13 Apr 2021 16:30:51 +0200 Subject: [PATCH] stuff --- Library/_res/BDFDB.data.json | 5 ++++- .../CustomStatusPresets.plugin.js | 18 +++++++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/Library/_res/BDFDB.data.json b/Library/_res/BDFDB.data.json index dafd2fc9d0..657dcd422b 100644 --- a/Library/_res/BDFDB.data.json +++ b/Library/_res/BDFDB.data.json @@ -314,6 +314,7 @@ "Scrollers None": {"props": ["AdvancedScrollerThin", "AdvancedScrollerAuto"], "value": "AdvancedScrollerNone"}, "Scrollers Thin": {"props": ["AdvancedScrollerThin", "AdvancedScrollerAuto"], "value": "AdvancedScrollerThin"}, "Spinner": {"name": "Spinner"}, + "Status": {"name": "Status"}, "StatusPickerPopout": {"strings": ["\"StatusPickerPopout\""], "value": "default"}, "TextElement": {"name": "Text"}, "UserPopout": {"name": "ConnectedUserPopout"}, @@ -767,7 +768,8 @@ "deleteIcon": "deleteIcon-22SgHa", "dragPreview": "dragPreview-3F0ssT", "sortableCard": "sortableCard-oF6sTT", - "sortDivider": "sortDivider-d8SzzU" + "sortDivider": "sortDivider-d8SzzU", + "status": "status-0f5Sr2" }, "DisplayServersAsChannels": { "badge": "badge-fxFrUP", @@ -1274,6 +1276,7 @@ "_customstatuspresetsdragpreview": ["CustomStatusPresets", "dragPreview"], "_customstatuspresetssortablecard": ["CustomStatusPresets", "sortableCard"], "_customstatuspresetssortdivider": ["CustomStatusPresets", "sortDivider"], + "_customstatuspresetsstatus": ["CustomStatusPresets", "status"], "_displayserversaschannelsbadge": ["DisplayServersAsChannels", "badge"], "_displayserversaschannelsname": ["DisplayServersAsChannels", "name"], "_displayserversaschannelsstyled": ["DisplayServersAsChannels", "styled"], diff --git a/Plugins/CustomStatusPresets/CustomStatusPresets.plugin.js b/Plugins/CustomStatusPresets/CustomStatusPresets.plugin.js index 3e65e2f51d..df368c70a2 100644 --- a/Plugins/CustomStatusPresets/CustomStatusPresets.plugin.js +++ b/Plugins/CustomStatusPresets/CustomStatusPresets.plugin.js @@ -2,7 +2,7 @@ * @name CustomStatusPresets * @author DevilBro * @authorId 278543574059057154 - * @version 1.0.5 + * @version 1.0.6 * @description Allows you to save Custom Statuses as Quick Select * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -17,12 +17,12 @@ module.exports = (_ => { "info": { "name": "CustomStatusPresets", "author": "DevilBro", - "version": "1.0.5", + "version": "1.0.6", "description": "Allows you to save Custom Statuses as Quick Select" }, "changeLog": { - "improved": { - "Settings": "You can now reorder the presets in the plugin settings and 'disable' them which stops them from showing in the quick menu" + "added": { + "Online Status": "The online status now also gets saved in the preset" } } }; @@ -282,6 +282,9 @@ module.exports = (_ => { display: flex; margin-right: 6px; } + ${BDFDB.dotCN._customstatuspresetsstatus} { + margin-right: 6px; + } ${BDFDB.dotCN._customstatuspresetssortdivider} { background: ${BDFDB.DiscordConstants.Colors.STATUS_GREEN}; height: 2px; @@ -360,6 +363,10 @@ module.exports = (_ => { }) }) }), + BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Status, { + className: BDFDB.disCN._customstatuspresetsstatus, + status: presets[id].status || BDFDB.DiscordConstants.StatusTypes.ONLINE + }), presets[id].text ] }), @@ -373,6 +380,7 @@ module.exports = (_ => { expiresAt = new Date(date.getFullYear(), date.getMonth(), date.getDate() + 1).getTime() - date.getTime(); } BDFDB.LibraryModules.SettingsUtils.updateRemoteSettings({ + status: presets[id].status, customStatus: { text: presets[id].text && presets[id].text.length > 0 ? presets[id].text : null, expiresAt: expiresAt ? BDFDB.DiscordObjects.Timestamp().add(expiresAt, "ms").toISOString() : null, @@ -394,7 +402,7 @@ module.exports = (_ => { color: BDFDB.disCN.modalcancelbutton, look: BDFDB.LibraryComponents.Button.Looks.LINK, onClick: event => { - presets[id] = Object.assign({pos: Object.keys(presets).length}, BDFDB.ObjectUtils.extract(e.instance.state, "clearAfter", "emojiInfo", "text")); + presets[id] = Object.assign({pos: Object.keys(presets).length}, BDFDB.ObjectUtils.extract(e.instance.state, "clearAfter", "emojiInfo", "status", "text")); BDFDB.DataUtils.save(presets, this, "presets"); if (!event.shiftKey) e.instance.props.onClose(); else id = BDFDB.NumberUtils.generateId(Object.keys(presets));