feat: add portrait slot types and sprite-to-portrait folder mapping
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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<string, string> = {
|
||||
arm: 'arms',
|
||||
back: 'back',
|
||||
bottom: 'bottom',
|
||||
chest: 'chest',
|
||||
facialHair: 'facialHair',
|
||||
// feet: no portrait equivalent
|
||||
haircut: 'haircuts',
|
||||
hat: 'hats',
|
||||
shoulder: 'shoulders',
|
||||
waist: 'waist',
|
||||
};
|
||||
|
||||
+2
-1
@@ -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<Record<AccessorySlot, string>>; // slot -> filename without extension
|
||||
portraitFeatures?: Partial<Record<PortraitSlot, string>>; // portrait-only facial features
|
||||
}
|
||||
|
||||
export interface Needs {
|
||||
|
||||
Reference in New Issue
Block a user