fix: use configured furni source and catalog assets
This commit is contained in:
1 parent
aed70db81f
commit
c78f8812ad
25 files changed
+368
-129
No files matched your search
@@ -4,7 +4,7 @@ import {
|
||||
getGamedataRoot,
|
||||
getNitroFilesRoot,
|
||||
} from "@/lib/services/furni-asset-dirs";
|
||||
import type { HabboItFurniEntry } from "@/lib/services/habbo-furnidata-cache";
|
||||
import type { OfficialHabboFurniEntry } from "@/lib/services/habbo-furnidata-cache";
|
||||
import { siteSettings } from "@/lib/services/site-settings";
|
||||
import type { FurniMetadata } from "@/lib/services/swf-to-nitro";
|
||||
|
||||
@@ -150,7 +150,7 @@ export function buildFurniEntry(params: {
|
||||
spriteId: number;
|
||||
dims: { x: number; y: number; z: number };
|
||||
metadata: FurniMetadata | null;
|
||||
habboIt?: HabboItFurniEntry | null;
|
||||
officialHabbo?: OfficialHabboFurniEntry | null;
|
||||
}): Record<string, unknown> {
|
||||
const {
|
||||
id,
|
||||
@@ -162,20 +162,20 @@ export function buildFurniEntry(params: {
|
||||
spriteId,
|
||||
dims,
|
||||
metadata,
|
||||
habboIt,
|
||||
officialHabbo,
|
||||
} = params;
|
||||
|
||||
// Merge partcolors: prefer habbo.it (has real hex colors), fallback to .nitro extraction
|
||||
const partcolors = habboIt?.partcolors?.color?.length
|
||||
? habboIt.partcolors
|
||||
// Prefer the configured official hotel's real hex colors, then .nitro metadata.
|
||||
const partcolors = officialHabbo?.partcolors?.color?.length
|
||||
? officialHabbo.partcolors
|
||||
: (metadata?.partcolors ?? { color: [] });
|
||||
|
||||
return {
|
||||
id,
|
||||
classname,
|
||||
revision: revision || habboIt?.revision || 0,
|
||||
category: category || habboIt?.category || "unknown",
|
||||
defaultdir: metadata?.defaultdir ?? habboIt?.defaultdir ?? 0,
|
||||
revision: revision || officialHabbo?.revision || 0,
|
||||
category: category || officialHabbo?.category || "unknown",
|
||||
defaultdir: metadata?.defaultdir ?? officialHabbo?.defaultdir ?? 0,
|
||||
xdim: dims.x,
|
||||
ydim: dims.y,
|
||||
partcolors,
|
||||
@@ -183,19 +183,19 @@ export function buildFurniEntry(params: {
|
||||
description: description || "",
|
||||
adurl: "",
|
||||
offerid: spriteId,
|
||||
buyout: !!habboIt?.bc,
|
||||
buyout: !!officialHabbo?.bc,
|
||||
rentofferid: -1,
|
||||
rentbuyout: false,
|
||||
bc: habboIt?.bc ?? false,
|
||||
bc: officialHabbo?.bc ?? false,
|
||||
excludeddynamic: false,
|
||||
customparams: habboIt?.customparams ?? "",
|
||||
specialtype: metadata?.specialtype ?? habboIt?.specialtype ?? 0,
|
||||
canstandon: metadata?.canstandon ?? habboIt?.canstandon ?? false,
|
||||
cansiton: metadata?.cansiton ?? habboIt?.cansiton ?? false,
|
||||
canlayon: metadata?.canlayon ?? habboIt?.canlayon ?? false,
|
||||
furniline: habboIt?.furniline ?? "",
|
||||
environment: habboIt?.environment ?? "",
|
||||
rare: habboIt?.rare ?? false,
|
||||
customparams: officialHabbo?.customparams ?? "",
|
||||
specialtype: metadata?.specialtype ?? officialHabbo?.specialtype ?? 0,
|
||||
canstandon: metadata?.canstandon ?? officialHabbo?.canstandon ?? false,
|
||||
cansiton: metadata?.cansiton ?? officialHabbo?.cansiton ?? false,
|
||||
canlayon: metadata?.canlayon ?? officialHabbo?.canlayon ?? false,
|
||||
furniline: officialHabbo?.furniline ?? "",
|
||||
environment: officialHabbo?.environment ?? "",
|
||||
rare: officialHabbo?.rare ?? false,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user