feat: auto interaction detection from real furniture data
Replace classname/name keyword guessing with real data so sit/lay/stand has zero false positives: - autoDetectInteraction() now accepts real flags (cansiton/canlayon/ canstandon), logicType, and animation-state count; real data wins and keywords are only a fallback when no real data exists. - New furni-real-interaction helper reads the local FurnitureData.json (highest-revision entries win; a true flag in any duplicate is kept) and falls back to the official Habbo furnidata. - interaction_modes_count now uses emulator conventions: dice=6, gate/teleport=2, roller=1, generic multistate = animation-state count, chairs/beds=1, plain items=0. - verifyAndFixInteractionModesCount only touches items with real data and skips everything else (no keyword overwrites). - parseNitroBundle falls back to gunzip for gzip-compressed .nitro files. - Wired through furni-import, upload-import, clone-import, and the nitro editor auto-detect button.
This commit is contained in:
1 parent
121dda7249
commit
3fa192a108
8 files changed
+626
-78
No files matched your search
@@ -15,6 +15,7 @@ import {
|
||||
IMPORTED_PAGE_CAPTION,
|
||||
IMPORTED_PAGE_CAPTION_SAVE,
|
||||
} from "@/lib/services/furni-import";
|
||||
import { nitroAnimationStatesCount } from "@/lib/services/furni-real-interaction";
|
||||
import { parseNitroBundle } from "@/lib/services/swf/nitro-builder";
|
||||
|
||||
export interface UploadResult {
|
||||
@@ -330,8 +331,15 @@ export async function uploadSingleFurni(params: {
|
||||
|
||||
const price = autoPriceFurni(classname);
|
||||
|
||||
// Auto-detect interaction modes count from classname/name
|
||||
const autoInteraction = autoDetectInteraction(classname, name);
|
||||
// Auto-detect interaction modes count. Real flags + .nitro animation
|
||||
// states win over keyword guessing — no false positives.
|
||||
const autoInteraction = autoDetectInteraction(classname, name, {
|
||||
cansiton,
|
||||
canlayon,
|
||||
canstandon,
|
||||
logicType: (nitroMeta?.logicType as string) || undefined,
|
||||
animationStates: nitroAnimationStatesCount(nitroMeta),
|
||||
});
|
||||
const interactionModesCount = autoInteraction.interactionModesCount;
|
||||
|
||||
let newId: number;
|
||||
|
||||
Reference in new issue
Block a user