From 5a74b9df8f26faf3088b7075a672114c8f546903 Mon Sep 17 00:00:00 2001 From: Matchu Date: Sat, 13 Mar 2021 01:58:06 -0800 Subject: [PATCH] Add glitch message for OFFICIAL_SVG_IS_INCORRECT --- src/app/WardrobePage/OutfitControls.js | 43 +++++++++++++++++++------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/src/app/WardrobePage/OutfitControls.js b/src/app/WardrobePage/OutfitControls.js index 3309db78..c10af766 100644 --- a/src/app/WardrobePage/OutfitControls.js +++ b/src/app/WardrobePage/OutfitControls.js @@ -190,7 +190,7 @@ function OutfitControls({ justify="center" > - + @@ -283,20 +283,41 @@ function OutfitHTML5Badge({ appearance }) { function OutfitKnownGlitchesBadge({ appearance }) { const glitchMessages = []; + // Look for conflicts between Static pet zones (UCs), and Static items. const petHasStaticZone = appearance.petAppearance?.layers.some( (l) => l.zone.id === "46" ); - const itemHasStaticZone = appearance.itemAppearances - ?.map((a) => a.layers) - .flat() - .some((l) => l.zone.id === "46"); - if (petHasStaticZone && itemHasStaticZone) { - glitchMessages.push( - - When you apply a Static-zone item to an Unconverted pet, it hides the - pet. This is a known bug on Neopets.com, so we reproduce it here, too. - + if (petHasStaticZone) { + for (const item of appearance.items) { + const itemHasStaticZone = item.appearance.layers.some( + (l) => l.zone.id === "46" + ); + if (itemHasStaticZone) { + glitchMessages.push( + + When you apply a Static-zone item like {item.name} to an + Unconverted pet, it hides the pet. This is a known bug on + Neopets.com, so we reproduce it here, too. + + ); + } + } + } + + // Look for items with the OFFICIAL_SVG_IS_INCORRECT glitch. + for (const item of appearance.items) { + const itemHasOfficialSvgIsIncorrect = item.appearance.layers.some((l) => + l.knownGlitches.includes("OFFICIAL_SVG_IS_INCORRECT") ); + if (itemHasOfficialSvgIsIncorrect) { + glitchMessages.push( + + There's a glitch in the art for {item.name} 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 at larger screen sizes. + + ); + } } if (glitchMessages.length === 0) {