This commit is contained in:
Polaris 2024-08-21 16:03:21 -04:00
parent 3a81a54621
commit de2006e8ae
6 changed files with 14 additions and 15 deletions

4
.gitignore vendored
View File

@ -36,9 +36,9 @@ yarn-error.log*
next-env.d.ts
.env
/public/avatarAccessory
/public/avatarStatic
/public/avatarAccessories
/public/chunithm_partners
/public/chusan_partners
/public/jacketArts
/public/mapIcons

View File

@ -36,7 +36,7 @@ type chunithm_avatar = chuni_static_avatar;
const getAvatarTextureSrc = (id: number | undefined) => {
if (id === undefined) return "";
return `avatarAccessory/CHU_UI_Avatar_Tex_0${id}.png`;
return `avatarAccessories/CHU_UI_Avatar_Tex_0${id}.png`;
};
type AvatarSelectionProps = {
@ -114,14 +114,12 @@ export const AvatarCustomization: FC<AvatarSelectionProps> = ({
fetchAvatarParts();
}, []);
function onSubmit(data: z.infer<typeof FormSchema>) {
// Existing state
const defaultHeadId = avatarHeadId;
const defaultFaceId = avatarFaceId;
const defaultBackId = avatarBackId;
const defaultWearId = avatarWearId;
const defaultItemId = avatarItemId;
// either change to the new body part id or fallback to the default if nothing has changed
const newHeadId = data.AvatarHeadAccessory ?? defaultHeadId;
const newFaceId = data.AvatarFaceAccessory ?? defaultFaceId;
const newBackId = data.AvatarBackAccessory ?? defaultBackId;
@ -174,49 +172,49 @@ export const AvatarCustomization: FC<AvatarSelectionProps> = ({
AvatarHeadAccessory: {
src: getTexture(
form.watch("AvatarHeadAccessory"),
`avatarAccessory/CHU_UI_Avatar_Tex_0${avatarHeadId}.png`,
`avatarAccessories/CHU_UI_Avatar_Tex_0${avatarHeadId}.png`,
),
className: "avatar_head",
},
AvatarFaceAccessory: {
src: getTexture(
form.watch("AvatarFaceAccessory"),
`avatarAccessory/CHU_UI_Avatar_Tex_0${avatarFaceId}.png`,
`avatarAccessories/CHU_UI_Avatar_Tex_0${avatarFaceId}.png`,
),
className: "avatar_face",
},
AvatarItemAccessoryR: {
src: getTexture(
form.watch("AvatarItemAccessory"),
`avatarAccessory/CHU_UI_Avatar_Tex_0${avatarItemId}.png`,
`avatarAccessories/CHU_UI_Avatar_Tex_0${avatarItemId}.png`,
),
className: "avatar_item_r ",
},
AvatarItemAccessoryL: {
src: getTexture(
form.watch("AvatarItemAccessory"),
`avatarAccessory/CHU_UI_Avatar_Tex_0${avatarItemId}.png`,
`avatarAccessories/CHU_UI_Avatar_Tex_0${avatarItemId}.png`,
),
className: "avatar_item_l ",
},
AvatarBackAccessory: {
src: getTexture(
form.watch("AvatarBackAccessory"),
`avatarAccessory/CHU_UI_Avatar_Tex_0${avatarBackId}.png`,
`avatarAccessories/CHU_UI_Avatar_Tex_0${avatarBackId}.png`,
),
className: "avatar_back",
},
AvatarWearAccessory: {
src: getTexture(
form.watch("AvatarWearAccessory"),
`avatarAccessory/CHU_UI_Avatar_Tex_0${avatarWearId}.png`,
`avatarAccessories/CHU_UI_Avatar_Tex_0${avatarWearId}.png`,
),
className: "avatar_wear",
},
avatarSkinAccessory: {
src: getTexture(
avatarSkinId,
`avatarAccessory/CHU_UI_Avatar_Tex_0${avatarSkinId}.png`,
`avatarAccessories/CHU_UI_Avatar_Tex_0${avatarSkinId}.png`,
),
className: "avatar_skin",
},
@ -226,7 +224,7 @@ export const AvatarCustomization: FC<AvatarSelectionProps> = ({
},
AvatarSkinFootR: {
src: `avatarAccessory/CHU_UI_Avatar_Tex_0${avatarSkinId}.png`,
src: `avatarAccessories/CHU_UI_Avatar_Tex_0${avatarSkinId}.png`,
className: "avatar_skinfoot_r",
},
AvatarLeftHand: {
@ -234,7 +232,7 @@ export const AvatarCustomization: FC<AvatarSelectionProps> = ({
className: "avatar_hand_l",
},
AvatarSkinFootL: {
src: `avatarAccessory/CHU_UI_Avatar_Tex_0${avatarSkinId}.png`,
src: `avatarAccessories/CHU_UI_Avatar_Tex_0${avatarSkinId}.png`,
className: "avatar_skinfoot_l",
},

View File

@ -109,7 +109,8 @@ export const MapIconCustomization: FC<SystemVoiceSelectionProps> = ({
src: mapIconId
? getTexture(
form.watch("mapIconId"),
`mapIcon/CHU_UI_MapIcon_${mapIconId.toString().padStart(8, "0")}.png`,
`mapIcons/CHU_UI_MapIcon_${mapIconId.toString().padStart(8, "0")}.png`,
)
: `systemVoiceThumbnails/CHU_UI_SystemVoice_Default.png`,
},

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB