From efa8a4d4992dc16190fd20a26ab608e254eccd49 Mon Sep 17 00:00:00 2001 From: Matchu Date: Tue, 8 Jun 2021 07:23:13 -0700 Subject: [PATCH] Oops, don't show UC conflict glitch while loading The way we were checking for UC compatibility issues, was also triggering while the appearance was still loading, so items didn't have any appearance layers yet! Now, we check for loading before testing for that glitch. --- .../WardrobePage/OutfitKnownGlitchesBadge.js | 59 ++++++++++--------- 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/src/app/WardrobePage/OutfitKnownGlitchesBadge.js b/src/app/WardrobePage/OutfitKnownGlitchesBadge.js index 51d3085..6132faa 100644 --- a/src/app/WardrobePage/OutfitKnownGlitchesBadge.js +++ b/src/app/WardrobePage/OutfitKnownGlitchesBadge.js @@ -13,34 +13,39 @@ function OutfitKnownGlitchesBadge({ appearance }) { // Look for UC/Invisible/etc incompatibilities that we hid, that we should // just mark Incompatible someday instead; or with correctly partially-hidden // art. - for (const item of items) { - // HACK: We use `getVisibleLayers` with just this pet appearance and item - // appearance, to run the logic for which layers are compatible with - // this pet. But `getVisibleLayers` does other things too, so it's - // plausible that this could do not quite what we want in some cases! - const allItemLayers = item.appearance.layers; - const compatibleItemLayers = getVisibleLayers(petAppearance, [ - item.appearance, - ]).filter((l) => l.source === "item"); + // + // NOTE: This particular glitch is checking for the *absence* of layers, so + // we skip it if we're still loading! + if (!appearance.loading) { + for (const item of items) { + // HACK: We use `getVisibleLayers` with just this pet appearance and item + // appearance, to run the logic for which layers are compatible with + // this pet. But `getVisibleLayers` does other things too, so it's + // plausible that this could do not quite what we want in some cases! + const allItemLayers = item.appearance.layers; + const compatibleItemLayers = getVisibleLayers(petAppearance, [ + item.appearance, + ]).filter((l) => l.source === "item"); - if (compatibleItemLayers.length === 0) { - glitchMessages.push( - - {item.name} isn't actually compatible with this special pet. - We're hiding the item art, which is outdated behavior, and we should - instead be treating it as entirely incompatible. Fixing this is in our - todo list, sorry for the confusing UI! - - ); - } else if (compatibleItemLayers.length < allItemLayers.length) { - glitchMessages.push( - - {item.name}'s compatibility with this pet is complicated, but - we believe this is how it looks: some zones are visible, and some - zones are hidden. If this isn't quite right, please email me at - matchu@openneo.net and let me know! - - ); + if (compatibleItemLayers.length === 0) { + glitchMessages.push( + + {item.name} isn't actually compatible with this special pet. + We're hiding the item art, which is outdated behavior, and we should + instead be treating it as entirely incompatible. Fixing this is in + our todo list, sorry for the confusing UI! + + ); + } else if (compatibleItemLayers.length < allItemLayers.length) { + glitchMessages.push( + + {item.name}'s compatibility with this pet is complicated, but + we believe this is how it looks: some zones are visible, and some + zones are hidden. If this isn't quite right, please email me at + matchu@openneo.net and let me know! + + ); + } } }