From 7a61b82c510e229271e097a6bd35b5925460def5 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 7 Mar 2026 04:28:04 +0000 Subject: [PATCH] feat: add portrait slot types and sprite-to-portrait folder mapping Co-Authored-By: Claude Opus 4.6 --- shared/src/constants.ts | 19 +++++++++++++++++++ shared/src/types.ts | 3 ++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/shared/src/constants.ts b/shared/src/constants.ts index 28cc41c..a0bfcc4 100644 --- a/shared/src/constants.ts +++ b/shared/src/constants.ts @@ -31,3 +31,22 @@ export const ACCESSORY_SLOTS = [ 'waist', 'back', 'facialHair', 'haircut', 'hat', ] as const; export type AccessorySlot = (typeof ACCESSORY_SLOTS)[number]; + +// Portrait-only slots (facial features for close-up portraits) +export const PORTRAIT_SLOTS = ['brows', 'eyes', 'mouths'] as const; +export type PortraitSlot = (typeof PORTRAIT_SLOTS)[number]; + +// Mapping from sprite accessory slot names to portrait folder names +// (some folders are pluralized in the portrait assets) +export const SPRITE_TO_PORTRAIT_FOLDER: Record = { + arm: 'arms', + back: 'back', + bottom: 'bottom', + chest: 'chest', + facialHair: 'facialHair', + // feet: no portrait equivalent + haircut: 'haircuts', + hat: 'hats', + shoulder: 'shoulders', + waist: 'waist', +}; diff --git a/shared/src/types.ts b/shared/src/types.ts index 418a325..aaf2be2 100644 --- a/shared/src/types.ts +++ b/shared/src/types.ts @@ -1,4 +1,4 @@ -import type { AccessorySlot } from './constants.js'; +import type { AccessorySlot, PortraitSlot } from './constants.js'; // Entity is just a numeric ID export type EntityId = number; @@ -17,6 +17,7 @@ export interface Velocity { export interface Appearance { skinId: string; // e.g. "shape00_skin02" accessories: Partial>; // slot -> filename without extension + portraitFeatures?: Partial>; // portrait-only facial features } export interface Needs {