diff --git a/Plugins/GameActivityToggle/GameActivityToggle.plugin.js b/Plugins/GameActivityToggle/GameActivityToggle.plugin.js index e03ed77d48..60903c0dee 100644 --- a/Plugins/GameActivityToggle/GameActivityToggle.plugin.js +++ b/Plugins/GameActivityToggle/GameActivityToggle.plugin.js @@ -2,7 +2,7 @@ * @name GameActivityToggle * @author DevilBro * @authorId 278543574059057154 - * @version 1.0.3 + * @version 1.0.4 * @description Adds a Quick-Toggle Game Activity Button * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -17,12 +17,12 @@ module.exports = (_ => { "info": { "name": "GameActivityToggle", "author": "DevilBro", - "version": "1.0.3", + "version": "1.0.4", "description": "Adds a Quick-Toggle Game Activity Button" }, "changeLog": { "improved": { - "Volume": "Now uses same Volume as Mute/Deafen Button" + "Cached State": "Now saves the state of your activity status, to avoid the activity status being turned off on each start of discord, this is an issue with Discord btw and not the plugin" } } }; @@ -92,7 +92,7 @@ module.exports = (_ => { })), onClick: _ => { _this.settings.general[!BDFDB.LibraryModules.SettingsStore.showCurrentGame ? "playEnable" : "playDisable"] && BDFDB.LibraryModules.SoundUtils.playSound(_this.settings.selections[!BDFDB.LibraryModules.SettingsStore.showCurrentGame ? "enableSound" : "disableSound"], .4); - BDFDB.LibraryModules.SettingsUtils.updateRemoteSettings({showCurrentGame: !BDFDB.LibraryModules.SettingsStore.showCurrentGame}) + BDFDB.LibraryModules.SettingsUtils.updateRemoteSettings({showCurrentGame: !BDFDB.LibraryModules.SettingsStore.showCurrentGame}); } })); } @@ -124,8 +124,19 @@ module.exports = (_ => { }; } - onStart () { - BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.SettingsUtils, "updateLocalSettings", {after: e => BDFDB.ReactUtils.forceUpdate(toggleButton)}); + onStart () { + let cachedState = BDFDB.DataUtils.load(this, "cachedState"); + if (!cachedState.date || (new Date() - cachedState.date) > 1000*60*60*24*3) { + cachedState.value = BDFDB.LibraryModules.SettingsStore.showCurrentGame; + cachedState.date = new Date(); + BDFDB.DataUtils.save(cachedState, this, "cachedState"); + } + else if (cachedState.value != null && cachedState.value != BDFDB.LibraryModules.SettingsStore.showCurrentGame) BDFDB.LibraryModules.SettingsUtils.updateRemoteSettings({showCurrentGame: cachedState.value}); + + BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.SettingsUtils, "updateLocalSettings", {after: e => { + BDFDB.ReactUtils.forceUpdate(toggleButton); + BDFDB.DataUtils.save({date: new Date(), value: BDFDB.LibraryModules.SettingsStore.showCurrentGame}, this, "cachedState"); + }}); BDFDB.PatchUtils.forceAllUpdates(this); } diff --git a/Plugins/StaffTag/README.md b/Plugins/StaffTag/README.md index b244ef274b..8c514f2fbe 100644 --- a/Plugins/StaffTag/README.md +++ b/Plugins/StaffTag/README.md @@ -29,4 +29,6 @@ Different Types: ![screenshot3](https://mwittrien.github.io/BetterDiscordAddons/Plugins/StaffTag/_res/screenshot3.png) -![screenshot4](https://mwittrien.github.io/BetterDiscordAddons/Plugins/StaffTag/_res/screenshot4.png) \ No newline at end of file +![screenshot4](https://mwittrien.github.io/BetterDiscordAddons/Plugins/StaffTag/_res/screenshot4.png) + +![screenshot5](https://mwittrien.github.io/BetterDiscordAddons/Plugins/StaffTag/_res/screenshot5.png) \ No newline at end of file diff --git a/Plugins/StaffTag/_res/screenshot5.png b/Plugins/StaffTag/_res/screenshot5.png new file mode 100644 index 0000000000..4efec9ab96 Binary files /dev/null and b/Plugins/StaffTag/_res/screenshot5.png differ