From f9b4852da1fff5690e043d442951d9cab0f7ad44 Mon Sep 17 00:00:00 2001 From: Matchu Date: Sat, 14 Aug 2021 16:46:05 -0700 Subject: [PATCH] Handle OFFICIAL_SWF_IS_INCORRECT for pet layers Marking this glitch on the Yellow Lutari head today, and oops there isn't UI copy for it yet! Added! Also fixed some bugs in here, like old text about the position of the pose picker relative to the glitch badge, and I noticed while debugging that `layerUsesHTML5` returns a truthy string instead of a boolean which seems error-prone! --- .../WardrobePage/OutfitKnownGlitchesBadge.js | 24 +++++++++++++++++-- src/app/components/HTML5Badge.js | 10 ++++---- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/src/app/WardrobePage/OutfitKnownGlitchesBadge.js b/src/app/WardrobePage/OutfitKnownGlitchesBadge.js index f02248c..8bbf88b 100644 --- a/src/app/WardrobePage/OutfitKnownGlitchesBadge.js +++ b/src/app/WardrobePage/OutfitKnownGlitchesBadge.js @@ -176,7 +176,8 @@ function OutfitKnownGlitchesBadge({ appearance }) { Invisible pets are affected by a number of glitches, including faces sometimes being visible on-site, and errors in the HTML5 conversion. If this pose looks incorrect, you can try another by clicking the emoji - face to the right. But be aware that Neopets.com might look different! + face next to the species/color picker. But be aware that Neopets.com + might look different! ); } @@ -208,13 +209,32 @@ function OutfitKnownGlitchesBadge({ appearance }) { We know that the art for this pet is incorrect, but we still haven't seen a correct model for this pose yet. Once someone models the correct data, we'll use that instead. For now, you could also try - switching to another pose, by clicking the emoji face to the right! + switching to another pose, by clicking the emoji face next to the + species/color picker! ); } const petLayers = petAppearance?.layers || []; + // Look for pet layers with the OFFICIAL_SWF_IS_INCORRECT glitch. + for (const layer of petLayers) { + const layerHasGlitch = (layer.knownGlitches || []).includes( + "OFFICIAL_SWF_IS_INCORRECT" + ); + if (layerHasGlitch) { + glitchMessages.push( + + We're aware of a glitch affecting the art for this pet's{" "} + {layer.zone.label} zone. Last time we checked, this glitch + affected its appearance on Neopets.com, too. But our version might be + out of date! If you've seen it look better on-site, please email me at + matchu@openneo.net so we can fix it! + + ); + } + } + // Look for pet layers with the OFFICIAL_SVG_IS_INCORRECT glitch. for (const layer of petLayers) { const layerHasOfficialSvgIsIncorrect = (layer.knownGlitches || []).includes( diff --git a/src/app/components/HTML5Badge.js b/src/app/components/HTML5Badge.js index 1c5b214..2b9132d 100644 --- a/src/app/components/HTML5Badge.js +++ b/src/app/components/HTML5Badge.js @@ -135,12 +135,12 @@ export function GlitchBadgeLayout({ } export function layerUsesHTML5(layer) { - return ( + return Boolean( layer.svgUrl || - layer.canvasMovieLibraryUrl || - // If this glitch is applied, then `svgUrl` will be null, but there's still - // an HTML5 manifest that the official player can render. - (layer.knownGlitches || []).includes("OFFICIAL_SVG_IS_INCORRECT") + layer.canvasMovieLibraryUrl || + // If this glitch is applied, then `svgUrl` will be null, but there's still + // an HTML5 manifest that the official player can render. + (layer.knownGlitches || []).includes("OFFICIAL_SVG_IS_INCORRECT") ); }