Update WallpaperFree
Some checks failed
Release / Build Equicord (push) Has been cancelled
Test / Test (push) Has been cancelled

This commit is contained in:
thororen1234 2025-05-20 08:13:56 -04:00
parent 8e01e87868
commit d5187a752b
No known key found for this signature in database
2 changed files with 20 additions and 4 deletions

View file

@ -5,8 +5,9 @@
*/
import { openModal } from "@utils/modal";
import { makeCodeblock } from "@utils/text";
import { findByCodeLazy, findStoreLazy } from "@webpack";
import { Button, FluxDispatcher } from "@webpack/common";
import { Button, FluxDispatcher, Parser } from "@webpack/common";
import { SetCustomWallpaperModal, SetDiscordWallpaperModal } from "./modal";
@ -49,6 +50,16 @@ export function GlobalDefaultComponent() {
);
}
export function TipsComponent() {
const tipText = `
[class^=wallpaperContainer] {
transform: scaleX(-1); /* flip it horizontally */
filter: blur(4px); /* apply a blur */
opacity: 0.7; /* self-explanatory */
}`;
return Parser.parse(makeCodeblock(tipText, "css"));
}
export interface Wallpaper {
id: string;
label: string;

View file

@ -13,7 +13,7 @@ import { useStateFromStores } from "@webpack/common";
import { Channel } from "discord-types/general";
import { ChannelContextPatch, GuildContextPatch, UserContextPatch } from "./components/ctxmenu";
import { GlobalDefaultComponent, Wallpaper } from "./components/util";
import { GlobalDefaultComponent, TipsComponent, Wallpaper } from "./components/util";
import { WallpaperFreeStore } from "./store";
@ -23,6 +23,11 @@ const settings = definePluginSettings({
type: OptionType.BOOLEAN,
default: false,
},
stylingTips: {
description: "",
type: OptionType.COMPONENT,
component: TipsComponent,
},
globalDefault: {
description: "Set a global default wallpaper for all channels.",
type: OptionType.COMPONENT,
@ -48,8 +53,8 @@ export default definePlugin({
replace: "$&vcWpFreeCustom||"
},
{
match: /(\i=).{0,25}\.asset\):null/,
replace: "$1arguments[0].chatWallpaperState.vcWallpaperUrl"
match: /(\i)=(.{1,50}asset.+?(?=,\i=))(?=.+?concat\(\1)/,
replace: "$1=arguments[0].chatWallpaperState.vcWallpaperUrl||($2)"
},
{
match: /(\i\.isViewable&&)(null!=\i)/,