UNPKG

xverse-components-character-creator

Version:

xverse components character-creator

59 lines (58 loc) 7.02 kB
import { IAvatarComponent } from '@xverse/core'; import { BaseAvatar } from 'xverse-components-avatar'; import { SliderListType } from './config'; import { IUserHttpOption } from './api'; /*** * 处理用户存储的装扮及脸部数据更新到角色上 * **说明: 在avatar loaded时处理** * @param avatar * @param userHttpOption * @param isFromCloud 是否从后台读取数据 */ export declare const changeToSavedDressUp: (avatar: BaseAvatar, userHttpOption: IUserHttpOption, isFromCloud?: boolean) => Promise<void>; /** * 获取用户存储的装扮信息 * @param worldId * @param appId * @param userId * @param isUserFromAndSaveToCloud * @returns */ export declare const getSavedComponentsData: (avatarId: string, userHttpOption: IUserHttpOption, isFromCloud?: boolean) => Promise<IAvatarComponent[]>; /** * 获取用户存储的脸部信息 * @param worldId * @param appId * @param userId * @param isFromCloud * @returns */ export declare const getSavedFaceData: (avatarId: string, userHttpOption: IUserHttpOption, isFromCloud?: boolean) => Promise<Record<"Face_Whole_Height" | "Face_Applezone_Width" | "Face_Applezone_VerticalPos" | "Face_Applezone_Thick" | "Face_Cheek_Width" | "Face_Cheek_VerticalPos" | "Face_Cheek_Thick" | "Face_LowerJaw_Width" | "Face_LowerJaw_VerticalPos" | "Face_Jaw_Wdith" | "Face_Jaw_Height" | "Face_Jaw_ZPos" | "EyeBrow_Whole_Margin" | "EyeBrow_Whole_VerticalPos" | "EyeBrow_Inner_HorizonPos" | "EyeBrow_Inner_VerticalPos" | "EyeBrow_Middle_HorizonPos" | "EyeBrow_Middle_VerticalPos" | "EyeBrow_Outter_HorizonPos" | "EyeBrow_Outter_VerticalPos" | "Eye_Whole_Scale" | "Eye_Whole_Margin" | "Eye_Whole_VerticalPos" | "Eye_Whole2_ZPos" | "Eye_Whole2_Rotate" | "Eye_Whole2_Eyelid" | "Eye_CornInner_Margin" | "Eye_CornInner_VerticalPos" | "Eye_CornOutter_Margin" | "Eye_CornOutter_VerticalPos" | "Eye_UpEyelid_Shape" | "Eye_UpEyelid_VerticalPos" | "Eye_LowEyelid_Shape" | "Eye_LowEyelid_VerticalPos" | "Nose_Whole_Width" | "Nose_Whole_Height" | "Nose_NasalTip_Scale" | "Nose_NasalTip_VerticalPos" | "Nose_NasalTip_ZPos" | "Nose_NoseWing_Width" | "Nose_NoseWing_VerticalPos" | "Nose_NoseBridge_Width" | "Nose_NoseBridge_ZPos" | "Mouth_Whole_Scale" | "Mouth_Whole_VerticalPos" | "Mouth_Whole_ZPos" | "Mouth_UpLip_Width" | "Mouth_UpLip_Height" | "Mouth_Lip_MShape" | "Mouth_Lip_VerticalPos" | "Mouth_LowLip_Width" | "Mouth_LowLip_Height" | "Mouth_Corn_Width" | "Mouth_Corn_VerticalPos", number>>; export declare const getSavedSkinData: (avatarId: string, userHttpOption: IUserHttpOption, isFromCloud?: boolean) => Promise<number>; export declare const getDefaultFaceData: () => Record<"Face_Whole_Height" | "Face_Applezone_Width" | "Face_Applezone_VerticalPos" | "Face_Applezone_Thick" | "Face_Cheek_Width" | "Face_Cheek_VerticalPos" | "Face_Cheek_Thick" | "Face_LowerJaw_Width" | "Face_LowerJaw_VerticalPos" | "Face_Jaw_Wdith" | "Face_Jaw_Height" | "Face_Jaw_ZPos" | "EyeBrow_Whole_Margin" | "EyeBrow_Whole_VerticalPos" | "EyeBrow_Inner_HorizonPos" | "EyeBrow_Inner_VerticalPos" | "EyeBrow_Middle_HorizonPos" | "EyeBrow_Middle_VerticalPos" | "EyeBrow_Outter_HorizonPos" | "EyeBrow_Outter_VerticalPos" | "Eye_Whole_Scale" | "Eye_Whole_Margin" | "Eye_Whole_VerticalPos" | "Eye_Whole2_ZPos" | "Eye_Whole2_Rotate" | "Eye_Whole2_Eyelid" | "Eye_CornInner_Margin" | "Eye_CornInner_VerticalPos" | "Eye_CornOutter_Margin" | "Eye_CornOutter_VerticalPos" | "Eye_UpEyelid_Shape" | "Eye_UpEyelid_VerticalPos" | "Eye_LowEyelid_Shape" | "Eye_LowEyelid_VerticalPos" | "Nose_Whole_Width" | "Nose_Whole_Height" | "Nose_NasalTip_Scale" | "Nose_NasalTip_VerticalPos" | "Nose_NasalTip_ZPos" | "Nose_NoseWing_Width" | "Nose_NoseWing_VerticalPos" | "Nose_NoseBridge_Width" | "Nose_NoseBridge_ZPos" | "Mouth_Whole_Scale" | "Mouth_Whole_VerticalPos" | "Mouth_Whole_ZPos" | "Mouth_UpLip_Width" | "Mouth_UpLip_Height" | "Mouth_Lip_MShape" | "Mouth_Lip_VerticalPos" | "Mouth_LowLip_Width" | "Mouth_LowLip_Height" | "Mouth_Corn_Width" | "Mouth_Corn_VerticalPos", number>; export declare const getLocalDiyFaceDraft: (avatarId: string, userId: string) => Record<"Face_Whole_Height" | "Face_Applezone_Width" | "Face_Applezone_VerticalPos" | "Face_Applezone_Thick" | "Face_Cheek_Width" | "Face_Cheek_VerticalPos" | "Face_Cheek_Thick" | "Face_LowerJaw_Width" | "Face_LowerJaw_VerticalPos" | "Face_Jaw_Wdith" | "Face_Jaw_Height" | "Face_Jaw_ZPos" | "EyeBrow_Whole_Margin" | "EyeBrow_Whole_VerticalPos" | "EyeBrow_Inner_HorizonPos" | "EyeBrow_Inner_VerticalPos" | "EyeBrow_Middle_HorizonPos" | "EyeBrow_Middle_VerticalPos" | "EyeBrow_Outter_HorizonPos" | "EyeBrow_Outter_VerticalPos" | "Eye_Whole_Scale" | "Eye_Whole_Margin" | "Eye_Whole_VerticalPos" | "Eye_Whole2_ZPos" | "Eye_Whole2_Rotate" | "Eye_Whole2_Eyelid" | "Eye_CornInner_Margin" | "Eye_CornInner_VerticalPos" | "Eye_CornOutter_Margin" | "Eye_CornOutter_VerticalPos" | "Eye_UpEyelid_Shape" | "Eye_UpEyelid_VerticalPos" | "Eye_LowEyelid_Shape" | "Eye_LowEyelid_VerticalPos" | "Nose_Whole_Width" | "Nose_Whole_Height" | "Nose_NasalTip_Scale" | "Nose_NasalTip_VerticalPos" | "Nose_NasalTip_ZPos" | "Nose_NoseWing_Width" | "Nose_NoseWing_VerticalPos" | "Nose_NoseBridge_Width" | "Nose_NoseBridge_ZPos" | "Mouth_Whole_Scale" | "Mouth_Whole_VerticalPos" | "Mouth_Whole_ZPos" | "Mouth_UpLip_Width" | "Mouth_UpLip_Height" | "Mouth_Lip_MShape" | "Mouth_Lip_VerticalPos" | "Mouth_LowLip_Width" | "Mouth_LowLip_Height" | "Mouth_Corn_Width" | "Mouth_Corn_VerticalPos", number>; export declare const getLocalComponentDraft: (avatarId: string, userId: string) => IAvatarComponent[]; export declare const deleteLocalComponentDraft: (avatarId: string) => void; /** * 当前换装数据是否保存判断 * @param userId * @param faceDiyMap * @returns */ export declare const isComponentSaved: (avatarId: string, userId: string, componentList: IAvatarComponent[]) => boolean; /** * 当前捏脸数据faceDiyMap保存判断 * @param userId * @param faceDiyMap * @returns */ export declare const isFaceDiyMapSaved: (avatarId: string, userId: string, faceDiyMap: Record<SliderListType, number>) => boolean; export declare const saveFaceDraftDataToLocal: (avatarId: string, userId: string, faceDiyMap: Record<SliderListType, number>) => void; export declare const deleteLocalDiyFaceDraft: (avatarId: string) => void; export declare const saveFaceDataToLocal: (avatarId: string, userId: string, faceDiyMap: Record<SliderListType, number>) => void; export declare const saveComponentsDraftToLocal: (avatarId: string, userId: string, components: IAvatarComponent[]) => void; export declare const saveComponentsToLocal: (avatarId: string, userId: string, components: IAvatarComponent[]) => void; export declare const saveSkinDataToLocal: (avatarId: string, userId: string, skin: number) => void; export declare const saveSkinDataDraftToLocal: (avatarId: string, userId: string, skin: number) => void; export declare const deleteLocalSkinDraft: (avatarId: string) => void; export declare const getLocalSkinDraft: (avatarId: string, userId: string) => number;