feat: synthesize size 32 (catalog icon) frame for all furniture .nitro bundles
CI / check (push) Successful in 35s
CI / release (push) Skipped
CI / deploy (push) Successful in 1m18s

AddSize32ToBundle downscales the largest existing sprite (usually size 64)
to generate a 32 visualization, so every bundle — including the
source-provided gamedata furniture — carries a 32 frame without needing the
original SWF. AddSize32AllNitros rewrites every existing .nitro across all
nitro directories (incl. /var/www/Gamedata/bundled/furniture) and is
idempotent (bundles that already have 32 are skipped). Expose it via a Studio
button and the background admin endpoint POST /api/admin/import/furni/add-size32.
This commit is contained in:
openhands committed 2026-08-22 13:31:50 +02:00
1 parent 2996ae3ab0
commit ac7c427c3d
4 files changed
+668 -1

No files matched your search

@@ -12,6 +12,7 @@ import {
FileWarning,
FolderSync,
Globe2,
ImageDown,
LayoutGrid,
List,
Loader2,
@@ -147,6 +148,7 @@ export function ImportFurniClient({ source }: { source: FurniImportSource }) {
const [recentResyncResult, setRecentResyncResult] =
useState<RecentFurniResyncResult | null>(null);
const [verifyingInteractions, setVerifyingInteractions] = useState(false);
const [addingSize32, setAddingSize32] = useState(false);
const [verifyResult, setVerifyResult] =
useState<VerifyInteractionsResult | null>(null);
const searchRef = useRef<HTMLInputElement>(null);
@@ -775,6 +777,38 @@ export function ImportFurniClient({ source }: { source: FurniImportSource }) {
}
}
async function addSize32All() {
if (
!confirm(
"Add a size-32 visualization to every existing .nitro that lacks one? This rewrites the live furniture bundles (incl. /var/www/Gamedata) and can take a while.",
)
) {
return;
}
setAddingSize32(true);
try {
const res = await adminFetch("/api/admin/import/furni/add-size32", {
method: "POST",
});
const d = await res.json();
if (res.ok) {
toast.success(
d.alreadyRunning
? "Size-32 conversion is already running in the background"
: "Started size-32 conversion in the background — watch the server log for progress",
);
} else {
toast.error(d.error || "Failed to start size-32 conversion");
}
} catch (error) {
toast.error(
error instanceof Error ? error.message : "Size-32 conversion failed",
);
} finally {
setAddingSize32(false);
}
}
async function applyReorganize() {
setReorgPreview(null);
setReorganizing(true);
@@ -1551,6 +1585,10 @@ export function ImportFurniClient({ source }: { source: FurniImportSource }) {
<FolderSync className="w-4 h-4 mr-2" />
{reorganizing ? "Reorganizing..." : "Reorganize Catalog"}
</DropdownMenuItem>
<DropdownMenuItem onClick={addSize32All} disabled={addingSize32}>
<ImageDown className="w-4 h-4 mr-2" />
{addingSize32 ? "Adding size 32..." : "Add size 32 to all .nitro"}
</DropdownMenuItem>
<DropdownMenuItem
onClick={verifyAllInteractions}
disabled={verifyingInteractions}