Fixes minor bugs

This commit is contained in:
Zack Rauen 2021-02-22 17:53:21 -05:00
parent 99270038b3
commit f7771f4e4c
3 changed files with 17 additions and 23 deletions

View File

@ -145,6 +145,10 @@ These people have all subscribed to the `Bandager` tier on Patreon to support me
<img src="https://cdn.discordapp.com/attachments/769608503496278036/769680733693804625/tacoindustries.jpg" width="50px;" alt="Paco"/><br /> <img src="https://cdn.discordapp.com/attachments/769608503496278036/769680733693804625/tacoindustries.jpg" width="50px;" alt="Paco"/><br />
<strong>Paco</strong> <strong>Paco</strong>
</td> </td>
<td align="center">
<img src="https://cdn.discordapp.com/avatars/198801443279339520/4ae8e82ea9b136da4831ca6ac7c5082b.png" width="50px;" alt="Jordan"/><br />
<a href="https://reddit.com/r/kotlin" target="_blank" rel="noreferrer noopener"><strong>Jordan</strong></a>
</td>
</tr> </tr>
</table> </table>
@ -193,5 +197,9 @@ These people have either donated or subscribed to the most basic patron tier to
<img src="https://media.discordapp.net/attachments/575576868166828032/692136786893340752/pfp.gif" width="25px;" /><br /> <img src="https://media.discordapp.net/attachments/575576868166828032/692136786893340752/pfp.gif" width="25px;" /><br />
<strong>Akira</strong> <strong>Akira</strong>
</td> </td>
<td align="center">
<img src="https://i.pinimg.com/originals/07/c3/7d/07c37d854719dd633a11ff3f681d2019.jpg" width="25px;" /><br />
<strong>Pixel</strong>
</td>
</tr> </tr>
</table> </table>

View File

@ -20,7 +20,14 @@ const BdApi = {
get settings() {return Settings.collections;}, get settings() {return Settings.collections;},
get emotes() { get emotes() {
return new Proxy(Emotes.Emotes, { return new Proxy(Emotes.Emotes, {
get() {return Emotes.Emotes;}, get(category) {
const group = Emotes.Emotes[category];
if (!group) return undefined;
return new Proxy(group, {
get(emote) {return group[emote];},
set() {Logger.warn("BdApi.emotes", "Addon policy for plugins #5 https://github.com/rauenzi/BetterDiscordApp/wiki/Addon-Policies#plugins");}
});
},
set() {Logger.warn("BdApi.emotes", "Addon policy for plugins #5 https://github.com/rauenzi/BetterDiscordApp/wiki/Addon-Policies#plugins");} set() {Logger.warn("BdApi.emotes", "Addon policy for plugins #5 https://github.com/rauenzi/BetterDiscordApp/wiki/Addon-Policies#plugins");}
}); });
}, },
@ -231,27 +238,6 @@ BdApi.testJSON = function(data) {
return Utilities.testJSON(data); return Utilities.testJSON(data);
}; };
// Get another plugin
// name = name of plugin
BdApi.getPlugin = function (name) {
Logger.warn("BdApi", "getPlugin is deprecated. Please make use of the addon api (BdApi.Plugins)");
return PluginManager.addonList.find(a => a.name == name);
};
BdApi.isPluginEnabled = function(name) {
Logger.warn("BdApi", "isPluginEnabled is deprecated. Please make use of the addon api (BdApi.Plugins)");
const plugin = this.getPlugin(name);
if (!plugin) return false;
return PluginManager.isEnabled(plugin.id);
};
BdApi.isThemeEnabled = function(name) {
Logger.warn("BdApi", "isThemeEnabled is deprecated. Please make use of the addon api (BdApi.Themes)");
const theme = ThemeManager.addonList.find(a => a.name == name);
if (!theme) return false;
return ThemeManager.isEnabled(theme.id);
};
BdApi.isSettingEnabled = function(collection, category, id) { BdApi.isSettingEnabled = function(collection, category, id) {
return Settings.get(collection, category, id); return Settings.get(collection, category, id);
}; };

View File

@ -141,7 +141,7 @@ export default new class PluginManager extends AddonManager {
getPlugin(idOrFile) { getPlugin(idOrFile) {
const addon = this.addonList.find(c => c.id == idOrFile || c.filename == idOrFile); const addon = this.addonList.find(c => c.id == idOrFile || c.filename == idOrFile);
if (!addon) return; if (!addon) return;
return addon.instance; return addon;
} }
setupFunctions() { setupFunctions() {