From df8f09d528d3f89912260fe94fefc9d90259b28a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Z=20=E2=9D=A4=27s=20Life?= Date: Thu, 15 Jan 2026 10:58:46 -0500 Subject: [PATCH] cursorBuddy: feat - Use ColorPicker for Oneko Fur Color (#640) * cursorBuddy: feat - Use ColorPicker for Oneko Colors * fixes --------- Co-authored-by: thororen1234 <78185467+thororen1234@users.noreply.github.com> --- src/equicordplugins/cursorBuddy/index.tsx | 68 ++++++++++++++++++++++ src/equicordplugins/cursorBuddy/styles.css | 12 ++++ 2 files changed, 80 insertions(+) create mode 100644 src/equicordplugins/cursorBuddy/styles.css diff --git a/src/equicordplugins/cursorBuddy/index.tsx b/src/equicordplugins/cursorBuddy/index.tsx index 890abd41a..5de0a4e5e 100644 --- a/src/equicordplugins/cursorBuddy/index.tsx +++ b/src/equicordplugins/cursorBuddy/index.tsx @@ -4,18 +4,80 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ +import "./styles.css"; + import { isPluginEnabled } from "@api/PluginManager"; import { definePluginSettings, migratePluginSettings } from "@api/Settings"; import { Divider } from "@components/Divider"; import { Heading } from "@components/Heading"; import { Devs, EquicordDevs } from "@utils/constants"; +import { classNameFactory } from "@utils/css"; import definePlugin, { OptionType } from "@utils/types"; +import { ColorPicker } from "@webpack/common"; import fathorse from "./fathorse"; import oneko from "./oneko"; const ONEKO_IMAGE = "https://raw.githubusercontent.com/adryd325/oneko.js/5281d057c4ea9bd4f6f997ee96ba30491aed16c0/oneko.gif"; const FATASS_HORSE_IMAGE = "https://raw.githubusercontent.com/nexpid/fatass-horse/08bc4042750d5f995c55327f7b6c6710158f5263/sheet.png"; +const cl = classNameFactory("vc-cursor-buddy-"); + +function OnekoColorSettings() { + const { furColor, outlineColor } = settings.use(["furColor", "outlineColor"]); + + const parseHexToNumber = (hex: string): number | null => { + if (!hex || typeof hex !== "string") return null; + const cleanHex = hex.replace(/^#/, ""); + if (cleanHex.length !== 6) return null; + const num = parseInt(cleanHex, 16); + return isNaN(num) ? null : num; + }; + + const formatNumberToHex = (num: number | null): string => { + if (num === null) return "#FFFFFF"; + return "#" + num.toString(16).padStart(6, "0").toUpperCase(); + }; + + const handleFurColorChange = (value: number | null) => { + const hex = formatNumberToHex(value); + settings.store.furColor = hex; + load(); + }; + + const handleOutlineColorChange = (value: number | null) => { + const hex = formatNumberToHex(value); + settings.store.outlineColor = hex; + load(); + }; + + return ( +
+
+
+ Fur Color +
+ +
+
+ +
+ Outline Color +
+ +
+
+
+
+ ); +} const settings = definePluginSettings({ buddy: { @@ -58,17 +120,23 @@ const settings = definePluginSettings({ ), }, + onekoColorSettings: { + type: OptionType.COMPONENT, + component: OnekoColorSettings, + }, furColor: { description: "Fur hex color for Oneko", type: OptionType.STRING, default: "#FFFFFF", onChange: load, + hidden: true, }, outlineColor: { description: "Outline hex color for Oneko", type: OptionType.STRING, default: "#000000", onChange: load, + hidden: true, }, // Fatass Horse Specific fathorseSection: { diff --git a/src/equicordplugins/cursorBuddy/styles.css b/src/equicordplugins/cursorBuddy/styles.css new file mode 100644 index 000000000..17b6ad247 --- /dev/null +++ b/src/equicordplugins/cursorBuddy/styles.css @@ -0,0 +1,12 @@ +.vc-cursor-buddy-modal { + display: flex; + flex-direction: column; + gap: 15px; + margin-top: 10px; +} + +.vc-cursor-buddy-color { + display: flex; + align-items: center; + gap: 10px; +} \ No newline at end of file