diff --git a/src/equicordplugins/recentDMSwitcher/index.tsx b/src/equicordplugins/recentDMSwitcher/index.tsx index 23a3f62e6..4155889c1 100644 --- a/src/equicordplugins/recentDMSwitcher/index.tsx +++ b/src/equicordplugins/recentDMSwitcher/index.tsx @@ -11,11 +11,10 @@ import { definePluginSettings } from "@api/Settings"; import { classNameFactory } from "@api/Styles"; import { EquicordDevs, IS_MAC } from "@utils/constants"; import { closeModal, openModal } from "@utils/modal"; -import definePlugin, { OptionType } from "@utils/types"; +import definePlugin, { makeRange, OptionType } from "@utils/types"; import { Button, ChannelRouter, ChannelStore, IconUtils, React, RelationshipStore, SelectedChannelStore, Toasts, UserStore } from "@webpack/common"; const STORAGE_KEY = "RDMSwitch_history"; -const MAX_HISTORY = 50; let rmdsDmChannelIds: string[] = []; let isCyclingSessionActive = false; @@ -43,6 +42,13 @@ const settings = definePluginSettings({ { label: "Current only", value: "current" } ] }, + amountOfUsers: { + type: OptionType.SLIDER, + description: "Number of users to show in overlay", + markers: makeRange(10, 50, 10), + stickToMarkers: true, + default: 20, + }, overlayRowLength: { type: OptionType.SLIDER, description: "Number of recent DMs to show in row", @@ -99,7 +105,7 @@ function isDirectMessageChannel(channelId: string | null | undefined): boolean { function pushChannelToFront(channelId: string) { rmdsDmChannelIds = rmdsDmChannelIds.filter(id => id !== channelId); rmdsDmChannelIds.unshift(channelId); - if (rmdsDmChannelIds.length > MAX_HISTORY) rmdsDmChannelIds.length = MAX_HISTORY; + if (rmdsDmChannelIds.length > settings.store.amountOfUsers) rmdsDmChannelIds.length = settings.store.amountOfUsers; void DataStore.set(STORAGE_KEY, rmdsDmChannelIds); } @@ -112,7 +118,7 @@ function sanitizeHistory(ids: string[]): string[] { if (!isDirectMessageChannel(id)) continue; seen.add(id); result.push(id); - if (result.length >= MAX_HISTORY) break; + if (result.length >= settings.store.amountOfUsers) break; } return result; } @@ -244,15 +250,14 @@ function OverlayContent(): any { const maxCount = Math.max(3, Math.min(7, settings.store.overlayRowLength)); const pageSize = mode === "current" ? 1 : maxCount; - const totalSlots = mode === "current" ? 1 : pageSize * 2; const visibleList = mode === "current" ? [cycleSnapshot[cycleIndex]] - : cycleSnapshot.slice(0, totalSlots); + : cycleSnapshot; let pageCount = 1; let currentPage = 0; if (mode !== "current") { - pageCount = visibleList.length > pageSize ? 2 : 1; + pageCount = Math.ceil(visibleList.length / pageSize); currentPage = Math.min(pageCount - 1, Math.floor((cycleIndex >= 0 ? cycleIndex : 0) / pageSize)); } diff --git a/src/equicordplugins/statusWhileActive.desktop/README.md b/src/equicordplugins/statusWhileActive.desktop/README.md index bebfbd8e2..f8f7ded8b 100644 --- a/src/equicordplugins/statusWhileActive.desktop/README.md +++ b/src/equicordplugins/statusWhileActive.desktop/README.md @@ -1,5 +1,5 @@ # StatusWhileActive -This plugin automatically updates your online status when playing games or joining a voice channel. +This plugin automatically updates your online status when joining a voice channel. -It will change your status back to the prior status when the activity is stopped. \ No newline at end of file +It will change your status back to the prior status when the activity is stopped. diff --git a/src/equicordplugins/statusWhileActive.desktop/index.ts b/src/equicordplugins/statusWhileActive.desktop/index.ts index e58e3596e..9d950e4b7 100644 --- a/src/equicordplugins/statusWhileActive.desktop/index.ts +++ b/src/equicordplugins/statusWhileActive.desktop/index.ts @@ -18,7 +18,7 @@ const StatusSettings = getUserSettingLazy("status", "status")!; const settings = definePluginSettings({ statusToSet: { type: OptionType.SELECT, - description: "Status to set while playing a game", + description: "Status to set while in a voice channel.", options: [ { label: "Online",