From 67d3d7da19c0101ab48577441231e49d0744a0be Mon Sep 17 00:00:00 2001 From: pan <93918332+Panniku@users.noreply.github.com> Date: Tue, 16 Jul 2024 20:28:45 +0530 Subject: [PATCH] QoL: DiscordColorways Above Serverlist * feat(ServerListIndicator) add ids for css * feat: consistency * feat(SpotifyControls): dummy color control * fix: resolve merge * Revert "feat(SpotifyControls): dummy color control" This reverts commit 3a38e026790914dda3dfcafbec2111339ed8bc96. * fix(ServerListIndicators): tooltip changes on mode * fix(SpotifyControls): copy paste from source to sync * fix: edit DiscordColorways to ServerListRenderPosition.Above * Update index.tsx --------- Co-authored-by: thororen <78185467+thororen1234@users.noreply.github.com> --- .../discordColorways/index.tsx | 2 +- src/plugins/serverListIndicators/index.tsx | 26 ++++++++++--------- src/plugins/serverListIndicators/styles.css | 2 +- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/equicordplugins/discordColorways/index.tsx b/src/equicordplugins/discordColorways/index.tsx index ea243e9f..25bda89d 100644 --- a/src/equicordplugins/discordColorways/index.tsx +++ b/src/equicordplugins/discordColorways/index.tsx @@ -250,7 +250,7 @@ export default definePlugin({ customSettingsSections.push(ColorwaysSelector, ColorwaysSettings, ColorwaysSourceManager, ColorwaysOnDemand, ColorwaysStore); - addServerListElement(ServerListRenderPosition.In, this.ColorwaysButton); + addServerListElement(ServerListRenderPosition.Above, this.ColorwaysButton); enableStyle(style); ColorwayCSS.set((await DataStore.get("activeColorwayObject") as ColorwayObject).css || ""); diff --git a/src/plugins/serverListIndicators/index.tsx b/src/plugins/serverListIndicators/index.tsx index 50125e69..de16f944 100644 --- a/src/plugins/serverListIndicators/index.tsx +++ b/src/plugins/serverListIndicators/index.tsx @@ -16,17 +16,16 @@ * along with this program. If not, see . */ +import "./styles.css"; + import { addServerListElement, removeServerListElement, ServerListRenderPosition } from "@api/ServerList"; import { Settings } from "@api/Settings"; -import { enableStyle } from "@api/Styles"; import ErrorBoundary from "@components/ErrorBoundary"; import { Devs, EquicordDevs } from "@utils/constants"; import { useForceUpdater } from "@utils/react"; import definePlugin, { OptionType } from "@utils/types"; import { GuildStore, PresenceStore, RelationshipStore, Tooltip } from "@webpack/common"; -import style from "./styles.css?managed"; - const enum IndicatorType { SERVER = 1 << 0, FRIEND = 1 << 1, @@ -128,15 +127,19 @@ export default definePlugin({ renderIndicator: () => { const { mode } = Settings.plugins.ServerListIndicators; - let text; - - if (!!(mode & IndicatorType.FRIEND) && !!(mode & IndicatorType.SERVER)) { - text = `${onlineFriends} Friends, ${guildCount} Servers`; - } else if (!!(mode & IndicatorType.FRIEND)) { - text = `${onlineFriends} Friends`; - } else if (!!(mode & IndicatorType.SERVER)) { - text = `${guildCount} Servers`; + let text: string = `${onlineFriends} Friends, ${guildCount} Servers`; + switch (mode) { + case (!!(mode & IndicatorType.FRIEND)): + text = `${onlineFriends} Friends`; + break; + case (!!(mode & IndicatorType.SERVER)): + text = `${guildCount} Servers`; + break; + case (!!(mode & IndicatorType.FRIEND)) && (!!(mode & IndicatorType.SERVER)): + text = `${onlineFriends} Friends, ${guildCount} Servers`; + break; } + return
@@ -163,7 +166,6 @@ export default definePlugin({ start() { addServerListElement(ServerListRenderPosition.Above, this.renderIndicator); - enableStyle(style); handlePresenceUpdate(); handleGuildUpdate(); }, diff --git a/src/plugins/serverListIndicators/styles.css b/src/plugins/serverListIndicators/styles.css index 1fb95a0b..5327524b 100644 --- a/src/plugins/serverListIndicators/styles.css +++ b/src/plugins/serverListIndicators/styles.css @@ -20,7 +20,7 @@ #vc-serverlist-indicators:hover { border-radius: 34%; - background-color: var(--brand-500); + background-color: var(--brand-experiment); } #vc-serverlist-indicators::before {