From 7c39dcb513bc3bf8ac472138b1b76fe19890914c Mon Sep 17 00:00:00 2001 From: duckietm Date: Thu, 26 Mar 2026 16:29:27 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=86=99=20Small=20fixes=20NFT=20Clothing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../figure-set/AvatarEditorFigureSetItemView.tsx | 12 ++++++------ src/hooks/avatar-editor/useAvatarEditor.ts | 4 +++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/components/avatar-editor/figure-set/AvatarEditorFigureSetItemView.tsx b/src/components/avatar-editor/figure-set/AvatarEditorFigureSetItemView.tsx index 9201ce2..a08321d 100644 --- a/src/components/avatar-editor/figure-set/AvatarEditorFigureSetItemView.tsx +++ b/src/components/avatar-editor/figure-set/AvatarEditorFigureSetItemView.tsx @@ -1,4 +1,4 @@ -import { AvatarFigurePartType } from '@nitrots/nitro-renderer'; +import { AvatarEditorFigureCategory, AvatarFigurePartType } from '@nitrots/nitro-renderer'; import { FC, useEffect, useState } from 'react'; import { AvatarEditorThumbnailsHelper, GetClubMemberLevel, GetConfigurationValue, IAvatarEditorCategoryPartItem } from '../../../api'; import { LayoutCurrencyIcon, LayoutGridItemProps } from '../../../common'; @@ -15,7 +15,7 @@ export const AvatarEditorFigureSetItemView: FC<{ { const { setType = null, partItem = null, isSelected = false, width = '100%', ...rest } = props; const [ assetUrl, setAssetUrl ] = useState(''); - const { selectedColorParts = null, getFigureStringWithFace = null } = useAvatarEditor(); + const { activeModelKey = '', selectedColorParts = null, getFigureStringWithFace = null } = useAvatarEditor(); const clubLevel = partItem.partSet?.clubLevel ?? 0; const isHC = !GetConfigurationValue('hc.disabled', false) && (clubLevel > 0); @@ -34,7 +34,7 @@ export const AvatarEditorFigureSetItemView: FC<{ let url: string = null; - if(setType === AvatarFigurePartType.HEAD) + if(setType === AvatarFigurePartType.HEAD && activeModelKey !== AvatarEditorFigureCategory.NFT) { url = await AvatarEditorThumbnailsHelper.buildForFace(getFigureStringWithFace(partItem.id), partIsLocked || isSellableNotOwned); } @@ -53,16 +53,16 @@ export const AvatarEditorFigureSetItemView: FC<{ }; loadImage(); - }, [ setType, partItem, selectedColorParts, getFigureStringWithFace, isSellableNotOwned ]); + }, [ setType, partItem, selectedColorParts, getFigureStringWithFace, isSellableNotOwned, activeModelKey ]); if(!partItem) return null; return ( - + { !partItem.isClear && isHC && } { partItem.isClear && } { !partItem.isClear && partItem.partSet.isSellable && !isSellableNotOwned && } - { isSellableNotOwned && + { !partItem.isClear && isSellableNotOwned &&
} diff --git a/src/hooks/avatar-editor/useAvatarEditor.ts b/src/hooks/avatar-editor/useAvatarEditor.ts index 3046605..19a39bb 100644 --- a/src/hooks/avatar-editor/useAvatarEditor.ts +++ b/src/hooks/avatar-editor/useAvatarEditor.ts @@ -291,7 +291,9 @@ const useAvatarEditorState = () => if(!partSet || !partSet.isSelectable || ((partSet.gender !== gender) && (partSet.gender !== AvatarFigurePartType.UNISEX))) continue; - const isNftPartSet = nftFigureSetIds.has(partSet.id); + const isNftPartSet = nftFigureSetIds.size > 0 + ? nftFigureSetIds.has(partSet.id) + : GetAvatarRenderManager().downloadManager.isNftPartSet(partSet); if((buildMode === buildModeDefault) && isNftPartSet) continue; if((buildMode === buildModeNft) && !isNftPartSet) continue;