mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-09 14:43:03 -04:00
Fixes
This commit is contained in:
parent
ca157b33f7
commit
11dc0e9ea6
6 changed files with 23 additions and 35 deletions
|
@ -11,7 +11,7 @@ You can join our [discord server](https://discord.gg/5Xh2W87egW) for commits, ch
|
||||||
### Extra included plugins
|
### Extra included plugins
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>182 additional plugins</summary>
|
<summary>183 additional plugins</summary>
|
||||||
|
|
||||||
### All Platforms
|
### All Platforms
|
||||||
|
|
||||||
|
@ -41,6 +41,7 @@ You can join our [discord server](https://discord.gg/5Xh2W87egW) for commits, ch
|
||||||
- CommandPalette by Ethan
|
- CommandPalette by Ethan
|
||||||
- CopyStickerLinks by Byeoon
|
- CopyStickerLinks by Byeoon
|
||||||
- CopyUserMention by Cortex & castdrian
|
- CopyUserMention by Cortex & castdrian
|
||||||
|
- CustomFolderIcons by sadan
|
||||||
- CustomSounds by TheKodeToad & SpikeHD
|
- CustomSounds by TheKodeToad & SpikeHD
|
||||||
- CustomTimestamps by Rini & nvhrr
|
- CustomTimestamps by Rini & nvhrr
|
||||||
- CustomUserColors by mochienya
|
- CustomUserColors by mochienya
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
# CustomFolderIcons
|
|
||||||
|
|
||||||
Allows you to set custom images/svgs as folder icons
|
|
||||||
|
|
||||||
Available as "Change Icon" in the folder context menu
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
import { closeModal, ModalContent, ModalHeader, ModalRoot, openModalLazy } from "@utils/modal";
|
import { closeModal, ModalContent, ModalHeader, ModalRoot, openModalLazy } from "@utils/modal";
|
||||||
import { Button, Menu, Slider, TextInput, useState } from "@webpack/common";
|
import { Button, Menu, Slider, TextInput, useState } from "@webpack/common";
|
||||||
|
|
||||||
import settings, { folderIconsData } from "./settings";
|
import { folderIconsData, settings } from "./settings";
|
||||||
import { folderProp, int2rgba, setFolderData } from "./util";
|
import { folderProp, int2rgba, setFolderData } from "./util";
|
||||||
|
|
||||||
export function ImageModal(folderProps: folderProp) {
|
export function ImageModal(folderProps: folderProp) {
|
||||||
|
@ -81,7 +81,7 @@ export function RenderPreview({ folderProps, url, size }: { folderProps: folderP
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
alignItems: "center"
|
alignItems: "center"
|
||||||
}}>
|
}}>
|
||||||
<img src={url} width={`${size}%`} height={`${size}%`} />
|
<img alt="" src={url} width={`${size}%`} height={`${size}%`} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -93,18 +93,18 @@ export function makeContextItem(a: folderProp) {
|
||||||
key="custom-folder-icons"
|
key="custom-folder-icons"
|
||||||
label="Change Icon"
|
label="Change Icon"
|
||||||
action={() => {
|
action={() => {
|
||||||
openModalLazy(async() => {
|
openModalLazy(async () => {
|
||||||
return props => (
|
return props => (
|
||||||
<ModalRoot {...props}>
|
<ModalRoot {...props}>
|
||||||
<ModalHeader >
|
<ModalHeader >
|
||||||
<div style={{
|
<div style={{
|
||||||
color: "white"
|
color: "white"
|
||||||
}}>
|
}}>
|
||||||
Set a New Icon.
|
Set a New Icon.
|
||||||
</div>
|
</div>
|
||||||
</ModalHeader>
|
</ModalHeader>
|
||||||
<ModalContent>
|
<ModalContent>
|
||||||
<ImageModal folderId={a.folderId} folderColor={a.folderColor}/>
|
<ImageModal folderId={a.folderId} folderColor={a.folderColor} />
|
||||||
</ModalContent>
|
</ModalContent>
|
||||||
<div style={{
|
<div style={{
|
||||||
color: "white",
|
color: "white",
|
||||||
|
@ -116,9 +116,9 @@ export function makeContextItem(a: folderProp) {
|
||||||
</ModalRoot>
|
</ModalRoot>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
modalKey: "custom-folder-icon"
|
modalKey: "custom-folder-icon"
|
||||||
});
|
});
|
||||||
}}/>
|
}} />
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,14 +8,14 @@ import { EquicordDevs } from "@utils/constants";
|
||||||
import definePlugin from "@utils/types";
|
import definePlugin from "@utils/types";
|
||||||
|
|
||||||
import { makeContextItem } from "./components";
|
import { makeContextItem } from "./components";
|
||||||
import settings, { folderIconsData } from "./settings";
|
import { folderIconsData, settings } from "./settings";
|
||||||
import { folderProp, int2rgba } from "./util";
|
import { folderProp, int2rgba } from "./util";
|
||||||
|
|
||||||
export default definePlugin({
|
export default definePlugin({
|
||||||
settings,
|
|
||||||
name: "CustomFolderIcons",
|
name: "CustomFolderIcons",
|
||||||
description: "Customize folder icons with any png",
|
description: "Customize folder icons with any png",
|
||||||
authors: [EquicordDevs.sadan],
|
authors: [EquicordDevs.sadan],
|
||||||
|
settings,
|
||||||
patches: [
|
patches: [
|
||||||
{
|
{
|
||||||
find: ".folderButtonInner",
|
find: ".folderButtonInner",
|
||||||
|
@ -49,7 +49,7 @@ export default definePlugin({
|
||||||
height: "100%"
|
height: "100%"
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<img src={data!.url} width={`${data!.size ?? 100}%`} height={`${data!.size ?? 100}%`}
|
<img alt="" src={data!.url} width={`${data!.size ?? 100}%`} height={`${data!.size ?? 100}%`}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -7,13 +7,13 @@
|
||||||
import { definePluginSettings } from "@api/Settings";
|
import { definePluginSettings } from "@api/Settings";
|
||||||
import { OptionType } from "@utils/types";
|
import { OptionType } from "@utils/types";
|
||||||
|
|
||||||
export interface folderIcon{
|
export interface folderIcon {
|
||||||
url: string,
|
url: string,
|
||||||
size: number,
|
size: number,
|
||||||
}
|
}
|
||||||
export type folderIconsData = Record<string, folderIcon | null>;
|
export type folderIconsData = Record<string, folderIcon | null>;
|
||||||
|
|
||||||
const settings = definePluginSettings({
|
export const settings = definePluginSettings({
|
||||||
solidIcon: {
|
solidIcon: {
|
||||||
type: OptionType.BOOLEAN,
|
type: OptionType.BOOLEAN,
|
||||||
default: false,
|
default: false,
|
||||||
|
@ -26,4 +26,3 @@ const settings = definePluginSettings({
|
||||||
component: () => <></>
|
component: () => <></>
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
export default settings;
|
|
||||||
|
|
|
@ -4,23 +4,25 @@
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import settings, { folderIcon, folderIconsData } from "./settings";
|
import { folderIcon, folderIconsData, settings } from "./settings";
|
||||||
|
|
||||||
export async function setFolderData(props: folderProp, newData: folderIcon) {
|
export async function setFolderData(props: folderProp, newData: folderIcon) {
|
||||||
if (!settings.store.folderIcons){
|
if (!settings.store.folderIcons) {
|
||||||
settings.store.folderIcons = {};
|
settings.store.folderIcons = {};
|
||||||
}
|
}
|
||||||
const folderSettings = (settings.store.folderIcons as folderIconsData);
|
const folderSettings = (settings.store.folderIcons as folderIconsData);
|
||||||
folderSettings[props.folderId] = newData;
|
folderSettings[props.folderId] = newData;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface folderProp {
|
export interface folderProp {
|
||||||
folderId: string;
|
folderId: string;
|
||||||
folderColor: number;
|
folderColor: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param rgbVal RGB value
|
* @param rgbVal RGB value
|
||||||
* @param alpha alpha bewteen zero and 1
|
* @param alpha alpha bewteen zero and 1
|
||||||
*/
|
*/
|
||||||
export function int2rgba(rgbVal: number, alpha: number = 1) {
|
export function int2rgba(rgbVal: number, alpha: number = 1) {
|
||||||
const b = rgbVal & 0xFF,
|
const b = rgbVal & 0xFF,
|
||||||
g = (rgbVal & 0xFF00) >>> 8,
|
g = (rgbVal & 0xFF00) >>> 8,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue