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 {