mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-16 09:57:08 -04:00
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 3a38e02679
.
* 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>
This commit is contained in:
parent
d9381afaa2
commit
67d3d7da19
3 changed files with 16 additions and 14 deletions
|
@ -250,7 +250,7 @@ export default definePlugin({
|
||||||
|
|
||||||
customSettingsSections.push(ColorwaysSelector, ColorwaysSettings, ColorwaysSourceManager, ColorwaysOnDemand, ColorwaysStore);
|
customSettingsSections.push(ColorwaysSelector, ColorwaysSettings, ColorwaysSourceManager, ColorwaysOnDemand, ColorwaysStore);
|
||||||
|
|
||||||
addServerListElement(ServerListRenderPosition.In, this.ColorwaysButton);
|
addServerListElement(ServerListRenderPosition.Above, this.ColorwaysButton);
|
||||||
|
|
||||||
enableStyle(style);
|
enableStyle(style);
|
||||||
ColorwayCSS.set((await DataStore.get("activeColorwayObject") as ColorwayObject).css || "");
|
ColorwayCSS.set((await DataStore.get("activeColorwayObject") as ColorwayObject).css || "");
|
||||||
|
|
|
@ -16,17 +16,16 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import "./styles.css";
|
||||||
|
|
||||||
import { addServerListElement, removeServerListElement, ServerListRenderPosition } from "@api/ServerList";
|
import { addServerListElement, removeServerListElement, ServerListRenderPosition } from "@api/ServerList";
|
||||||
import { Settings } from "@api/Settings";
|
import { Settings } from "@api/Settings";
|
||||||
import { enableStyle } from "@api/Styles";
|
|
||||||
import ErrorBoundary from "@components/ErrorBoundary";
|
import ErrorBoundary from "@components/ErrorBoundary";
|
||||||
import { Devs, EquicordDevs } from "@utils/constants";
|
import { Devs, EquicordDevs } from "@utils/constants";
|
||||||
import { useForceUpdater } from "@utils/react";
|
import { useForceUpdater } from "@utils/react";
|
||||||
import definePlugin, { OptionType } from "@utils/types";
|
import definePlugin, { OptionType } from "@utils/types";
|
||||||
import { GuildStore, PresenceStore, RelationshipStore, Tooltip } from "@webpack/common";
|
import { GuildStore, PresenceStore, RelationshipStore, Tooltip } from "@webpack/common";
|
||||||
|
|
||||||
import style from "./styles.css?managed";
|
|
||||||
|
|
||||||
const enum IndicatorType {
|
const enum IndicatorType {
|
||||||
SERVER = 1 << 0,
|
SERVER = 1 << 0,
|
||||||
FRIEND = 1 << 1,
|
FRIEND = 1 << 1,
|
||||||
|
@ -128,15 +127,19 @@ export default definePlugin({
|
||||||
|
|
||||||
renderIndicator: () => {
|
renderIndicator: () => {
|
||||||
const { mode } = Settings.plugins.ServerListIndicators;
|
const { mode } = Settings.plugins.ServerListIndicators;
|
||||||
let text;
|
let text: string = `${onlineFriends} Friends, ${guildCount} Servers`;
|
||||||
|
switch (mode) {
|
||||||
if (!!(mode & IndicatorType.FRIEND) && !!(mode & IndicatorType.SERVER)) {
|
case (!!(mode & IndicatorType.FRIEND)):
|
||||||
text = `${onlineFriends} Friends, ${guildCount} Servers`;
|
text = `${onlineFriends} Friends`;
|
||||||
} else if (!!(mode & IndicatorType.FRIEND)) {
|
break;
|
||||||
text = `${onlineFriends} Friends`;
|
case (!!(mode & IndicatorType.SERVER)):
|
||||||
} else if (!!(mode & IndicatorType.SERVER)) {
|
text = `${guildCount} Servers`;
|
||||||
text = `${guildCount} Servers`;
|
break;
|
||||||
|
case (!!(mode & IndicatorType.FRIEND)) && (!!(mode & IndicatorType.SERVER)):
|
||||||
|
text = `${onlineFriends} Friends, ${guildCount} Servers`;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return <ErrorBoundary noop>
|
return <ErrorBoundary noop>
|
||||||
<div id="vc-indicators-container">
|
<div id="vc-indicators-container">
|
||||||
<Tooltip text={text} position="right">
|
<Tooltip text={text} position="right">
|
||||||
|
@ -163,7 +166,6 @@ export default definePlugin({
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
addServerListElement(ServerListRenderPosition.Above, this.renderIndicator);
|
addServerListElement(ServerListRenderPosition.Above, this.renderIndicator);
|
||||||
enableStyle(style);
|
|
||||||
handlePresenceUpdate();
|
handlePresenceUpdate();
|
||||||
handleGuildUpdate();
|
handleGuildUpdate();
|
||||||
},
|
},
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
#vc-serverlist-indicators:hover {
|
#vc-serverlist-indicators:hover {
|
||||||
border-radius: 34%;
|
border-radius: 34%;
|
||||||
background-color: var(--brand-500);
|
background-color: var(--brand-experiment);
|
||||||
}
|
}
|
||||||
|
|
||||||
#vc-serverlist-indicators::before {
|
#vc-serverlist-indicators::before {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue