2024-05-04 00:50:59 -04:00
|
|
|
/*
|
|
|
|
|
* Vencord, a Discord client mod
|
|
|
|
|
* Copyright (c) 2024 Vendicated and contributors
|
|
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
*/
|
|
|
|
|
|
2025-12-06 00:01:38 -05:00
|
|
|
import { ColorPaletteIcon } from "@components/Icons";
|
2026-01-14 18:42:33 -05:00
|
|
|
import SettingsPlugin, { settingsSectionMap } from "@plugins/_core/settings";
|
2024-10-10 20:05:41 -04:00
|
|
|
import { EquicordDevs } from "@utils/constants";
|
2024-10-10 20:02:24 -04:00
|
|
|
import definePlugin from "@utils/types";
|
2025-12-06 17:35:35 -05:00
|
|
|
import { openUserSettingsPanel } from "@webpack/common";
|
2024-10-10 20:02:24 -04:00
|
|
|
|
|
|
|
|
import { settings } from "./utils/settings";
|
|
|
|
|
|
|
|
|
|
export default definePlugin({
|
|
|
|
|
name: "ThemeLibrary",
|
|
|
|
|
description: "A library of themes for Vencord.",
|
2024-10-10 20:05:41 -04:00
|
|
|
authors: [EquicordDevs.Fafa],
|
2024-10-10 20:02:24 -04:00
|
|
|
settings,
|
|
|
|
|
toolboxActions: {
|
|
|
|
|
"Open Theme Library": () => {
|
2025-12-06 17:35:35 -05:00
|
|
|
openUserSettingsPanel("theme_library");
|
2024-10-10 20:02:24 -04:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
start() {
|
2025-12-06 19:34:36 -05:00
|
|
|
const { customEntries, customSections } = SettingsPlugin;
|
2024-10-10 20:02:24 -04:00
|
|
|
|
2025-12-06 19:34:36 -05:00
|
|
|
customEntries.push({
|
|
|
|
|
key: "equicord_theme_library",
|
2025-12-06 00:01:38 -05:00
|
|
|
title: "Theme Library",
|
|
|
|
|
Component: require("./components/ThemeTab").default,
|
|
|
|
|
Icon: ColorPaletteIcon
|
2025-01-03 04:32:13 +01:00
|
|
|
});
|
2025-12-06 19:34:36 -05:00
|
|
|
|
|
|
|
|
customSections.push(() => ({
|
|
|
|
|
section: "EquicordThemeLibrary",
|
|
|
|
|
label: "Theme Library",
|
|
|
|
|
searchableTitles: ["Theme Library"],
|
|
|
|
|
element: require("./components/ThemeTab").default,
|
|
|
|
|
id: "ThemeLibrary",
|
|
|
|
|
}));
|
2026-01-14 18:42:33 -05:00
|
|
|
|
|
|
|
|
settingsSectionMap.push(["EquicordThemeLibrary", "equicord_theme_library"]);
|
2024-10-10 20:02:24 -04:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
stop() {
|
2025-12-06 19:34:36 -05:00
|
|
|
const { customEntries, customSections } = SettingsPlugin;
|
|
|
|
|
const entry = customEntries.findIndex(entry => entry.key === "equicord_theme_library");
|
|
|
|
|
const section = customSections.findIndex(section => section({} as any).id === "ThemeLibrary");
|
|
|
|
|
if (entry !== -1) customEntries.splice(entry, 1);
|
|
|
|
|
if (section !== -1) customSections.splice(section, 1);
|
2024-10-10 20:02:24 -04:00
|
|
|
},
|
|
|
|
|
});
|