Update 0BDFDB.plugin.js

This commit is contained in:
Mirco Wittrien 2021-12-29 14:44:27 +01:00 committed by GitHub
parent 2b83582223
commit ba5d9505b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 6 deletions

View File

@ -2,7 +2,7 @@
* @name BDFDB
* @author DevilBro
* @authorId 278543574059057154
* @version 2.0.3
* @version 2.0.4
* @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": "2.0.3",
"version": "2.0.4",
"description": "Required Library for DevilBro's Plugins"
},
"rawUrl": `https://mwittrien.github.io/BetterDiscordAddons/Library/0BDFDB.plugin.js`
@ -4297,12 +4297,17 @@ module.exports = (_ => {
return BDFDB.DiscordUtils.getSettings("messageDisplayCompact") ? "compact" : "cozy";
};
BDFDB.DiscordUtils.getSettings = function (key) {
if (!key || !LibraryModules.SettingsUtils || (!LibraryModules.SettingsUtils[key] && !LibraryModules.SettingsUtils[key + "DoNotUseYet"])) return null;
return (LibraryModules.SettingsUtils[key] || LibraryModules.SettingsUtils[key + "DoNotUseYet"]).getSetting();
if (!key) return null;
else if (LibraryModules.SettingsUtils && (LibraryModules.SettingsUtils[key] || LibraryModules.SettingsUtils[key + "DoNotUseYet"])) return (LibraryModules.SettingsUtils[key] || LibraryModules.SettingsUtils[key + "DoNotUseYet"]).getSetting();
else {
const value = BDFDB.LibraryModules.SettingsStore.getAllSettings()[key.slice(0, 1).toLowerCase() + key.slice(1)];
return value != undefined ? value: null;
}
};
BDFDB.DiscordUtils.setSettings = function (key, value) {
if (!key || !LibraryModules.SettingsUtils || (!LibraryModules.SettingsUtils[key] && !LibraryModules.SettingsUtils[key + "DoNotUseYet"])) return;
(LibraryModules.SettingsUtils[key] || LibraryModules.SettingsUtils[key + "DoNotUseYet"]).updateSetting(value);
if (!key) return;
else if (LibraryModules.SettingsUtils && (LibraryModules.SettingsUtils[key] || LibraryModules.SettingsUtils[key + "DoNotUseYet"])) (LibraryModules.SettingsUtils[key] || LibraryModules.SettingsUtils[key + "DoNotUseYet"]).updateSetting(value);
else BDFDB.LibraryModules.SettingsUtilsOld.updateRemoteSettings({[key.slice(0, 1).toLowerCase() + key.slice(1)]: value});
};
BDFDB.DiscordUtils.getZoomFactor = function () {
let aRects = BDFDB.DOMUtils.getRects(document.querySelector(BDFDB.dotCN.appmount));