diff --git a/src/equicordplugins/wallpaperFree/components/util.tsx b/src/equicordplugins/wallpaperFree/components/util.tsx index 30c85dd9..763d8882 100644 --- a/src/equicordplugins/wallpaperFree/components/util.tsx +++ b/src/equicordplugins/wallpaperFree/components/util.tsx @@ -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; diff --git a/src/equicordplugins/wallpaperFree/index.tsx b/src/equicordplugins/wallpaperFree/index.tsx index a9d65c91..6424b7ca 100644 --- a/src/equicordplugins/wallpaperFree/index.tsx +++ b/src/equicordplugins/wallpaperFree/index.tsx @@ -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)/,