"use client"; import { useRobuxBalance } from "@/hooks/roblox/useRobuxBalance"; import { RobuxIcon } from "../roblox/RobloxIcons"; import React, { useState } from "react"; import { ShirtIcon } from "lucide-react"; import { StupidHoverThing } from "../util/MiscStuff"; import { OutfitSelector } from "./OutfitQuickChooser"; import { proxyFetch } from "@/lib/utils"; import { loadThumbnails } from "@/lib/thumbnailLoader"; import Link from "next/link"; import { useFriendsHome } from "@/hooks/roblox/useFriends"; import { useBestFriends } from "@/hooks/roblox/useBestFriends"; import { useCurrentAccount } from "@/hooks/roblox/useCurrentAccount"; import { useFriendsPresence } from "@/hooks/roblox/usePresence"; async function updateOutfit(outfit: { id: number }, acc: { id: number }) { try { const details = (await ( await proxyFetch( `https://avatar.roblox.com/v1/outfits/${outfit.id}/details` ) ).json()) as { id: number; name: string; assets: Array<{ id: number; meta?: Record }>; bodyColors: Record; scale: Record; playerAvatarType: "R6" | "R15"; }; await proxyFetch( `https://avatar.roblox.com/v1/avatar/set-body-colors`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(details.bodyColors) } ); await proxyFetch(`https://avatar.roblox.com/v1/avatar/set-scales`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(details.scale) }); // u cant set avatar item scaling/rotation cuz roblox can't make good web apis await proxyFetch( `https://avatar.roblox.com/v2/avatar/set-wearing-assets`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ assets: details.assets .map((asset) => ({ id: asset.id, meta: asset.meta })) .filter((asset) => Boolean(asset.id)) }) } ); const avatarType = details.playerAvatarType === "R15" ? 3 : details.playerAvatarType === "R6" ? 1 : null; if (avatarType !== null) { await proxyFetch( `https://avatar.roblox.com/v1/avatar/set-player-avatar-type`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ playerAvatarType: avatarType }) } ); } await proxyFetch(`https://avatar.roblox.com/v1/avatar/redraw-thumbnail`, { method: "POST" }); loadThumbnails([ { type: "AvatarHeadShot", targetId: acc.id, format: "webp", size: "720x720" } ]).catch(() => {}); } catch (err) { console.error(err); } } export const QuickTopUI = React.memo(function () { const f = useFriendsHome(); const bf = useBestFriends(); useCurrentAccount(); useFriendsPresence([...(f ? f : []), ...(bf ? bf : [])].map((a) => a.id)); const robux = useRobuxBalance(); const [isOutfitSelectorVisible, setIsOutfitSelectorVisible] = useState(false); return ( <> {isOutfitSelectorVisible ? ( ) : ( <> )}

{robux ? robux.toLocaleString() : "..."}

); }); export const QuickTopUILogoPart = React.memo(function () { return (

{"Roblox"}

{/*

{process.env.NODE_ENV} {process.env.NEXT_PUBLIC_CWD}{" "} {process.env.NEXT_PUBLIC_ARGV0}

*/}
); });