From db8e7848d7fe81255d771c30547b4c55f845d19b Mon Sep 17 00:00:00 2001 From: Matchu Date: Wed, 17 Mar 2021 05:54:34 -0700 Subject: [PATCH] Glitch info for pets w/ OFFICIAL_SVG_IS_INCORRECT --- src/app/WardrobePage/OutfitControls.js | 18 +++++++++++++++++ src/app/components/useOutfitAppearance.js | 24 +++++++++++++++++------ 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/src/app/WardrobePage/OutfitControls.js b/src/app/WardrobePage/OutfitControls.js index 2221e81..39ebd03 100644 --- a/src/app/WardrobePage/OutfitControls.js +++ b/src/app/WardrobePage/OutfitControls.js @@ -348,6 +348,24 @@ function OutfitKnownGlitchesBadge({ appearance }) { } } + // Check whether the pet has OFFICIAL_SVG_IS_INCORRECT. + const petLayers = petAppearance?.layers || []; + for (const layer of petLayers) { + const layerHasOfficialSvgIsIncorrect = (layer.knownGlitches || []).includes( + "OFFICIAL_SVG_IS_INCORRECT" + ); + if (layerHasOfficialSvgIsIncorrect) { + glitchMessages.push( + + There's a glitch in the art for this pet's {layer.zone.label}{" "} + zone that prevents us from showing the full-scale SVG version of the + image. Instead, we're showing a PNG, which might look a bit blurry on + larger screens. + + ); + } + } + if (glitchMessages.length === 0) { return null; } diff --git a/src/app/components/useOutfitAppearance.js b/src/app/components/useOutfitAppearance.js index 5c322fd..5650da7 100644 --- a/src/app/components/useOutfitAppearance.js +++ b/src/app/components/useOutfitAppearance.js @@ -207,16 +207,26 @@ export const itemAppearanceFragmentForGetVisibleLayers = gql` export const appearanceLayerFragment = gql` fragment AppearanceLayerForOutfitPreview on AppearanceLayer { id - remoteId # HACK: This is for Support tools, but other views don't need it svgUrl canvasMovieLibraryUrl imageUrl(size: SIZE_600) - swfUrl # HACK: This is for Support tools, but other views don't need it - knownGlitches # HACK: This is for Support tools, but other views don't need it bodyId + knownGlitches zone { id depth @client + label @client + } + } +`; + +const appearanceLayerFragmentForSupport = gql` + fragment AppearanceLayerForSupport on AppearanceLayer { + id + remoteId # HACK: This is for Support tools, but other views don't need it + swfUrl # HACK: This is for Support tools, but other views don't need it + zone { + id label @client # HACK: This is for Support tools, but other views don't need it } } @@ -226,12 +236,15 @@ export const itemAppearanceFragment = gql` fragment ItemAppearanceForOutfitPreview on ItemAppearance { id layers { + id ...AppearanceLayerForOutfitPreview + ...AppearanceLayerForSupport # HACK: Most users don't need this! } ...ItemAppearanceForGetVisibleLayers } ${appearanceLayerFragment} + ${appearanceLayerFragmentForSupport} ${itemAppearanceFragmentForGetVisibleLayers} `; @@ -257,12 +270,11 @@ export const petAppearanceFragment = gql` bodyId layers { id - svgUrl - canvasMovieLibraryUrl - imageUrl(size: SIZE_600) + ...AppearanceLayerForOutfitPreview } ...PetAppearanceForGetVisibleLayers } + ${appearanceLayerFragment} ${petAppearanceFragmentForGetVisibleLayers} `;