Add glitch message for OFFICIAL_SVG_IS_INCORRECT

This commit is contained in:
Emi Matchu 2021-03-13 01:58:06 -08:00
parent 6ebbc4af02
commit 5a74b9df8f

View file

@ -190,7 +190,7 @@ function OutfitControls({
justify="center" justify="center"
> >
<OutfitHTML5Badge appearance={appearance} /> <OutfitHTML5Badge appearance={appearance} />
<Box width="1" /> <Box width="2" />
<OutfitKnownGlitchesBadge appearance={appearance} /> <OutfitKnownGlitchesBadge appearance={appearance} />
</Flex> </Flex>
<Box flex="0 0 auto"> <Box flex="0 0 auto">
@ -283,21 +283,42 @@ function OutfitHTML5Badge({ appearance }) {
function OutfitKnownGlitchesBadge({ appearance }) { function OutfitKnownGlitchesBadge({ appearance }) {
const glitchMessages = []; const glitchMessages = [];
// Look for conflicts between Static pet zones (UCs), and Static items.
const petHasStaticZone = appearance.petAppearance?.layers.some( const petHasStaticZone = appearance.petAppearance?.layers.some(
(l) => l.zone.id === "46" (l) => l.zone.id === "46"
); );
const itemHasStaticZone = appearance.itemAppearances if (petHasStaticZone) {
?.map((a) => a.layers) for (const item of appearance.items) {
.flat() const itemHasStaticZone = item.appearance.layers.some(
.some((l) => l.zone.id === "46"); (l) => l.zone.id === "46"
if (petHasStaticZone && itemHasStaticZone) { );
if (itemHasStaticZone) {
glitchMessages.push( glitchMessages.push(
<Box key="static-zone-conflict"> <Box key={`static-zone-conflict-for-item-${item.id}`}>
When you apply a Static-zone item to an Unconverted pet, it hides the When you apply a Static-zone item like <i>{item.name}</i> to an
pet. This is a known bug on Neopets.com, so we reproduce it here, too. Unconverted pet, it hides the pet. This is a known bug on
Neopets.com, so we reproduce it here, too.
</Box> </Box>
); );
} }
}
}
// 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(
<Box key={`official-svg-is-incorrect-for-item-${item.id}`}>
There's a glitch in the art for <i>{item.name}</i> 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.
</Box>
);
}
}
if (glitchMessages.length === 0) { if (glitchMessages.length === 0) {
return null; return null;