"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 { // ocbwoy3 stupid idiot for using v3 api const details = (await ( await proxyFetch( `https://avatar.roblox.com/v1/outfits/${outfit.id}/details` ) ).json()) as { id: number; name: string; bodyColors: Record; scale: Record; }; const detailsV3 = (await ( await proxyFetch( `https://avatar.roblox.com/v3/outfits/${outfit.id}/details` ) ).json()) as { id: number; name: string; assets: any[]; 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/v1/avatar/set-wearing-assets`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ assetIds: detailsV3.assets.map((a) => a.id).filter(Boolean) }) } ); await proxyFetch( `https://avatar.roblox.com/v1/avatar/set-player-avatar-type`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ playerAvatarType: detailsV3.playerAvatarType }) } ); 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 ? robux.toLocaleString() : "???"}

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

{"ocbwoy3-chan's roblox"}

{/*

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

*/}
); });